Remastering Knoppix

From CUC3
Jump to navigation Jump to search

Quick notes on how I made a remastered Knoppix for David Wales. Closely based on an article by Robert Bernier at linuxdevcenter.com but updated for a newer Knoppix.

This assumes you're using one of the Theory sector standard workstations.

Get a Linux workstation, the most powerful you can get your hands on as this is CPU and memory intensive. 1Gb of RAM is good.

Install KNOPPIX on the hard drive (you'll need this for testing later). I did this in the root partition of my workstation which was /dev/hda6 . The method is to boot the original OS and mount the KNOPPIX CD. Copy the /KNOPPIX directory from the KNOPPIX CD into / . Copy the CD's autorun.*, cdrom.ico, and index.html files into / . From the CD's /boot/isolinux directory copy linux and minirt.gz into somewhere handy; I used /harddrive_boot . Then make lilo.conf boot the 'linux' kernel with minirt.gz as initrd, /dev/hda6 as root filesystem.

Reboot the workstation and select knoppix. Once it's booted up you need a disk on which to work as /dev/hda6 is mounted read-only. I made a directory /working and mounted /dev/hda7 on it (this is /home on the standard image). On /working I made three directories: KNOPPIX_original, KNOPPIX_remastered, and masterISO.

Copy the contents of /KNOPPIX into both KNOPPIX_ directories, preserving permissions and ownerships. Copy the following into masterISO from /cdrom:

  • autorun.{bat,inf}
  • cdrom.ico
  • index.html
  • boot/ (and contents)
  • KNOPPIX/ (and contents except for the KNOPPIX file)

Copy /usr/bin/create_compressed_fs to /working. This probably isn't compulsory, but I found it useful to have it available when I was running the workstation's original SuSE as well as the Knoppix on the hard drive.

Chroot into KNOPPIX_remastered; this is the system you'll see when you boot off the CD. Make your changes. You will have to delete a lot of packages in order to be able to compress the system onto a CD. I added fvwm and edited /etc/X11/Xsession.d/45xsession to create a fvwm session. I then edited /etc/init.d/autoconfig-knoppix to make fvwm the default, and put David's custom config into /etc/X11/fvwm . I added a few other packages to the distro too but they didn't need configuration.

Don't forget to clean up any temporary files before you exit.

Then exit the chroot, change to /working, and build the compressed KNOPPIX file in the masterISO directory from the KNOPPIX_remastered directory. If you are short of RAM you may need to make a swap file before doing this, but I had 1Gb and 1Gb of swap already.

mkisofs -R -U -V "Custom Knoppix" -publisher "your name here" -hide-rr-moved \
-cache-inodes -pad ./KNOPPIX_remastered | nice -5 ./create_compressed_fs - \
65536 > masterISO/KNOPPIX/KNOPPIX

Then boot up SuSE and copy the new compressed file over your old /KNOPPIX/KNOPPIX . I couldn't figure out how to do without this step (please feel free to mail me if you know!). Boot the knoppix system to test the new KNOPPIX file.

Keep going round and round like this until you're happy with the new Knoppix. Then build the actual CD image from /working with

cd masterISO
rm KNOPPIX/md5sums
find -type f -not -name md5sums -not -name boot.cat -exec md5sum {} \; >> KNOPPIX/md5sums
cd /working
mkisofs -pad -f -l -r -J -v -V "Custom Knoppix" -b boot/isolinux/isolinux.bin -c  \
boot/isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -hide-rr-moved \ 
-o ./knoppix.iso masterISO

Then burn it to a CD, assuming it's come out small enough to fit. I had to remove a large number of packages to get it to fit, and even using the extremely slow -b option to create_compressed_fs didn't help (in fact it took ten times as long, as promised, and didn't compress any better on my system than without the option).