Skip to the content of the web site.

Linux | RemasteringGuide

Damn Small Linux / Booth Remastering Guide

This guide should give you a good idea on how to go about customizing Damn Small Linux to meet your needs. The guide will, of course, focus on how Damn Small Linux was customized to work with the booth scripts. The Knoppix remastering guide is available from http://www.knoppix.net/wiki/Knoppix_Remastering_Howto was used extensively as a reference.

Cloop

In order to complete the remastering you will need to have the cloop-src and cloop-utils installed. If you are using Debian these packages are available in the stable, testing, and unstable repositories. On Debian systems, you'll also need to install the kernel-package, and debhelper packages. You will have to compile the cloop kernel module using the cloop-src package. Make sure you have the kernel-source installed that corresponds with the kernel version you are running. Here is an example of what I commonly need to do.

apt-get install cloop-src cloop-utils kernel-source-2.6.8
cd /usr/src
tar -xjf kernel-source-2.6.8-tar-bz2
tar -xzf cloop-src.tar.gz
cd kernel-source-2.6.8
cp /boot/config-2.6.8-1 .config
make oldconfig
make-kpkg --append-to-version -2-686-smp modules_image

This will create a cloop-module package in the /usr/src directory that can be installed using dpkg -i.

Remastering

To begin with you'll need the current boothcd .iso image available from sourceforge.net (or you can get the latest DSL iso from damnsmalllinux.org and remaster that). After you've downloaded the image create a directory that you can perform all your work in.

mkdir remaster
cd remaster
mkdir image
mkdir -p source/KNOPPIX
mkdir -p master/KNOPPIX

Now you'll need to mount the .iso image on the loopback device and copy the files over.

mount -o loop dsl.iso image
(cd image; find . -size -10000k -type f -exec cp -p --parents '{}' ../master/ \;)
extract_compressed_fs image/KNOPPIX/KNOPPIX > tmp.iso
umount image
mount -o loop tmp.iso image
cp -Rp image/* source/KNOPPIX
umount image

You should now have all of the necessary files copied over and be able to chroot into the filesystem with the command:

chroot source/KNOPPIX
mount -t proc /proc proc

Now you should be able to make any changes you need while chrooted into the extracted filesystem. In order to install packages using dpkg and apt you'll need to run dpkg-restore which will restore apt and dpkg to working order.

Note that the bootcd.iso only has minor customizations to the main filesystem, e.g. the password file is modified to add the guest user and the inittab file is modified to control the boot process. Other scripts and the guest home directory are loaded on bootup from the booth-x.x.x.dsl archive. See DSL Extensions below. If you want to customize the DSL or Knoppix CDs instead, then you can use apt-get and dpkg to do that (for some installed apps -- others are installed manually). The dpkg -l command lists the Debian packages installed). Do an apt-get update, but not an apt-get upgrade. Rather, install and remove packages individually. See the Knoppix remastering guide for more tips.

Once you've made all the changes you want made (e.g. changing the root password), unmount proc and exit out of the chrooted filesystem. It's really important to unmount proc (check it with the "mount" command), or things really get confusing.

umount /proc
exit

We're now ready to create a new .iso image.

rm -rf source/KNOPPIX/.rr_moved
mkisofs -R -U -V "KNOPPIX.net filesystem" -publisher "KNOPPIX www.knoppix.net" -hide-rr-moved -cache-inodes -no-bak -pad source/KNOPPIX | nice -5 create_compressed_fs - 65536 > master/KNOPPIX/KNOPPIX
cd master
rm -f KNOPPIX/md5sums; find -type f -not -name md5sums -not -name boot.cat -not -name isolinux.bin -exec md5sum '{}' \; >> KNOPPIX/md5sums
mkisofs -pad -l -r -J -v -V "KNOPPIX" -no-emul-boot -boot-load-size 4 -boot-info-table -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -hide-rr-moved -o dsl.iso .

You should now have a working .iso image with all the changes you've made. A good way to test the image is by using qemu (a virtual PC emulator) to boot the image without having to physically reboot.

qemu -net user -cdrom dsl.iso

This will run much slower but will allow you to ensure all your customizations are present before buring the image.

DSL Extensions

Damn Small Linux has an excellent method of customizing the default image called "DSL extensions". These files usually end in .tar.gz or .dsl, in both cases they are tarballs that have been compressed that contain usefuly programs or files. They can be installed at boot-up by placing them in the master directory before remastering. When the image is booted these files will be unpacked into the filesystem. They are quite easy to create as they are simply root relative archives. Almost all of the modifications and scripts that create the boothcd from DSL are implimented from the booth-x.x.x.dsl extension (with the exception of mods to /etc/passwd and /etc/inittab to create the guest account and control the boot, respectively.

If you wish to make customizations to the default booth configuration you should edit the booth.dsl extensions. Simply create a temporary directory and unpack the extension into the directory:

mkdir working
mv booth.dsl working
cd working
tar -xzf booth.dsl
cd usr/share/booth
tar -xzf guest.tar.gz

You may now make any changes you wish to the guest user's configuration files. After you're done repack the archives:

tar -cf guest.tar guest
gzip guest.tar
cd ../../..
rm booth.dsl
tar -cf booth.dsl *
gzip booth.dsl
mv booth.dsl.gz booth.dsl

Simply place the new extension into the master directory where the remastering was done.

There are many other DSL extension on the DSL site. These could be used if the DSL CD is being remastered.

Follow the previously mentioned steps to create a new image and when you boot the new image it will tell you it's loading booth.dsl.

-- DavidCollie - 07 July 2005

-- SteveCarr - 14 Oct 2005