A
reader comment in
last week's LWN, requesting a more detailed round-up of the available tools
for building custom live CDs, inspired today's feature. Although there are
more than a hundred bootable Linux, BSD and OpenSolaris-based distributions
for seemingly every taste and purpose, it might still be useful, on
occasion, to build one's own - customized to one's exact needs. The reasons
are unimportant since they are likely to vary as much as the end result of
any such undertaking. Instead, I'd like to concentrate on what the readers
are probably most interested in - finding an answer about how much effort
is required to build a custom Linux live CD and whether the end result is
worth it.
I have never built a live CD before. For my first attempt I decided to go
with the Slackware-based Linux-Live
script by Tomas Matejicek, the author of the SLAX live CD. The reason?
I expected Linux-Live to be about the simplest way to build a Linux live
CD. I don't have any facts to back up this statement, but the increasing
abundance of Slackware-based live CD projects, most of which use Linux-Live
to build their products, together with the uncomplicated nature of
Slackware itself, gave me confidence before embarking on this project.
Incidentally, Linux-Live is released under the GNU General Public License.
Linux-Live is a script designed to build a bootable live CD from an existing
Linux installation. A number of prerequisites must be fulfilled before the
script can be executed; the most important among them is support for
Unionfs and Squashfs modules in the Linux kernel. There are two ways to go
about fulfilling this requirement: you can either download and compile two
overlay filesystem modules, or download a pre-compiled kernel from the
Linux-Live web site with all the necessary modules (as well as ALSA and
proprietary MadWiFi drivers) already included. The latter option, however, will only
work on a Slackware installation. The Unionfs and Squashfs requirements
also mean that only kernel versions 2.6.9 or higher are supported.
After going through the documentation included in Linux-Live, I set out to
create my live CD. First, I installed a minimal Slackware 10.1
system, with only the packages in a/, ap/ and n/ selected for installation.
This was to reduce the possibility of a failure and also to minimize any
time-wasting in case something goes wrong. Since Slackware still defaults
to the 2.4 kernel series, I also downloaded the binary kernel 2.6.13.2 from
Linux-Live.org and installed it with pkginstall. It is not
necessary to reboot into the new kernel; as long as it is installed on the
system and the correct kernel version is specified in the 'config' file of
the Linux-Live script, it can be used. Then I download the Linux-Live
script, decompressed and untarred it in the /tmp directory, updated the
'config' file with the new kernel version, and executed the
rumme.sh script. After about six minutes of hard work, a 160 MB
livecd.iso file was generated.
I burned it onto a CD-RW and rebooted the system. I held my breath,
half-expecting the system to ignore the CD and just present me with the
usual boot loader, but to my pleasant surprise, it was a SLAX logo that
first appeared on the screen, indicating that the CD was indeed bootable.
After I pressed 'Enter', the live CD went through the boot process - it took
its time, I might add, since besides the normal boot procedure, the
operating system also completed a hardware detection and configuration
step. But eventually it stopped at a boot prompt, ready to accept a login
by any of the user/password combination -- and with the same home
directories -- as the Slackware system on the hard disk. Networking was
also configured.
Encouraged by this success, I decided to try something more ambitious. I
rebooted into my Slackware 10.1 installation, then added all software from
the x/ and kde/ and l/ directories, configured X.Org, modified
the /etc/inittab file to boot into a graphical login prompt, and repeated
the process of generating the live CD. This time, the routine took much
longer, around 20 minutes, and the resulting ISO image was 496 MB in size.
Again, I burned it to a CD-RW disk and rebooted the system. Then I watched,
with a considerable amount of amazement, as the CD went through a normal
boot process before confidently starting the KDM login manager. Success!
I spent an afternoon re-creating Slackware live CDs in various
configurations. While the process seemed to go smoothly most of the time, I
noted a few mysterious "gotchas" on occasion. As an example, sometimes the
original Slackware installation would no longer boot after running the ISO
build script (the boot process would stop at Loading Linux...). There is
also a documented problem with the fact that Slackware tries to test the
status of the root partition by re-mounting it read-only, a test which
fails on a live CD with Unionfs, resulting in a warning message and
requiring user input. A minor, but annoying blemish. A few of my live CDs
also failed to boot, for reasons unknown to me, with a "init Id 'x'
respawning too fast" error. Probably the most serious issue with
Linux-Live, however, is lack of documentation (apart from a few "readme"
style files included with the script) explaining the process and providing
hints for using the script on distributions other than Slackware. The
project would also benefit from having a Wiki as well as user forums which
adventurous live CD builders could use to search for answers and exchange
experiences.
All things considered, my first attempt at building a custom live CD was a
success. As I suspected before I embarked on the project, Linux-Live is a
very simple and fast method for creating a live CD from a Slackware
installation. Due to lack of time to research topics on compiling Unionfs
and Squashfs as kernel modules, I haven't tried it on any other
distribution, but the project's web site does give an impression that the
script is fairly universal. However, Linux-Live badly needs better
documentation and user interactive areas for those times when things don't
go as expected.
(
Log in to post comments)