Customizing Ubuntu Desktop CD
This page describes how to customize the Ubuntu Dekstop CD. This is typically done to showcase certain packages that don't come with the default Ubuntu CD. This information is based on Ubuntu 8.04 and may or may not be applicable to future releases.
Brief overview of the process
An extremely general picture is: unpack stuff from CD, add our packages, pack it all back. Now a little more detail on each part.
- The whole filesystem of the Ubuntu that will run in the Live session is packed into a single file on the CD. This file is
/casper/filesystem.squashfsand one needs the
squashfskernel module to work with such filesystems.
- One needs to prepare packages (.deb files) that are to be added to the system. These packages may have dependencies that also need to be downloaded beforehand.
- The final CD image may turn up to be more than 700MB after we add our stuff. So some sacrificing of other useless contents might be needed after we add our packages.
- There are tricks to pack everything back. They all will be explained below in their respective order.
This part is by far the easiest. Once you have downloaded the original iso file with the Ubuntu desktop CD, mount it:
mount ubuntu-8.04-desktop-i386.iso mnt -o loop
assuming that you have an empty directory
mnt and the iso file in your working directory. Then copy everything into another directory using
rsync --exclude=/casper/filesystem.squashfs -a mnt/ iso
. This will create the directory called
iso with the contents of the CD, *except* for the largest file
/casper/filesystem.squashfs that holds the whole target filesystem.
Next we unpack the target filesystem from that huge file. First we will mount it using another empty directory
mount mnt/casper/filesystem.squashfs mnt_sq -o loop -t squashfs
. And then we
rsync from it to a new directory:
rsync -a mnt_sq/ squash
. This should create the directory
squash with the contents of the target filesystem. Now that we are done with the mounted images, we may unmount them:
umount mnt_sq umount mnt