The officially official Devuan Forum!

You are not logged in.

#1 2017-04-14 20:18:00

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,406  

Make a live-CD with live-sdk

WARNING: This is a work in progress. There should be enough to get you started. There is more to come. (including formatting this page)

INTRODUCTION

Devuan's live-sdk uses shell scripts to create a live-CD/DVD iso. With no configuration, live-sdk will make a small, cli-only live iso. To create a live iso with your choice of packages and configurations, you can make your own blend. A blend consists of a config file and a blend file, and it may also contain customized files for the live system and deb packages or even source code for items that aren't in the devuan repository.

The config file contains lists of packages to install or remove along with any variables you want to set. The blend file contains functions to control the build process. Some of these functions may be copied from the sdk and customized. The customized version will override the stock version during the build. It's also possible to add functions that don't exist in the sdk.

For a more complex example and some explanation of the parts of the sdk, see:
Heads Developer Guide (PDF) and also
Heads git repository

REQUIREMENTS

You need these packages installed:
git zsh debootstrap sudo  xz-utils xorriso squashfs-tools live-boot syslinux-common

You will also need live-build.  (I think this can easily be changed to require either syslinux and isolinux or live-build.)

You probably want these, too:
live-config live-config-sysvinit

sudo must be enabled for your user.
(If physical access is not a security issue, do yourself a favor and set sudo with no password, or set the timeout longer than the build time, so you only have to enter the password once.)

These are listed as required by libdevuansdk, but I don't have them, and I'm building isos with live-sdk.
kpartx cgpt

GET LIVE-SDK

git clone https://github.com/parazyd/live-sdk.git
cd live-sdk
git submodule update --init

You can build a minimal live iso without creating a blend. You'll get a very small system with no desktop, the root password will be "toor", there will be no unprivileged user, and most of the standard system utilities will be missing. To do that, use the same commands you would use to build the blend, but leave out the blend_name. You can run this bare build to make sure you have all the requirements; if it doesn't work, you know the problem is not in your blend.

zsh -f
source sdk
load devuan <arch> <blend_name>
build_iso_dist

STEPS TO CREATE A BLEND
Each blend gets its own directory in live-sdk/blends. The example we'll use is simple-ice, and we'll make a small live system with icewm and very few apps. We'll be creating two files in live-sdk/blends/simple-ice/. One is config and the other is <blend_name>.blend, or in this example, simple-ice.blend.

Example blends: Download and unpack the tarball in the live-sdk/blends directory. (subject to change and inconsistency with the howto.)
simple-ice:    (IceWM with a few extra apps)   
jessie-oblx:   (Openbox, custom debs, custom boot menu, uefi bootable)

1. Add a line to the blend map in live-sdk/sdk with the blend name and the location where the blend files can be found. $R is the working directory, live-sdk/. It's also possible to use a URL for the location.

	blend_map=(
		"devuan-live"    "$R/blends/devuan-live/devuan-live.blend"
		"heads"            "$R/../heads.blend"
		"simple-ice"	"$R/blends/simple-ice/simple-ice.blend"
                "jessie-oblx"     "$R/blends/jessie-oblx.blend"
	)

2. Edit config file (live-sdk/blends/simple-ice/config)

Some variables you can use:

image_name
You'll want to give your iso a unique name. The default setting will give you:
devuan_jessie_1.0.0-RC_amd64-live.iso (or -i386-live.iso)

All of these variables except blend_vers are built into the sdk. I added blend_vers for my convenience. It only gets used in the image name here. Whatever you use for an image name will be appended with "-live.iso". You do not need to define the arch here; that will be done when you load the blend at build time.

blend_name="simple-ice"
blend_vers="1.0"

image_name="${blend_name}-${blend_vers}-${arch}"

Use this if you want separate bootstrap tarballs for each blend. (Warning: watch your disk space.)

os="$blend_name"

Add an unprivileged user to the system, change the default shell from dash to bash, and change the root password with the following lines:

username="user"
userpass="user"
default_shell="/bin/bash"
rootcredentials="root:mypassword"

Add some packages.

The package lists exist as arrays in live-sdk. You can add packages to the extra_packages array in the config file as shown in the code box below. Use tabs, not spaces. Note that the syntax here will cause these packages to be added to the extra_packages array if it already exists (i.e. if it's defined elsewhere in the sdk.)

Troubleshooting note: One common reason for a failed build is if one of the listed packages does not exist (or is spelled wrong). It may not be obvious when this happens. Check the logs, but also check your package list.

extra_packages+=(

	grub-pc
	lsof
	bash-completion
	texinfo
	acpi-support-base
	aptitude
	apt-listchanges
	discover
	dnsutils
	doc-debian
	docutils-common
	docutils-doc
	ftp
	gettext
	gnupg2
	laptop-detect
	mlocate
	mutt
	ncurses-term
	nfs-common
	procmail
	reportbug
	telnet
	usbutils
	w3m
	whois
	xorg
	xserver-xorg-video-all
	xterm
	pmount
	spacefm
	lightdm
	icewm
	leafpad
)

Keep dbus?
EDIT: This probably isn't necessary unless you go deeper into the sdk and change the core_packages and base_packages.

The default purge_packages array contains only dbus. Purging dbus will also remove packages needed for many desktops. Disable or replace that purge with:

purge_packages=()

or

purge_packages=(insert your own purge list here)

or to add to the default purge list

purge_packages+=(insert your own purge list here)

Add custom deb packages:

If you want to install deb packages that aren't in the repository, put them in the blend directory and list them in your config file. In this example, we'll add refractasnapshot-base, refractainstaller-base and palemoon web browser. Palemoon and Yad are listed twice because the packages are arch-specific. Comment out the one you don't want in the build. (NOTE: This is not in the simple-ice example tarball, but you could add your own custom debs list and supply the packages. Uncomment the appropriate lines in blend_preinst() in the blend file. See Step 4. Edit the blend file.)

Package lists will be installed in the order they appear. Packages within a list will be installed alphabetically. In this example, refractainstaller-gui and refractasnapshot-gui depend on yad, so yad must be installed first.

# i386
#custom_deb_packages+=(yad_0.27.0-1_i386.deb palemoon_27.2.0~repack-1_i386.deb)

# amd64
custom_deb_packages+=(yad_0.27.0-1_amd64.deb palemoon_27.2.0~repack-1_amd64.deb)

custom_deb_packages+=(
	refractainstaller-base_9.2.1_all.deb
	refractainstaller-gui_9.2.1_all.deb
	refractasnapshot-base_10.0.2_all.deb
	refractasnapshot-gui_10.0.2_all.deb
)

3. Add custom files:

System files (including user files)
Custom config files, icons, images or any other files you want to be present in the live system can be added via the rootfs-overlay. Create a directory inside blends/simple-ice called rootfs-overlay. Files that you add should be placed in their relative positions in the directory tree. So, if you wanted to use a custom sources.list, you'd put your custom file in rootfs-overlay/etc/apt/, and it will be added to the system.

The simple-ice example contains an apt config file to install packages without Recommends, modified xdg files to prevent automatic creation of a bunch of directories in your home. (You know the ones I mean - Documents, Music, Video, etc., all of which I consider spam.) There's also a Devuan replacement for the Debian logo in the IceWM applications button and a couple of config files for IceWM.

blends/simple-ice/rootfs-overlay/
├── etc
│   ├── apt
│   │   └── apt.conf.d
│   │       └── 00norecommends
│   ├── X11
│   │   └── icewm
│   │       ├── focus_mode
│   │       └── theme
│   └── xdg
│       ├── user-dirs.conf
│       └── user-dirs.defaults
└── usr
    └── share
        └── icewm
            └── taskbar
                └── icewm.xpm

For your own blend, you will need to figure out what files you need and where they go.

Isolinux files
If you want custom isolinux boot files, such as a splash image or boot help files, put them in blends/<blend_name>/isolinux-overlay.
The simple-ice example just has a boot splash image.

4. Edit the blend file  (live-sdk/blends/simple-ice/simple-ice.blend)

Start your blend file with the following lines, so that the sdk can find your blend.

BLENDPATH="${BLENDPATH:-$(dirname $0)}"
source $BLENDPATH/config

Add the blend_preinst function. Uncomment the last two lines if you have custom debs to install.

blend_preinst() {
	fn blend_preinst
	req=(strapdir blend)
	ckreq || return 1

	notice "executing $blend_name preinst"

	add-user "$username" "$userpass"
	
#	notice "copying blend-specific debs"
#	cp -fv "$BLENDPATH"/*.deb "$R/extra/custom-packages"
	
}

Add the blend_postinst function. This will copy the rootfs-overlay. If your rootfs-overlay is a git repository, see the heads sdk. This also calls the blend_finalize function, which contains instructions to be run in the chrooted system.

blend_postinst() {
	fn blend_postinst
	req=(strapdir)
	ckreq || return 1

	notice "executing $blend_name postinst"
		
	pushd "$strapdir"
		sudo rsync -avx "$BLENDPATH"/rootfs-overlay/* . || zerr
	popd

	blend_finalize || zerr
}

Add the blend_finalize function to do the following:

    Add user to some groups
    Set the default shell.
    Give user ownership of their files.
    Remove fstab.
    Final cleanup and run updatedb. (I commented out the last autoremove. You might need it.)

blend_finalize() {
	fn blend_finalize
	req=(strapdir)
	ckreq || return 1

	cat <<EOF | sudo tee ${strapdir}/finalize >/dev/null
#!/bin/sh
# finalize
set -x
exec 2>finalize.log

## perms

	for i in cdrom floppy audio dip video plugdev netdev ; do   # lpadmin scanner  # put this in config file?
		gpasswd -a "$username" \${i}
	done
	
	chsh -s "$default_shell" "$username"
	chown -R 1000:1000 /home/"$username"

# remove fstab for iso. This should probably be in iso_prepare_strap
rm -f /etc/fstab

## cleanup

#apt-get --yes --force-yes autoremove
apt-get clean
updatedb
EOF
	chroot-script finalize || zerr
}

5. Make it so!

To build a 64-bit version of the example, from the live-sdk directory, run:

zsh -f
source sdk
load devuan amd64 simple-ice
build_iso_dist

If all goes well, your iso will be in live-sdk/dist/
Exit the zsh shell.

To make the 32-bit version of the same blend, repeat the commands above, but replace amd64 with i386. (Change custom_deb_packages if you have arch-specific packages to install.)

Happy Hacking!

------------------------------------------------------------------------------------------------------------------------------------------------------------------------

EXAMPLE BLEND LAYOUT

simple-ice/
├── config
├── isolinux-overlay
│   └── splash.png
├── rootfs-overlay
│   ├── etc
│   │   ├── apt
│   │   │   └── apt.conf.d
│   │   │       └── 00norecommends
│   │   ├── X11
│   │   │   └── icewm
│   │   │       ├── focus_mode
│   │   │       └── theme
│   │   └── xdg
│   │       ├── user-dirs.conf
│   │       └── user-dirs.defaults
│   └── usr
│       └── share
│           └── icewm
│               └── taskbar
│                   └── icewm.xpm
└── simple-ice.blend

Special instructions for ascii (testing)

Add to the blend config file:

release="ascii"

Right now (March 2017) rsyslog is getting removed at the end of the build and alsa-base does not exist. Workaround is to insert the following line into the debootstrap command at lines 42-44 of zlibs/bootstrap.

--include=busybox,busybox-syslogd --exclude=rsyslog,alsa-base \ 

...and let me know if this changes, so I can keep this doc current. Thanks.

Last edited by fsmithred (2017-04-19 02:50:22)

Offline

#2 2017-04-15 20:59:23

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,406  

Re: Make a live-CD with live-sdk

MANIPULATING THE ISO

See the jessie-oblx example blend. There are some additonal functions in the blend file to customize the boot menu, boot files and other aspects of the iso.

blend_preinst()
    Same as in previous example, except that the lines for copying the custom deb files are uncommented.

blend_postinst()
    Added lines to call the iso_make_efi function, which makes the boot files for uefi.

iso_setup_isolinux()
    Not necessary. This was in the blend before some changes got added to live-sdk. Aside from my comments, this function is identical to the one in lib/libdevuansdk/zlibs/iso, so its presence here is superfluous.

iso_write_isolinux_cfg()
    Customize your isolinux boot menu here. (If you're an expert in this subject, I would like a consult with you.)

iso_squash_strap()
    This is identical to the stock iso_squash_strap function with the exception of the additional x86-specific compression option, "-Xbcj x86" which can reduce a CD-size iso file by about 20MB.

iso_xorriso_build()
    One line was added from the stock function for uefi-compatibility. If you disable uefi in the config file, you also need to remove or comment:
            -eltorito-alt-boot -e boot/grub/efiboot.img -isohybrid-gpt-basdat -no-emul-boot \

iso_make_efi()
    Lifted from refractasnapshot and plugged into the sdk. This might get merged into live-sdk.
    Customize the grub boot menu for uefi boot.

The config file for jessie-oblx is mostly self-explanatory. The base_packages list gets added to the existing base_packages. This makes a bigger bootstrap tarball. The goal of this is to make subsequent builds of the same blend go faster. Sometimes this works, and sometimes it doesn't. Your safest bet for a re-run is to remove everything in live-sdk/tmp/*. You can try deleting only the bootstrap directory for your blend before a re-run. That might work. I'm writing this paragraph off the top of my head, and like this paragraph, some parts of live-sdk are still under construction.

Last edited by fsmithred (2017-04-18 21:45:54)

Offline

#3 2017-04-15 21:10:57

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,406  

Re: Make a live-CD with live-sdk

APPENDIX

This appendix is not complete. It focuses on the elements used in the example blends.
See live-sdk/lib/libdevuansdk/doc/ for more.

VARIABLES

`vars` and `arrs` are global arrays holding other global variables and arrays.
this is required for `zuper` and helps a lot with debugging. if you declare new
variables or arrays, add them to `vars` and `arrs`, respectively.

Built-in variables:

Most of the built-in variables are not required to be in your config file. Add them if you want to override the default settings.

blend_name
    Give your blend a name. You need it for the name of the blend file and for the directory that holds all of the files used in the blend.

os
    default is "devuan" Changing this will affect the default image name. If you change it to os="$blend_name"
    you can have separate tarballs and bootstrap directories for each blend.

release
    default is "jessie"  This will affect the build. NOTE: see special instructions for ascii.

version
    default is currently "1.0.0-RC"

arch
    whatever arch you use in the command 'load devuan <arch> <blend>'
    For a live-CD, choices are i386 or amd64.

image_name
    default is "${os}_${release}_${version}_${arch}"

username
userpass
    These get used with the add-user function.

rootcredentials
    default is root:toor

i386flavor="586"
    default i386 flavor is 686-pae. Use this variable if you want a 586 kernel.

section
   sections of the repo. for adding in /etc/apt/sources.list. separate them
   with whitespaces. default is "main".

Additional variables used in example blends:

blend_vers -
    this only exists in the blend config file and is used for the image name.

default_shell
    this only gets used in the blend file (chsh)

efi_work
    This is a directory where efi boot files get made. I'm not sure where it will end up, but it will appear in another example.

ARRAYS

core_packages
base_packages
    These are part of the sdk that you should not need to change.

extra_packages
    List of additional packages that you want in the build.

custom_deb_packages
    Packages you want installed from the .deb packages you put in your blend directory. Only the packages that are listed will be installed.
    If there are i386 and amd64 versions of a package, both files can be present, and the list needs to be edited to use the right package
    for the arch you're building.

purge_packages
    Anything that gets installed that you want removed.

FUNCTIONS

Functions used in the example blends
ordered according to build_iso_dist. (in live-sdk/lib/libdevuansdk/zlibs/helpers)

blend_preinst
    add user must happen before custom boot menu is created

iso_setup_isolinux
    sudo cp -rav "$BLENDPATH"/isolinux-overlay/* binary/isolinux/

iso_write_isolinux_cfg
    custom boot menu

blend_postinst
    iso_make_efi
    install-custdebs
    copy rootfs-overlay
    blend_finalize

iso_squash_strap
    mksquashfs:        -noappend -comp xz -Xbcj x86 || zerr

iso_xorriso_build
    -eltorito-alt-boot -e boot/grub/efiboot.img -isohybrid-gpt-basdat -no-emul-boot \

Last edited by fsmithred (2017-04-19 13:16:58)

Offline

#4 2017-04-16 00:09:28

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,406  

Re: Make a live-CD with live-sdk

greenjeans wrote:

I got the idea I can build any arch, what I need to know is if I can use live SDK on any arch. Maybe the process works better if you're building in a 64 bit environment or does it not matter?

Good question. I don't know. I've been running it on amd64. I have a feeling it's not possible or it's difficult to do.

Oh, here you go - it's called "cross-debootstrapping"
https://wiki.debian.org/Debootstrap

Offline

#5 2017-04-17 20:01:27

greenjeans
Member
Registered: 2017-04-07
Posts: 505  
Website

Re: Make a live-CD with live-sdk

fsmithred wrote:
greenjeans wrote:

I got the idea I can build any arch, what I need to know is if I can use live SDK on any arch. Maybe the process works better if you're building in a 64 bit environment or does it not matter?

Good question. I don't know. I've been running it on amd64. I have a feeling it's not possible or it's difficult to do.

Oh, here you go - it's called "cross-debootstrapping"
https://wiki.debian.org/Debootstrap

Cool, that's good info, gonna do this then in a clean 64, I have a nice pristine Mate install that I was building from anyway.

So I guess there's no way to do this using "su" instead of sudo? That's one of the things that stopped my first attempt, it's installed on my system but I never use it so my user account isn't in the sudoers file. Heck I can't even remember how to add somebody to sudo, haven't used it in many years.

EDIT: Hey meant to ask, any chance of getting a package list for the "core" and "base" groups of packages? Would be a valuable aid in learning what is and isn't needed to run the basic system.

Last edited by greenjeans (2017-04-17 21:48:57)


https://sourceforge.net/projects/vuu-do/
Vuu-do GNU/Linux, minimal Devuan-based openbox systems to build on, maximal versions if you prefer your linux fully-loaded.

Please donate to support Devuan and init freedom! https://devuan.org/os/donate

Offline

#6 2017-04-18 03:19:39

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,406  

Re: Make a live-CD with live-sdk

I will have more to say about core and base packages. Look in live-sdk/lib/libdevuanskd/config, but don't mess with them. What you see there is what gets added to the initial debootstrap install.

sudo is written into the scripts in a few places, so it won't really work to use su.

The easy way to get sudo is to add your user to the sudo group.

adduser <username> sudo

Offline

#7 2017-04-18 21:22:10

greenjeans
Member
Registered: 2017-04-07
Posts: 505  
Website

Re: Make a live-CD with live-sdk

Okay, ran a test making just the cli-iso as detailed in the tutorial, seems all is well as I now have an iso (haven't tested it yet).

But man, iso is 341 mb, does that sound right? CLI-only with just the few packages on there ought to be like 250 or less shouldn't it? At 348 it's 13 mb larger than the fully functional openbox mini I just made. 

I looked at some of the scripts and it looks like it's using xz with the extra compression of -xbcj x86, am I wrong about that?

Some other reasons why it's big from the bootstrap folder:

Giant folder with much added stuff:  /usr/share/vim/vim74 = 26 mb , same folder normally on my system = 7.4 kb

Ginormous added file :  /usr/share/keyrings/debian-keyring.gpg = 50 mb , there is no such file on any of my installed systems, do I need a debian-keyring?

30 mb of doc files and 60 mb of translations, guess that's standard operating procedure for the distro, i'll just have to tweak when I make a blend.

All the apt lists in /var/lib/apt/lists that I usually don't include are another 36.5 mb.

/var/cache/debconf has a couple of *.dat-old files that were left in there, 2.3 mb for one of them, not needed.

git-core in /usr/lib, 14.7 mb, don't need this

SSH server, didn't need that.

Just my .02 worth.

DISCLAIMER: I could have done something wrong, I didn't start over from beginning, just added live-build dependency and went back into the live-sdk folder and ran the commands again:

zsh -f
source sdk
load devuan <arch> <blend_name>
build_iso_dist

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

fsmithred wrote:

I will have more to say about core and base packages. Look in live-sdk/lib/libdevuanskd/config, but don't mess with them. What you see there is what gets added to the initial debootstrap install.

You know that saying that pretty much guarantees that i'm gonna mess with them right? ;-)

aaand there's what seems to be the debian-keyring....sssh server and client...and git-core

And this line I have a question about: vars+=(arch earch) ,  is "earch" a thing?

Last edited by greenjeans (2017-04-18 23:14:29)


https://sourceforge.net/projects/vuu-do/
Vuu-do GNU/Linux, minimal Devuan-based openbox systems to build on, maximal versions if you prefer your linux fully-loaded.

Please donate to support Devuan and init freedom! https://devuan.org/os/donate

Offline

#8 2017-04-18 22:38:30

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,406  

Re: Make a live-CD with live-sdk

cp: cannot stat '/usr/share/live/build/bootloaders/isolinux/isolinux.bin': No such file or directory

Problem is that this file appears to be missing. It should be there if you installed live-build, along with some *.c32 files. Are they there? Is live-build really installed?

Oh, and you're not getting senile. I added live-build to the list of requirements kinda late.

Last edited by fsmithred (2017-04-18 22:51:31)

Offline

#9 2017-04-18 22:56:30

greenjeans
Member
Registered: 2017-04-07
Posts: 505  
Website

Re: Make a live-CD with live-sdk

fsmithred wrote:

cp: cannot stat '/usr/share/live/build/bootloaders/isolinux/isolinux.bin': No such file or directory

Problem is that this file appears to be missing. It should be there if you installed live-build, along with some *.c32 files. Are they there? Is live-build really installed?

It worked, I tried to edit the above post and will try again here in a sec. Have some thoughts on first run.

Oh, and you're not getting senile. I added live-build to the list of requirements kinda late.

That's what got me, copy-pasta'ed your post a day or two ago in a text file and was working off those instructions.

Last edited by greenjeans (2017-04-18 23:03:59)


https://sourceforge.net/projects/vuu-do/
Vuu-do GNU/Linux, minimal Devuan-based openbox systems to build on, maximal versions if you prefer your linux fully-loaded.

Please donate to support Devuan and init freedom! https://devuan.org/os/donate

Offline

#10 2017-04-19 02:51:02

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,406  

Re: Make a live-CD with live-sdk

install syslinux-common

Offline

#11 2017-04-19 03:18:05

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,406  

Re: Make a live-CD with live-sdk

No, don't mess with them there. You can add to core_packages and base_packages in your config file, and you can remove the stuff you don't want by adding it to the purge_packages list, or replace the purge_packages list as I did below. The following lists will give you approximately what you'd get with a minimal install with standard system checked. The purge list removes things that would not be in the standard install. (Note that grubversion is a variable here.)

This adds to the existing list. (+=)

base_packages+=(
	lsof
	bash-completion
	texinfo
	acpi-support-base
	aptitude
	apt-listchanges
	discover
	dnsutils
	doc-debian
	docutils-common
	docutils-doc
	ftp
	gettext
	gnupg2
	gparted
	$grubversion
	laptop-detect
	mlocate
	mutt
	ncurses-term
	nfs-common
	procmail
	reportbug
	telnet
	usbutils
	w3m
	whois
)

This replaces the existing purge list, which contains dbus. If you want dbus removed, change the `=' to `+='.

purge_packages=(
	btrfs-tools
	debian-keyring
	elinks
	elinks-data
	git
	git-core
	git-man
	liberror-perl
	libfsplib0
	libtre5
	openntpd
	openssh-server
	openssh-sftp-server
	tmux
	zsh
	zsh-common
)

- See the comment regarding where to add --no-install-recommends. if that's what you want. (in the jessie-oblx config. Line numbers might be off a bit.)
- See the line in blend_finalize that says 'rm -f /etc/fstab'. That should give you some ideas, and around there would be the place to do it.
- Look at the lists in the links below. You DO NOT want to list all those packages in your build. Listing some of the ones you want will get you others. Have fun figuring out which ones you really need. (Take careful notes on a VM install in prep for building a blend.)
- Run some commands to tell you what the package manager considers Required, Standard or Important.

aptitude search ~prequired
aptitude search ~pstandard
aptitude search ~pimportant

- Read the man page for tasksel. (not so important for lean installs, but it'll give you an idea of what not to install.)
- Re-read the third bullet above.

Here's the list of packages in a  debootstrap install.
Here's the list of packages you get with a minimal install
And here's the list for standard system utilities

-

Last edited by fsmithred (2017-04-19 16:05:42)

Offline

#12 2017-04-19 20:04:05

greenjeans
Member
Registered: 2017-04-07
Posts: 505  
Website

Re: Make a live-CD with live-sdk

fsmithred wrote:

No, don't mess with them there. You can add to core_packages and base_packages in your config file, and you can remove the stuff you don't want by adding it to the purge_packages list, or replace the purge_packages list as I did below.

Ahh, well there's the rub seemingly for the basic iso i'm trying to make to start with, not using a blend file for it, just running the basic instructions.

So i'll need to make a custom blend for the cli-iso too if I want to adjust packages in/out. And a custom rm list for some things.

For custom configs and removal of extra locales and such, it would almost seem easier if a user could just mod bootstrap-devuan-amd64.tgz prior to feeding it into the build? Or the unpacked bootstrap folder itself.

So the idea is basically, that rootfs-overlay folder is sort of an etc/skel for the entire file system, yes? But only insofar as adding things, not replacing or overwriting things already in the folders/files?

That's a lot of good info, thanks for taking the time to post all that. smile


https://sourceforge.net/projects/vuu-do/
Vuu-do GNU/Linux, minimal Devuan-based openbox systems to build on, maximal versions if you prefer your linux fully-loaded.

Please donate to support Devuan and init freedom! https://devuan.org/os/donate

Offline

#13 2017-04-20 01:08:12

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,406  

Re: Make a live-CD with live-sdk

core_packages and base_packages get installed, and purge_packages get removed, and then the bootstrap tarball is created. So put the additional base_packages in your config, and also put your purge_packages there (either add to it or replace it as described somewhere above.) You should be able to reuse the tarball for both cli and desktop builds, but you should get rid of the bootstrap directory. Unfortunately, that needs to be fixed. Right now, you're better off wiping out tmp/* between runs, but I expect that will get ironed out. If you think this is not a clear answer, you are correct.

Yeah, the overlays are kinda like /etc/skel. They copy files into the bootstrap directory to be packed in the iso. The rsync command to copy the rootfs-overlay is in blend_postinst in the blend file. If you added a delete option to that, then everything that isn't in rootfs-overlay would get deleted. That would be your entire system minus what's in rootfs-overlay. Better to remove stuff in a chroot script in blend_finalize (or earlier if needed.)

Offline

#14 2017-04-24 10:59:51

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,406  

Re: Make a live-CD with live-sdk

see this: https://dev1galaxy.org/viewtopic.php?id=569

System files from rootfs-overlay can get copied to the system with user as owner, instead of root.

In the blend file, change the rsync command that's in blend_postinst() to:

sudo rsync -avx --no-o --no-g "$BLENDPATH"/rootfs-overlay/* . || zerr

Or change the rsync to a cp command. The --no-o and --no-g prevent rsync from preserving the file's owner and group. Any files in in the overlay that go into the user's home will need to be changed back to user:user in blend_finalize(). Be careful if some of your system files in the overlay are actually owned by a system account (e.g. mysql, www-data).

Offline

#15 2017-05-01 21:51:54

Ozi
Member
From: Melbourne, Australia
Registered: 2017-03-15
Posts: 105  
Website

Re: Make a live-CD with live-sdk

Is there likely going to be an overlay for binary, with the isolinux folder within that overlay?

Just thinking for down the track for the devuan installer.

Offline

#16 2017-05-02 00:50:00

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,406  

Re: Make a live-CD with live-sdk

Ozi,

There is an isolinux-overlay in the jessie-oblx blend and in the devuan-live blend at parazyd's github, although I'm not sure if that one is working right now. He made some changes that we didn't finish testing before the big push on RC2. And for my latest build, I added a hooks directory and a line to copy a hookscript into the iso.

This is currently at the end of iso_write_isolinux.cfg

	notice "copying isolinux overlay"
	sudo mkdir -p "$workdir"/binary/{live,isolinux}
	sudo cp -av "$BLENDPATH"/isolinux-overlay/* "$workdir"/binary/isolinux/

I had the last line in iso_setup_isolinux, but it got moved. It works in either place. I also added

sudo cp -av "$BLENDPATH"/hooks "$workdir"/binary/live/

Offline

#17 2017-05-02 21:40:16

Ozi
Member
From: Melbourne, Australia
Registered: 2017-03-15
Posts: 105  
Website

Re: Make a live-CD with live-sdk

Excellent! Thanks

I'm very interested in greenjeans stripped down package list, I want to make a minimal desktop. smile

Offline

#18 2017-05-15 21:58:44

pcalvert
Member
Registered: 2017-05-15
Posts: 191  

Re: Make a live-CD with live-sdk

Hi,

What is the reason for switching from live-build to live-sdk?

Phil


Freespoke is a new search engine that respects user privacy and does not engage in censorship.

Offline

#19 2017-05-16 18:31:13

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,406  

Re: Make a live-CD with live-sdk

pcalvert wrote:

Hi,

What is the reason for switching from live-build to live-sdk?

Phil

I'm not sure. I know that live-sdk uses some of the same libraries as the devuan sdk that's used for building all the other images, so at least part of the decision was for consistency. I also know that early on, it was impossible to build an iso with live build-that didn't include systemd. I just tried the version of live-build in jessie, and it looks like it was neglected. It still uses debian repos. I just changed that and it's running. I'll know more in a little while.

I'm hoping Ozi will say something here. He uses live-build and knows more about it.

Edit: This is with version 4.0.3-1+devuan2, which looks to be the only one in jessie, ascii and ceres.

The following packages have unmet dependencies:
 live-config-systemd : Depends: systemd but it is not installable
                       Recommends: dbus but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Last edited by fsmithred (2017-05-16 18:36:17)

Offline

#20 2017-05-16 23:15:56

pcalvert
Member
Registered: 2017-05-15
Posts: 191  

Re: Make a live-CD with live-sdk

I just used live-build ten days ago to build a default Devuan ISO. And according to the package list, there are no systemd files on it, not even libsystemd0. I did have to use a "trick" to get it to build, though. In the past I encountered the same problem that you did, but this time around I was more persistent and found the solution/workaround. More on that shortly...

Phil


Freespoke is a new search engine that respects user privacy and does not engage in censorship.

Offline

#21 2017-05-23 03:22:31

Ozi
Member
From: Melbourne, Australia
Registered: 2017-03-15
Posts: 105  
Website

Re: Make a live-CD with live-sdk

Hi Guys

I'm busy with work atm, so haven't noticed your posts.

I don't have a problem with live-build in either Devuan or Debian, still use them both. My Devuan build doesn't use any Debianrepos. and I have pinning to exclude *systemd*.  If there are any packages with systemd in the name they would be non functioning in a systemd sense. The last Devuan build I did was 5 hours ago, just worked. I've also build images without dbus as well. I have some well established patterns I use for the build, so the builds are now usually very consistent and stable, unless there are package or dependency changes.

I don't think Frits has done any changes in a while, but I know he was in the process of bringing in live-build 5.x to the repos. Don't know what stage that is in now though.

Also, I'd like to see Daniel Baumann's open-infrastructure-system-build package brought in Devuan.

Ozi

Last edited by Ozi (2017-05-23 03:34:51)

Offline

#22 2017-05-26 00:33:11

Ozi
Member
From: Melbourne, Australia
Registered: 2017-03-15
Posts: 105  
Website

Re: Make a live-CD with live-sdk

fsmithred wrote:
pcalvert wrote:

Hi,

What is the reason for switching from live-build to live-sdk?

Phil

I'm not sure. I know that live-sdk uses some of the same libraries as the devuan sdk that's used for building all the other images, so at least part of the decision was for consistency. I also know that early on, it was impossible to build an iso with live build-that didn't include systemd. I just tried the version of live-build in jessie, and it looks like it was neglected. It still uses debian repos. I just changed that and it's running. I'll know more in a little while.

I'm hoping Ozi will say something here. He uses live-build and knows more about it.

Edit: This is with version 4.0.3-1+devuan2, which looks to be the only one in jessie, ascii and ceres.

The following packages have unmet dependencies:
 live-config-systemd : Depends: systemd but it is not installable
                       Recommends: dbus but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I don't actually install live-config-systemd, I only ever install sysvinit-core and use the /etc/apt folder from the latest devuan iso.

Package: live-config
Version: 4.0.4-1
Installed-Size: 156
Maintainer: Live Systems Maintainers <debian-live@lists.debian.org>
Architecture: all
Depends: live-config-sysvinit | live-config-backend
Recommends: live-config-doc, live-tools, iproute2 | iproute, keyboard-configuration, locales | locales-all, user-setup, sudo
Suggests: pciutils, wget
Description: Live System Configuration Components
Homepage: http://live-systems.org/devel/live-config/
Description-md5: 2c8c126bc8f6972936f1f4f2248300a9
Section: misc
Priority: optional
Filename: pool/DEBIAN/main/l/live-config/live-config_4.0.4-1_all.deb
Size: 30506
MD5sum: 57ce03b6d280cac26c384fdd9f568755
SHA1: e551a9165dfa678b6d55dfd86d23ef29b458c8cd
SHA256: e96b989efcb1025f4071621e429d1912157e0e3e0fbebb8a1f2032acb25d62cc
Package: live-config-systemd
Source: live-config
Version: 4.0.4-1
Installed-Size: 71
Maintainer: Live Systems Maintainers <debian-live@lists.debian.org>
Architecture: all
Replaces: live-config-backend
Provides: live-config-backend
Depends: systemd
Recommends: dbus
Conflicts: live-config-backend
Description: Live System Configuration Components (systemd backend)
Homepage: http://live-systems.org/devel/live-config/
Description-md5: f160e3c4d32d3e56a99bc0dd94d09533
Section: misc
Priority: optional
Filename: pool/DEBIAN/main/l/live-config/live-config-systemd_4.0.4-1_all.deb
Size: 18838
MD5sum: 8821f91b060b8eec1af0f67887b17049
SHA1: b3c52425704f2d72fa38e098d85a558795dd2076
SHA256: 2a29afc0dc8fbfdb4d3ce269021d282b338a28f0e69a3764619639c238352d97
Package: live-config-sysvinit
Source: live-config
Version: 4.0.4-1
Installed-Size: 65
Maintainer: Live Systems Maintainers <debian-live@lists.debian.org>
Architecture: all
Replaces: live-config-backend
Provides: live-config-backend
Depends: sysvinit-core | sysvinit (<< 2.88dsf-44)
Conflicts: live-config-backend
Description: Live System Configuration Components (sysvinit backend)
Homepage: http://live-systems.org/devel/live-config/
Description-md5: 8b1fc4f3c30261ea2767baf5c2a43765
Section: misc
Priority: optional
Filename: pool/DEBIAN/main/l/live-config/live-config-sysvinit_4.0.4-1_all.deb
Size: 19798
MD5sum: f1c3342f2e02c2fef4fc664bd4041757
SHA1: ce15a24b66d7cc6857397ab089afff21b630d4c6
SHA256: 1f78b49e367c0d025c5752ebc4ca16c2342b377640905900d85d8ec13319bb74

Offline

#23 2017-05-26 17:10:36

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,406  

Re: Make a live-CD with live-sdk

I didn't specify any packages when I tried live-build. The default setting tries to get live-config-systemd. Phil shows how to deal with that in this thread: https://dev1galaxy.org/viewtopic.php?id=612

I know at one point, I wrote a short script to go through and change the links from debian to devuan. I also tried open-infrastructure. I'll say something about those things in the live-build tips thread.

What do you mean about using the /etc/apt folder from the latest iso. You put that in the chroot includes dir so it gets copied into the iso? Or something else?

Offline

#24 2017-05-29 01:59:38

Ozi
Member
From: Melbourne, Australia
Registered: 2017-03-15
Posts: 105  
Website

Re: Make a live-CD with live-sdk

There is a lot of good config in /etc/apt, so I usually uncompress the iso and mount the filesystem.squashfs, if it exists, and pull out any useful bits I find.

Yes I put it in chroot.includes

Last edited by Ozi (2017-05-29 03:05:42)

Offline

#25 2017-06-28 14:48:08

Ged
Member
Registered: 2017-06-28
Posts: 11  

Re: Make a live-CD with live-sdk

Very many thanks for this excellent article.

Note on prerequisites:
In addition to those mentioned in the article I *think* I found that I had to install the 'isolinux' package to get the build to complete without complaining that isohdpfx.bin was missing from /usr/lib/ISOLINUX/ - although in fact it appeared to be there...

Would it be safe to use our on-site caching proxy server for the archive repository?  It would make building from scratch a great deal quicker and I seem to be doing that quite a lot at the moment.

Offline

Board footer