Home/ posts/ remastering kubuntu livecd

This week I remastered the kubuntu Live CD (Drapper Drake 6.06 LTS). Because of this I want to gave here a short howto remaster it(assumed that you use debian as your OS):

At first download the original cd from kubuntu.com. In order to modify it mount it to any directory and sync everything which is on the CD into another directory:

rsync -a /path/to/cd-mountpoint /path/to/new/dir

I assume for the rest of the howto:

$cd=/path/to/new/dir

After you synced it, you will recognise that you don’t find anywhere the fileystem on the disk… it is packaged as an squashfs and is located here $cd/caspar/filesystem.squashfs. In order to mount this the following tools and modules must be installed on your debian system:

sudo apt-get install squashfs-tools squashfs-source

The squashfs kernel module you have then to install with:

m-a prepare;
m-a build squashfs;
dpkg -i /usr/src/squashfs-modules_$some_numbers.deb

Now you are able to mount the squashfs that is included in the livecd and work on the livecd:

mount -t squashfs -o loop $cd/caspar/filesystem.squashfs /path/to/squashfs-mountpoint

Now you have to sync the content of this dir into another:

rsync -a /path/to/squashfs-mountpoint /path/to/squashfs-dir

I assume $squash=/path/to/squashfs-dir after you sinced it feel free to modify anything in the squashfs :) If you want to build up the squashfs again, simply do:

rm $cd/casper/filesystem.squashfs
mksquashfs $squash $cd/casper/filesystem.squashfs

You should also consider an update of the filesystem.manifest:

chmod +w $cd/casper/filesystem.manifest;
chroot $squash dpkg-query -W –showformat=‘${Package} ${Version}n’ > $cd/casper/filesystem.manifest
cp $cd/casper/filesystem.manifest $cd/casper/filesystem.manifest-desktop
sed -ie ‘/ubiquity/d’ $cd/casper/filesystem.manifest-desktop

Okay, now you are almost finished. The last two points are: rebuilding the squashfs and rebuilding the iso: Since you need the squashfs to generate the new iso, first how to generate the squashfs:(Don’t wonder… squashfs has a very good compression rate :) )

rm $cd/casper/filesystem.squashfs
mksquashfs $squash $cd/casper/filesystem.squashfs

Okay, finally…. the generation of the CD:

cd $cd;
mkisofs -r -V “$IMAGE_NAME” -cache-inodes -J -l -b isolinux/isolinux.bin -c
isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ../ubuntu-6.06.1-desktop-i386-custom.iso .;

Enjoy your self remastered livecd!

Tags:
Last edited Mi 05 Mär 2008 13:20:37 CET