Linux CD Mastering - Customizing Linux
Customizing Linux

Okay, now we're ready to "customize" our CD. There are lots of things that we could do. We could change the background graphics, we could have our CD automatically launch some program, or we could install some new software. The sky's the limit, you can pretty much do whatever you like. If you're thinking about venturing out on your own here, we recommend reading ahead to the section titled "Environment shutdown" and backing up your VmWare files before getting carried away. That way, you'll always be able to recover back to this point, even if you totally corrupt your mastering environment. For our example, we will do the following:
  • Change the background image for X-Windows
  • Disable the startup and shutdown sounds permanently
  • Prevent Konqueror from loading at startup
Yeah, I know what you're thinking....what kind of simple, wimpy stuff is this...? Well, ya' gotta' start somewhere. How's that for a simple answer. Anyhow, onward.

First we'll replace the background image with one that we've doctored up. The background image that is presented by default is located at /mnt/work/master/cdrom/KNOPPIX/background.jpg (note: It is possible that the default image may be in another location if you downloaded a different version than we used or something else has been changed). In order to override it, we'll simply create a new background and save it with the same name in the same location. Now that you've been through the hard stuff, we'll stop holding your hand for each and every command. If you'd like to download a pre-made version of this image, you can find it here.

Now, to disable the startup and shutdown sounds, we just need to move or rename the sound files located in /mnt/work/master/KNOPPIX/usr/share/sounds/. The files we're interested in are startup.ogg and shutdown.ogg. We'll move these into a subdirectory so that they can't be played during startup and shutdown.
root@tty1[root]# cd /mnt/work/master/KNOPPIX/usr/share/sounds/
root@tty1[sounds]# ls
KDE_Beep_Ahem.wav         KDE_Desktop1.wav          KDE_Window_Maximize.wav
KDE_Beep_Beep.wav         KDE_Desktop2.wav          KDE_Window_Open.wav
KDE_Beep_Bottles.wav      KDE_Desktop3.wav          KDE_Window_Shade_Down.wav
KDE_Beep_ClassicBeep.wav  KDE_Desktop4.wav          KDE_Window_Shade_Up.wav
KDE_Beep_ClockChime.wav   KDE_Desktop5.wav          KDE_Window_Sticky.wav
KDE_Beep_Connect.wav      KDE_Desktop6.wav          KDE_Window_UnMaximize.wav
KDE_Beep_Door.wav         KDE_Desktop7.wav          KDE_Window_UnSticky.wav
KDE_Beep_Honk.wav         KDE_Desktop8.wav          gaim
KDE_Beep_Lightning.wav    KDE_Dialog_Appear.wav     gnomemeeting
KDE_Beep_Pop.wav          KDE_Dialog_Disappear.wav  k3b_error1.wav
KDE_Beep_RimShot.wav      KDE_Error.wav             k3b_success1.wav
KDE_Beep_RingRing.wav     KDE_Logout.wav            k3b_wait_media1.wav
KDE_Beep_ShortBeep.wav    KDE_Notify.wav            pop.wav
KDE_Beep_Yo.wav           KDE_Startup.wav           shutdown.ogg
KDE_Click.wav             KDE_Window_Close.wav      startup.ogg
KDE_Close_Window.wav      KDE_Window_DeIconify.wav
KDE_Critical_Error.wav    KDE_Window_Iconify.wav
root@tty1[sounds]# mkdir save
root@tty1[sounds]# mv shutdown.ogg save
root@tty1[sounds]# mv startup.ogg save
Note: If you'd like to disable all sounds by default, move all the files into the 
save directory

And finally, we'll prevent Konqueror from loading at startup. During startup, X-Windows (or the KDE window manager to be more precise) reads a number of files to configure itself. The file that actually causes Konqueror to load is located at /mnt/work/master/KNOPPIX/etc/X11/Xsession.d/45xsession. We'll need to edit this file and comment out the Autostart link. Here is a snip out of this file, the LIQ (Line In Question) is highlighted in red:
if [ -e "$INDEXFILE" ]; then
cat >> $HOME/Desktop/KNOPPIX.desktop <<EOF
[Desktop Entry]
Name=KNOPPIX
# Exec=kfmclient openProfile webbrowsing $INDEXFILE
Exec=konqueror --geometry 800x650+110+40 file:$INDEXFILE
Type=Application
Icon=html
Terminal=0
EOF
ln $HOME/Desktop/KNOPPIX.desktop $HOME/.kde/Autostart/showindex.desktop
fi

We'll comment this line by slapping a # (pound) sign in front of it. You can edit this file with vi to comment out the line, or simply run the following commands:
root@tty1[root]# cd /mnt/work/master/KNOPPIX/etc/X11/Xsession.d

root@tty1[Xsession.d]# grep Autostart.showindex 45xsession
ln $HOME/Desktop/KNOPPIX.desktop $HOME/.kde/Autostart/showindex.desktop
We want to comment out this line

root@tty1[Xsession.d]# sed -i 's/^\(ln.*Autostart.showindex\)/#\1/' 45xsession

root@tty1[Xsession.d]# grep Autostart.showindex 45xsession
#ln $HOME/Desktop/KNOPPIX.desktop $HOME/.kde/Autostart/showindex.desktop
Notice that a # (pound) sign has appeared before the "ln"

Okay, that's it, we're ready to create a new ISO image with our customizations. We build the image exactly as we did before, by running the script "/mnt/work/master/mk.sh". Everything else is "automagic"! Remember that this process can take a while, depending on your machine speed, memory, etc. When the build is completed, flip back over to Windows and test the new ISO image in the exact same way as you did when we tested our first ISO image. Just make sure that you select the new ISO image or you won't see our customizations. If you've followed the steps as outlined, your customized Linux ISO image should load without launching konqueror, no sounds, and the background image should be the one that we selected. Here is what ours looks like:

Click for full size


 << Testing your ISO   Environment Shutdown >> 

1 2 3 4 5 6 7 8

(switch to medium sized images)