tags:

views:

2425

answers:

11

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!

A: 

I'm not understanding your question, what do you mean when you say "from scratch" ? like burning an ISO image of a distribution or creating your own distro from a linux kernel ?

mmattax
A: 

I'm not understanding your question, what do you mean when you say "from scratch" ? like burning an ISO image of a distribution or creating your own distro from a linux kernel ?

I can take an existing distro, but it's going end up being gutted - for example, just about all daemons are going to have to be removed. No X Windows. No applications or games or anything like that - just a bare bones environment that has just enough to boot, load some drivers, run a perl script and then power off again.

Mike Heinz
+1  A: 

Ryan Guest wrote:

Creating Your Own Custom Ubuntu 7.10 Or Linux Mint 4.0 Live-CD With Remastersys

Ryan,

That's an interesting option - although I'd have to preserve the original machine to deal with updates and such. I'll look into it.

Mike Heinz
+1  A: 

Depends on your distro. Here's a good article you can check out from LWN.net

There is a book I used which covers a lot of distros, though it does not cover creating a flash-bootable image. The book is Live Linux(R) CDs: Building and Customizing Bootables. You can use it with supplemental information from your distro of choice.

Misha M
+2  A: 

There are a couple of interesting projects you could look into.

But first: does it have to be a CD-ROM? That's probably the slowest possible storage (well, apart from tape, maybe) you could use. What about a fast USB stick or a an IEE1394 hard-disk or maybe even an eSATA hard-disk?

Okay, there are several Live-CDs that are designed to be very small, in order to e.g. fit on a business card sized CD. Some were also designed to be booted from a USB stick, back when that meant 64-128 MiByte: Damn Small Linux is one of the best known ones, however it uses a 2.4 kernel. There is a sister project called Damn Small Linux - Not, which has a 2.6 kernel (although it seems it hasn't been updated in years).

Another project worth noting is grml, a Live-CD for system administration tasks. It does not boot into a graphic environment, and is therefore quite fast; however, it still contains about 2 GiByte of software compressed onto a CD-ROM. But it also has a smaller flavor, aptly named grml-small, which only contains about 200 MiByte of software compressed into 60 MiByte.

Then there is Morphix, which is a Live-CD builder toolkit based on Knoppix. ("Morphable Knoppix"!) Morphix is basically a tool to build your own special purpose Live-CD.

The last thing I want to mention is MachBoot. MachBoot is a super-fast Live-CD. It uses various techniques to massively speed up the boot process. I believe they even trace the order in which blocks are accessed during booting and then remaster the ISO so that those blocks are laid out contiguously on the medium. Their current record is less than 6 seconds to boot into a full graphical desktop environment. However, this also seems to be stale.

Jörg W Mittag
A: 

There are a couple of interesting projects you could look into.

jwmittag - thanks for the suggestions but, unfortunately, DSL and similar probably aren't acceptable because the distro has to support our specialized kernel modules in order to access the card and write the firmware. That's one of the reasons I was looking for a generic procedure for creating Live CDs.

Your suggestion of using flash is interesting, as well. I'm currently looking at using livecd-creator as the main tool because it works with CentOS - which is a distro we support. (The only downside is that it revolves around Yum, so I would have to set up my own yum repository to add my kernel drivers.) Anyway, it appears that there is a USB version of that tool, I will have to take a look at it.

Mike Heinz
+1  A: 

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.

Joshdan
A: 

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!

Mike Heinz
A: 

Debian Live provides the best tools for building a Linux Live CD. Webconverger uses Debian Live for example.

It's very easy to use.

sudo apt-get install live-helper # from Debian unstable, which should work fine from Ubuntu

lh_config # edit config/* to your liking

sudo lh_build

hendry
A: 

Mike, I'm glad to hear you found something that worked for you. Do I also smell some hidden reproaches on your side suggesting the creator(s) of the free-of-charge, freely-licensed and sourcecode-providing tool that helped you out (liveusb-creator) were too lazy to properly document how it's used?? How about you contributing the README you're missing -- now that you've mastered the steep learning curve? Now that you do have a good idea what a first time user of liveusb-creator would expect to find in such a document? Wouldn't that be just fair game instead of publicly posting a thinly-veiled complaint that it cost you more time than you had hoped for?

Cheers, have fun,
pipitas

pipitas