I think you can do it with these steps (these are the first and second part of the step-by-step guide) ....
Preparing the host
sudo apt-get install squashfs-tools
sudo apt-get install chroot
setting up our working environment. First, we are going to mount the iso under /tmp/livecd:
mkdir /tmp/livecd
sudo mount -o loop ~/Desktop/ubuntu-7.10-desktop-i386.iso /tmp/livecd
Then create a directory containing our future CD image (cd) in our working directory and copy all the CD content but casper/filesystem.squashfs in our ~/livecd/cd directory
mkdir ~/livecd
mkdir ~/livecd/cd
rsync --exclude=/casper/filesystem.squashfs -a /tmp/livecd/ ~/livecd/cd
Now we need to mount casper/filesystem.squashfs onto a directory called ~/livecd/squashfs in order to copy its content in a directory where we are going to edit our live CD filesystem: ~/livecd/custom
mkdir ~/livecd/squashfs
mkdir ~/livecd/custom
sudo modprobe squashfs
sudo mount -t squashfs -o loop /tmp/livecd/casper/filesystem.squashfs ~/livecd/squashfs/
sudo cp -a ~/livecd/squashfs/* ~/livecd/custom
And finally, let copy /etc/resolv.conf and /etc/hosts to our ~/livecd/custom/etc so we will be able to access network from within the image we are going to customize (through chroot)
sudo cp /etc/resolv.conf /etc/hosts ~/livecd/custom/etc/
Getting into our future image
In order to customize the image, we will chroot into ~/livecd/custom directory, mount some necessary pseudo-filesystem (/proc and /sys). From there, we will be able to customize our Live CD.
sudo chroot ~/livecd/custom
mount -t proc none /proc/
mount -t sysfs none /sys/
export HOME=/root
Customizing our future live CD
Remove some packages or something ...
Updating the existing image
Now that we have remove softwares we do not need, we can update our /etc/apt/sources.list in order to enable universe and multiverse repository along with gutsy-updates, gutsy-security and the partner repository so we can install vmware-server
vim /etc/apt/sources.list
(You can view the final file in the second link, at the top of that post)
Now we can update the image by running:
apt-get update
apt-get dist-upgrade
Installing new packages
Install some packages you want...
Well, that's about it, we now have whatever software that you will need when using your live CD.
It is now about time to do some clean up
Cleaning up the chroot
When we install packages, apt caches the packages, we will need to remove them in order to save some space:
apt-get clean
Also, there is some files in /tmp that need to be removed:
rm -rf /tmp/*
Before chrooting, we have added 2 files: /etc/hosts and /etc/resolv.conf, let remove them:
rm -f /etc/hosts /etc/resolv.conf
Finally, we are ready to exit the chroot and repack the CD. We need first to umount /proc and /sys:
umount /proc/
umount /sys/
exit
Finally, we are back to our host, as we have modified some packages, we need to rebuild some manifest files, recreate the squashfs and recreate the ISO
Recreating the ISO
Fisrt, lets recreate the manifest files:
chmod +w ~/livecd/cd/casper/filesystem.manifest
sudo chroot ~/livecd/custom dpkg-query -W --showformat='${Package} ${Version}\n' > ~/livecd/cd/casper/filesystem.manifest
sudo cp ~/livecd/cd/casper/filesystem.manifest ~/livecd/cd/casper/filesystem.manifest-desktop
And regenerate the squashfs file:
sudo mksquashfs ~/livecd/custom ~/livecd/cd/casper/filesystem.squashfs
Parallel mksquashfs: Using 2 processors
Creating little endian 3.0 filesystem on ~/livecd/cd/casper/filesystem.squashfs, block size 65536.
....
....
Now, alternatively, you might want to customize the file: ~/livecd/cd/README.diskdefines
and finally, update ~/livecd/cd/md5sum.txt which contains the files in ~/livecd/cd md5 sums:
sudo rm ~/livecd/cd/md5sum.txt
sudo -s
(cd ~/livecd/cd && find . -type f -print0 | xargs -0 md5sum > md5sum.txt)
We are now almost done, the last thing left is too create the ISO with the following command:
cd ~/livecd/cd
sudo mkisofs -r -V "Ubuntu-Live-Custom" -b isolinux/isolinux.bin -c isolinux/boot.cat -cache-inodes -J -l -no-emul-boot -boot-load-size 4 -boot-info-table -o ~/Desktop/Ubuntu-Live-7.10-custom.iso .
Here you go, you can now test your image by either booting your computer with or by using a virtualization/emulation software such as qemu, kvm, vmware.....