svlug_bootable_cdroms

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



Date: Wed, 17 Jan 2001 04:45:59 -0800
From: Seth David Schoen <schoen@loyalty.org>
To: svlug@svlug.org
Subject: Re: [svlug] Bootable Linux CD?

Jose Medeiros writes:

> This may sound like a stupid question 
> but how can I make a bootable CD for linux?
> 
> Is this possible?

Sure.  The basic idea is that bootable CDs for PC machines use a standard
called El Torito, in which they contain a "boot image" which is actually a
byte-for-byte image of a bootable floppy disk.

If you look at the documentation for "mkisofs", you'll see that it allows
you to specify a file as a boot image.

The only really trick part is that the boot process should somehow try to
find and mount the CD-ROM.  This is an issue because the El Torito boot
process makes it look to the system as though it booted from a floppy disk
(who contents were identical with the above-mentioned boot image).  There
is no way I know of for the BIOS to tell the boot loader on that floppy
where the actual CD-ROM device is.

The result of that is that you may have to look at all the possible CD-ROM
devices on the system and try to find your CD and then mount it.  It's
normal to use a boot loader like Peter Anvin's SYSLINUX instead of LILO in
your boot image, and then use a RAM disk for the root filesystem.  (You
can't use the CD as the root filesystem because, as I said, the boot loader
doesn't actually know which device is the CD!)

> If so does anyone have a sample shell script that once it boots 
> I can have it run another program without requiring a prompt?

The whole point is to change the behavior of init.  If you use the standard
init, just put that program at the end of the rc.local script; everything
there runs automatically as root on the console before any login prompt
appears.

If you're brave enough, you can also make the program itself _be_ init (via
the init= command-line option to the kernel).

Some people enjoy adapting the Linuxcare Bootable Business Card for purposes
like this.

http://open-projects.linuxcare.com/BBC/

Our init there is itself a shell script, in all current versions, so you
can put your program there in place of the invocations of getty.

The Lubbock Project

http://lubbock.sourceforge.net/

is based on the Linuxcare BBC and may have a bit more useful documentation for
beginners.

===


the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu