Remastering Damn Small Linux - sunday 2006-10-01 0715 last modified 2006-10-03 1644
Categories: Linux
TrackBacks Sent:

The Damn Small Linux remastering guidelines from some folks at U. of Waterloo was invaluable and is essentially the framework I'll end up repeating, with some riffs, in particular, for remastering DSL while using DSL as the host OS.

There is an unfortunate lack of links from the DSL site to what precisely remastering entails; while the OS allows you to burn itself to a CD after futzing around, this option requires using cdrecord, which I wasn't going to do through a virtual machine, very likely a recipe for coasters.

There is a component of DSL called myDSL that is supposedly an easy way to extend the operating system, by dropping a myDSL package into the correct folder, etc. This is vaguely billed as the way to adapt DSL, but it has little to do with and no explanation for the process. I didn't try it. It appears to be a package manager. My personal preference is for apt for package management. Systems like rpm or myDSL that require me to hunt down a package online and explicitly download and install it myself are not worth my time. I'm not clear on why they didn't just make use of apt here.

I gave general details on setting up a remastering environment through Virtual PC in a previous post. After setting up a host operating system, create a directory structure like:

  • /remaster
    • /master
      • /boot
      • /KNOPPIX
    • /source
      • /KNOPPIX
    • /original

I didn't keep an original directory around, but it would contain the untouched source operating system files, in case you wanted to start over again from scratch, which I have had to do.

As I explained earlier, I was unable to use the cloop utilities (included in DSL) to extract the compressed portion of the CD, so I resorted to straight copying from a boot from CD. Those files go in source/KNOPPIX. The master diretory will be the one you eventually turn into a disk image for burning. Unless you need to modify the boot files, there's no manual work to be done there.

Part of the attraction of Live CD's is the ability to modify some of the OS's behavior from the boot prompt; with the environment I'm targetting, the keyboard won't be accessible. I modified some of the master/boot files to eliminate unnecessary device detection and reduce the timeout setting for faster boot times. I also changed the boot graphic.

Other modifications will have to take place in the actual CD source. Once your environment is prepared, use the chroot and mount procedure descrbed in the Waterloo guide, and proceed to act like you're using the operating system that will eventually be burned. Activate apt, turn on sshd, make sure sshd is linked in the appropriate init level scripts, change /etc/inittab, etc. cron is one package worth its while not included in DSL.

Make absolutely sure that temporary files you plan to replace or modify are not packaged into your disk image. Things like /var/log and the pidfiles in /var/run must not exist, or they'll turn into read-only files and end up disabling the services they belong to.

Also note that many utilities in DSL are extremely dumbed down. Instead of using individual utilities, DSL includes BusyBox, which provides lots of normally popular but OS-external applications such as wget and find, in crippled form. I needed both in their full-fledged glory and had to figure out ways to adjust when I found they were too weak for the scripts I wrote.

This renders some of the instructions on the Waterloo guide incorrect if you use DSL as a host OS. I turned these lines into scripts and changed them accordingly:

#!/bin/sh 
# gen-KNOPPIX
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
#!/bin/sh
# gen-iso
cd master
rm -f KNOPPIX/md5sums; find -type f -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 \
  -o dsl.iso .

Make sure you remove any old compressed KNOPPIX files between runs of gen-KNOPPIX. Somehow the script failed to write out a new KNOPPIX file if the old one existed. That's not how shell redirection is supposed to work, but there you go.

Pay close attention to partition space. I overran it copying a large KNOPPIX into place into the /KNOPPIX directory, and the operating system failed to boot afterwards, even after removing it. I'm not sure why there weren't any warnings about filling up a partition.

At this point, having run through several cycles of remastering, I don't think removing files actually reclaims any space. I don't mind much since I only need it all to fit on one CD, and I'm presently in no danger of hitting that limit; but it would be nice to be efficient. There's an explanation in the Ubuntu wiki about it, though I don't really believe it applies. All I see is that I remove things and the KNOPPIX file doesn't really shrink.

I tested the KNOPPIX file by booting into it as described in my earlier post, before generating the final ISO image and doing an actual burn.

You must login to leave a comment

TrackBacks

Ryan's Journal: Graveyard: Sony VAIO

Excerpt: ... Ryan's Journal RaynDrop : Ryan's Journal [ RSS Feed | All Entries | Previous Entry | Current Entries ] Graveyard: Sony VAIO - saturday 2008-05-17 1514 last modifie...

Ryan's Journal: Graveyard: Sony VAIO on May 17, 2008 03:14 PM [pingback]

Ryan's Journal: Towards a Digital Photo Frame

Excerpt: ... Ryan's Journal RaynDrop : Ryan's Journal [ RSS Feed | All Entries | Previous Entry | Current Entries ] Towards a Digital Photo Frame - monday 2006-10-02 1719 las...

Ryan's Journal: Towards a Digital Photo Frame on October 03, 2006 12:14 AM [pingback]