Skip to content
Advertisement

Building a custom Linux Live CD

Can anyone point me to a good tutorial on creating a bootable Linux CD from scratch?

I need help with a fairly specialized problem: my firm sells an expansion card that requires custom firmware. Currently we use an extremely old live CD image of RH7.2 that we update with current firmware. Manufacturing puts the cards in a machine, boots off the CD, the CD writes the firmware, they power off and pull the cards. Because of this cycle, it’s essential that the CD boot and shut down as quickly as possible.

The problem is that with the next generation of cards, I have to update the CD to a 2.6 kernel. It’s easy enough to acquire a pre-existing live CD – but those all are designed for showing off Linux on the desktop – which means they take forever to boot.

Can anyone fix me up with a current How-To?


Update:

So, just as a final update for anyone reading this later – the tool I ended up using was “livecd-creator”.

My reason for choosing this tool was that it is available for RedHat-based distributions like CentOs, Fedora and RHEL – which are all distributions that my company supports already. In addition, while the project is very poorly documented it is extremely customizable. I was able to create a minimal LiveCD and edit the boot sequence so that it booted directly into the firmware updater instead of a bash shell.

The whole job would have only taken an hour or two if there had been a README explaining the configuration file!

Advertisement

Answer

One key piece of advice I can give is that most LiveCDs use a compressed filesystem called squashfs to cram as much data on the CD as possible. Since you don’t need compression, you could run the mksquashfs step (present in most tutorials) with -noDataCompression and -noFragmentCompression to save on decompression time. You may even be able to drop the squashfs approach entirely, but this would require some restructuring. This may actually be slower depending on your CD-ROM read speed vs. CPU speed, but it’s worth looking into.

This Ubuntu tutorial was effective enough for me to build a LiveCD based on 8.04. It may be useful for getting the feel of how a LiveCD is composed, but I would probably not recommend using an Ubuntu LiveCD.

If at all possible, find a minimal LiveCD and build up with only minimal stripping out, rather than stripping down a huge LiveCD like Ubuntu. There are some situations in which the smaller distros are using smaller/faster alternatives rather than just leaving something out. If you want to get seriously hardcore, you could look at Linux From Scratch, and include only what you want, but that’s probably more time than you want to spend.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement