I have seen the question raised quite a lot on this forum, so I have decided to do a comprehensive tutorial on how to customize the LiveCD.
This will work for Feisty, and for Gutsy too.
This tutorial is actually based on a bash script. I figured typing commands line by line is far to slow, and mistakes can be made. A script simplifies the operation, and can be modified to taste.
I will first provide a basic script that everyone should find useful. The script can be further modified by simply adding lines of code where necessary.
Here's how you do it:
1 - What you need:
Create a new folder called: live
Download the 7.04 (Feisty) desktop iso and place in the live folder.
Download the Flash browser plugin from Adobe: http://fpdownload.macromedia.com/get...9_linux.tar.gz
Extract the flashplayer.xpt and the libflashplayer.so files and place in the live folder.
You will also need to install a couple of tools onto your computer to make this whole thing possible:
These only need to be installed the once, and so don't need to be part of the script.
sudo apt-get install squashfs-tools mkisofs
2 - The basic script:
Open Gedit and paste this code in. Save file as: customize-livecd.sh and place in your live folder.
echo Customize Ubuntu LiveCD
echo Script by: Stephen Clark
echo Based on documentation found at:
echo "For customizing Ubuntu 7.04 (Feisty Fawn)"
echo Press Ctrl C at any time to quit
echo -n "Loading squashfs module... "
echo -n "Extract iso contents? y/[n] "
if [ "$ua" = "y" ]; then
if [ -e "edit" ]; then
echo -n "Removing existing Desktop System... "
rm -r edit
if [ -e "extract-cd" ]; then
echo -n "Removing existing CD contents... "
rm -r extract-cd
if ! [ -e "mnt" ]; then
if ! [ -e "squashfs" ]; then
echo -n "Extracting CD contents... "
mount -o loop $ubuntuiso mnt
rsync --exclude=/casper/filesystem.squashfs -a mnt/ extract-cd
echo -n "Extracting Desktop System... "
mount -t squashfs -o loop mnt/casper/filesystem.squashfs squashfs
cp -a squashfs/* edit/
# Place custom scripting here
# Initialize networking and sources
cp /etc/resolv.conf edit/etc
cp /etc/hosts edit/etc
cp /etc/apt/sources.list edit/etc/apt
echo -n "Start package removal? y/[n] "
if [ "$ua" = "y" ]; then
# Not all apps can be purged without dependency problems
# Accept whatever solution aptitude offers
chroot edit apt-get remove --purge ekiga evolution tomboy serpentine f-spot gnome-games bittorrent onboard gnome-pilot gnome-pilot-conduits libpisock9 libpisync0
echo -n "Start package installation? y/[n] "
if [ "$ua" = "y" ]; then
# -q supresses the output to a minimum
chroot edit apt-get update -qq
# sox, vorbis-tools, & mpg123-alsa are for previewing sound files in nautilus
# The gstreamer packages are for codec support
chroot edit apt-get install mozilla-thunderbird sox vorbis-tools mpg123-alsa vlc comixcursors gnome-themes-extras gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly gstreamer0.10-ffmpeg gstreamer0.10-plugins-bad
chroot edit apt-get clean
echo -n "Installing Flash plugin for Firefox... "
# Install flash plugins
cp flashplayer.xpt edit/usr/lib/firefox/plugins
cp libflashplayer.so edit/usr/lib/firefox/plugins
# Clean up
if [ -e "extract-cd/programs" ]; then
echo -n "Remove unwanted Windows applications from LiveCD? [y]/n "
if ! [ "$ua" = "n" ]; then
echo -n "Removing Windows applications... "
rm -r extract-cd/programs
echo -n "Copying wallpaper... "
if [ -f "edit/usr/share/backgrounds/*.*" ]; then
cp wallpaper/* edit/usr/share/backgrounds/
cp ubuntu-wallpapers.xml edit/usr/share/gnome-background-properties/
echo Setting gconf defaults for wallpaper, mouse, theme, nautilus and panel
chroot edit gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set /desktop/gnome/background/picture_filename "/usr/share/backgrounds/01.jpg"
chroot edit gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set /desktop/gnome/peripherals/mouse/cursor_theme "ComixCursors-Orange-Large-Slim"
chroot edit gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set /desktop/gnome/interface/gtk_theme "Nuvola"
chroot edit gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set /desktop/gnome/interface/icon_theme "Nuvola"
chroot edit gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set /apps/metacity/general/theme "Nuvola"
chroot edit gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set /apps/nautilus/preferences/click_policy "single"
chroot edit gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set /apps/nautilus/preferences/desktop_font "Sans Bold 10"
chroot edit gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type bool --set /apps/nautilus/preferences/start_with_sidebar "false"
chroot edit gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type bool --set /apps/nautilus/icon_view/default_use_tighter_layout "true"
# End of custom scripting
# Putting the CD together
echo -n "Recompile iso? [y]/n "
if [ "$ua" = "n" ]; then
echo The End
echo Compressing filesystem
if [ -e "extract-cd/casper/filesystem.squashfs" ]; then
mksquashfs edit extract-cd/casper/filesystem.squashfs
echo -n "Removing old md5sum.txt and calculating new md5 sums... "
(cd extract-cd && find . -type f -print0 | xargs -0 md5sum > md5sum.txt)
echo Creating iso
if [ -f "$customiso" ]; then
echo -n "Removing old custom iso... "
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 ../$customiso .
echo The End
To run the script, open a terminal and type:
The first time round, you will answer yes to all questions. After that, you can respond with no to save time extracting the iso again (unless you want to clean things up).
sudo sh ./customize-livecd.sh
3 - A brief explanation:
The first thing the script does is to load the squashfs module. This is necessary for the extraction/compression process to work.
Then it asks whether to extract the iso contents. If you want to start a fresh customization, answer yes. Answering no will save time having to extract everything from the iso again.
There are 3 lines that copy your network settings and the sources.list to enable downloading of packages to the extracted iso.
Then follows package removal and installation. Again, you can answer no to save time if you have already done it. Adjust the packages to be removed or installed to taste.
Then your Flash plugin for Firefox will be copied over.
There are some Windows application on the LiveCD which don't serve much purpose, so they can be removed too making a bit of room.
The next section is for copying any wallpaper over. If you don't want this, delete these 7 lines. If you do, create a folder in the live folder called wallpaper. Copy any wallpaper you want into this folder. If you wish to have these show up in the Desktop Background applet, you can customize the ubuntu-wallpapers.xml and add them. You can find this file in /usr/share/gnome-background-properties/. Make a copy of the ubuntu-wallpapers.xml file into the live folder and alter this copy instead. This will have to be modified by hand using Gedit before running the script. It's quite obvious how to alter the xml file once you've opened it.
The next few lines are for modifying some settings that you can find using the Configuration Editor. It gives you an idea of how to create your own default settings. This can be extended to just about everything you find in the Configuration Editor including setting up a complete customized desktop and panel(s).
Now we come to the part where the whole thing will be put back together and create a new iso.
At the very beginning of the script, you will notice 3 variables. ubuntuiso is the name of the Ubuntu iso you downloaded. customiso is the name of the new iso you will create from this script. kernel is the kernel used in the iso you downloaded. If you're customizing Gutsy, it will be 2.6.22-7-generic.
4 - There are some laptop owners having problems booting the LiveCD due to driver problems. I personally own a Philips X56 which has this exact problem. So, for anyone with a Philips freevents X56, Twinhead H12Y, Avaretec 2460, or Everex Stepnote SA2050, this is the fix:
EDIT: Ubuntu 7.04 ships with the 2.6.20-15-generic kernel. Arne.F informs me you need the correct module version available here:
Copy this to the live folder. Add these few lines to the script:
... just before the line that reads: # End of custom scripting. Bear in mind that any updates to the kernel will also have to be patched. After installation, any new kernels can be patched using the patch you just download and extracted. Follow the instructions within.
# Patch for Twinhead H12Y notebooks
echo -n "Install patch for $kernel kernel? y/[n] "
if [ "$ua" = "y" ]; then
echo 8139too PIO from: http://www.fitzenreiter.de/averatec/index-e.htm
echo -n "Removing SDHCI and replacing 8139too MIMO to PIO... "
if [ -f "$sdhci" ]; then
if [ -f "$too" ]; then
cp 8139too.ko $too
echo -n "Rebuilding initrd... "
chroot edit mkinitramfs -o /initrd.gz $kernel
mv edit/initrd.gz extract-cd/casper/
That's about it.
Please post any comments/question here for all to read, and I will keep this updated as questions arise.