Subscribe to News

How To Modify your Ubuntu Live CD

Author : Aperell

From TechnologicalWiki

Jump to: navigation, search

The process of modifying the live CD is very simple:

First, we mount ubuntu ISO on a directory, copy the file "filesystem.squashfs" located on /casper on another directory. Next, we mount filesystem.squashfs on a different directory and copy its content to another directory. After, execute chroot in this directory. Then, we will be able to get or remove the packages we (don't) need.

Contents

[edit] Necessary Packages

First, we need to install the next packages: mkisofs (actually, his name is genisoimage) and squashfs-tools.

 sudo apt-get install genisoimage squashfs-tools 


[edit] Mounting ISO

Now, we mount ubuntu iso on a directory.

 sudo mount ubuntu-desktop.iso ./image 

[edit] Extracting Filesystem.squashfs

Then, find and copy filesystem.suquashfs located on casper and copy it to another directory

 sudo cp ./image/casper/filesystem.squashfs . 

[edit] Mounting Virtual Filesystem

Mount filesystem.squashfs and copy the content into another directory.

sudo mount -t squashfs -o loop filesystem.suqashfs ./squashimage
sudo cp -vr ./squashimage/* ./mysquash

[edit] Changing The Squash

Now, we can run chroot on in the squash directory and install or remove packages with aptitude.

cd mysquash
sudo chroot .
aptitude install (...)
aptitude remove (...)

[edit] Re-Packaging Squashfs

After you have modified the squash, you have to exit the chroot environment to re-package squash.

exit
cd ..
mksquashfs ./mysquash myfilesystem.squashfs

This action may run slowly, be patient.

[edit] Re-Mounting ISO image

Now, we can generate a customized iso:

sudo cp -vr ./image ./myimage
sudo rm ./myimage/casper/filesystem.squashfs
sudo cp myfilesystem.squashfs ./image/casper/filesystem.squashfs
sudo mkisofs -J -R -o ubuntu-mylive.iso -no-emul-boot -boot-info-table -b isolinux/isolinux.bin ./myimage

And this is all. You can test your iso in qemu.

Main Collaborators