Using SalixLive build scripts
In this how-to we will use the latest trunk from SVN and simply modify SalixLive Xfce 13.1.2 (at the time of this writing) rather than starting from scratch. You could as well choose another branch (KDE or Lxde) if you prefer and adapt the following instructions accordingly.
Install linux-live, squashfs-tools packages and grub2
$ wget http://enialis.net/~jrd/salix/squashfs-tools/2010.07.22-i486-1cp/squashfs-tools-2010.07.22-i486-1cp.txz
# installpkg linux-live-6.3.0-noarch-4cp.txz
# installpkg squashfs-tools-2010.07.22-i486-1cp.txz
# slapt-get -i grub2
Get SalixLive Build scripts from SVN
$ svn co https://salix.svn.sourceforge.net/svnroot/salix/salix-live/trunk myownsalixlive
$ cd myownsalixlive
At this point you should read the INSTALL file, except that all will not apply to us since at this moment we are not planning to redo the live kernel but only modify some of the Live Modules package composition. Still the information this file contains is important & should be read even if we will adapt it somewhat.
$ less INSTALL
Modify the contents of the files packages-*
The file MODULES-INFOS shows which Live Modules will be included in your LiveCD and matches each future Live Module with the file that lists the exploded packages it will contain. It is self-explanatory. Unless you know what you are doing, do not modify MODULES-INFOS. The architecture of the Live Modules as laid out in this file is designed in a way that Salix Live Installer can understand in order to offer a core, basic of full install.
What you do want to modify however is the list of the packages in some of the modules. The easiest is to use any file editor of your choice. For example, I choose to leave packages-core untouched but I'll add p7zip to packages-basic. In packages-full, I'll remove Claws-mail and Parole but I'll add Thunderbird and Vlc (and its dependencies) while in packages-live I'll remove salix-startup-guide. Adapt to suit your needs.
$ nano packages-basic
$ nano packages-full
$ nano packages-live
Create the PKGS directory and download all the needed packages
$ mkdir PKGS
This process can take some time depending on your connection speed.
Verify missing packages
$ less pkgs_in_errors
This lists all the packages that were not in Salix repository and which you should either remove from the original packages-* lists or manually download and place in the PKGS directory (except for liveenv package which we will handle differently). As an example, I will copy/download the following needed packages to the PKGS directory.
$ mv ../linux-live-6.3.0-noarch-4cp.txz PKGS
$ mv ../squashfs-tools-2010.07.22-i486-1cp.txz PKGS
$ cd PKGS
$ wget http://enialis.net/~jrd/salix/kernelive/188.8.131.52.smp-i486-1cp/kernelive-184.108.40.206.smp-i486-1cp.txz
$ wget http://people.salixos.org/akuna/livetools/liveclone/0.10.13.1.1/liveclone-0.10.13.1.1-noarch-1plb.txz
$ wget http://people.salixos.org/akuna/livetools/liveinstaller/0.2.7/salix-live-installer-0.2.7-noarch-1plb.txz
First try at liveenv package
As mentioned above, one of the previous missing package was liveenv. This is a special package that contains all the customization that differs from Salix standard system.
So far, all the packages we included in the Modules were vanilla packages mostly from Salix repository. This ensures that the Live installer will install a vanilla Salix system from the LiveCD. Therefore all the customization you wish to bring to your LiveCD apart from its packages selection will be done with the help of this special package which will be placed in the last Live Module.
It can be necessary to build it a few times successively until it holds all the necessary customization. The last part of this tutorial will deal more deeply with this process. For this first step we will not modify anything just yet, to ensure that we do have a functional LiveCD. Once we are sure everything works perfectly then we can add further customizations.
$ cd ../liveenv
Copy standard kernel packages in std-kernel directory
This is so that the Live Installer can use Salix regular non-patched kernel rather than the patched kernelive.
$ cd ../std-kernel
$ wget ftp://ftp.slackware.com/pub/slackware/slackware-13.1/slackware/a/kernel-firmware-220.127.116.11-noarch-1.txz
$ wget ftp://ftp.slackware.com/pub/slackware/slackware-13.1/slackware/a/kernel-huge-smp-18.104.22.168_smp-i686-1.txz
$ wget ftp://ftp.slackware.com/pub/slackware/slackware-13.1/slackware/a/kernel-modules-smp-22.214.171.124_smp-i686-1.txz
Launch SalixLive build script
Before executing the script, you may want to open it first to personalize the name of the LiveCD by changing the following variable values:
$ cd ..
$ nano build-salixlive.sh
Test the iso file produced by the script in the working directory
Load the iso file in Vbox or equivalent or else burn it on a CD-ROM and reboot on it.
If all is well you should now have a functional variant of SalixLive with your very own selection of applications.
If it works well, we can now customize it further to the smallest detail.
Modifying the liveenv package
If you look inside the liveenv directory (located in your working directory) , you will find a subdirectory called root. This subdirectory is used to create an overlay that will be placed over Salix Live root filesystem when it boots. The principle is simple, whatever file you put in liveenv/root/ directory will be included in the mysterious liveenv package we saw earlier and will be included in SalixLive, overwriting any previous file with the same name if any. That's all there is to it. Now we just need to find out what file to put there.
Customize a Live CD session and catch modified files
In order to do that, launch a brand new Live CD session (the test iso you just produced) and once you are logged in, open up Thunar, and activate the viewing of hidden files. Then go to /mnt/live/memory/changes/home/one/.config/xfce4 and mentally take a note of the subdirectories it contains. Keep Thunar open but shrink its window while you start customizing Xfce panel to your liking. Once the panel is exactly the way you want, restore Thunar's window and --surprise-- you will notice that a new subdirectory named 'panel' showed up!
Copy the modified files from the Live CD session to your working directory
You must have guessed it by now, all changes you perform in a Live session is recorded in /mnt/live/memory/changes, so all you have to do is copy this new 'panel' subdirectory with its matching parent tree structure from your Live CD session on to your working directory into liveenv/root.
If you launched the Live CD session from a physical CD-ROM, you could use the help of a USB key. But the ideal is to run the test Live CD in a Virtual Manager and setup an exchange directory between the guest Live CD session and the host where the work directory is also located. It is much quicker and more economical that way. Catching the relevant modified files from /mnt/memory/changes takes a bit of detective work at first but with a bit of practice, it does becomes easier.
'Manually' modify or add some more files to liveenv/root
Of course, you don't have to solely rely on the above method if you already know what to do. Feel free to 'manually' add, remove or modify any files from liveenv/root in your work directory as well.
Rebuild the 'liveenv' package
When you are finished with your changes, you can rebuild the liveenv package by following the same procedure we followed previously.
$ cd /path/to/liveenv
Rebuild your customized Live CD iso
Still following the same procedure...
# cd ..
Thankfully, SalixLive build script will check all the steps that have already been done previously and will ask for confirmation whether you want to keep or clean any of the Live CD component already existing. In our case, we will press on 'K' (for keep) each time we are asked to keep or clean anything that is not related to 07-live which mean we will choose 'C' (for clean) only two times, first when we are asked about 07-live packages & then about 07-live lzm module.
Rebuilding the new iso with only the 07-live module changed will be done very rapidly that way. Once it is done, boot on the iso and verify if the result is as you expected.
Don't hesitate to repeat the whole procedure of modifying liveenv/root files and rebuilding the iso a few times in a row until you are perfectly satisfied and the produced Live CD is exactly as you want it to be.
There's nothing more to it, just a bit of patience and a bit of try and fail experiences.
ATM SalixLive build scripts are partly based on 'Linux Live Scripts' whose development sadly came to a halt a while back. This is why a new generation of homegrown SalixLive build scripts called SaLT is being prepared as we speak. These will not suffer from the present limitations of Linux Live Scripts. They will, for instance, enable the generation of 64 bit Live CD versions or enable LiveClone to easily produce a LiveCD directly from a standard installed system.
When SaLT scripts are ready and fully stable, this tutorial will be re-visited and adapted accordingly.