[lug] "boot floppy" CD creation recommendations

Michael J. Hammel mjhammel at graphics-muse.org
Mon Oct 9 14:46:46 MDT 2006


On Mon, 2006-10-09 at 06:40 -0600, Bear Giles wrote:
> I don't want/need something like 'knoppix' since this should be entirely 
> automatic and can be keyed to this specific system.  I remember using 
> syslinux to create the current boot CD two years ago, but I also 
> remember that process as being painful and creating a high stack of 
> coasters.

Just use isolinux to specify the structure on the CD for booting.
ISOLinux just tells the system what to boot, not what the boot will do.
The latter is a matter of a kernel and a well built initrd.  The initrd
(or initramfs, for 2.6) is configured to know how to mount the real disk
and then pivot (or switch_root) to the init in the real root filesystem.
This is just like what Knoppix does, but instead of putting the whole
system into a compressed filesystem on the CD (which is what Knoppix and
similar LiveCDs do), you're putting it on the hard disk and telling the
initrd how to mount the disk and run from it instead.  In fact, you
could install the hard disk as if it where going to boot from disk, then
put the kernel and initrd on the CD using syslinux.  Should probably
work the same (knock wood).

For testing purposes, just use PXELinux instead.  Assuming this special
hardware can do PXE boots.  The only meaningful difference between using
PXELinux and Syslinux is where the kernel and initrd live.  I did this
at home to test my kernels and initrds before creating a LiveCD with
them.

In a nutshell, here is what I do to boot from a CD:

Use busybox to create an environment for the initrd.  This goes in a
"./busybox" directory.
Build my kernel (vmlinuz) and any loadable modules I need.
Copy any required loadable kernel modules into
the ./busybox/lib/modules/<kernelver>/kernel/... directories.
Copy an init script to ./busybox/.  The init script is a shell script
that knows how to mount your disk, including how to load modules
required to do that.
Create an initramfs by changing into ./busybox and running:
   (find . |cpio -o -H newc |gzip -9 > $(TMPDIR)/isolinux/initrd.gz
Copy my kernel into $(TMPDIR)/isolinux/vmlinuz
Copy isolinux.bin from ISOLinux to $(TMPDIR)/isolinux/isolinux.bin
Copy my version of isolinux.cfg to $(TMPDIR)/isolinux/isolinux.cfg (this
is setup to say what the kernel name, what the initrd is named and to
run /init at boot time).
Build my iso image:
mkisofs -R -l -allow-leading-dots -allow-multidot \
    -D -o /tmp/myISO.iso \
    -b /isolinux/isolinux.bin \
    -c /isolinux/boot.cat -no-emul-boot -boot-load-size 4 \
    -boot-info-table -V "MYBOOT_CD" ./
Burn the CD with the ISO image

Hopefully the directory paths are correct here.  I'm extracting this
from a build system I created for a Linux From Scrtach based system, so
I might have gotten some of the variables munged in the translation.

To avoid stacks of wasted CDs:  buy a RW CD.  :-)  I built my system
using two of these and was able to write them many times.  Price for
these has gone way down now that the world is DVD-crazed.

Hope that helps.
-- 
Michael J. Hammel                                    Senior Software Engineer
mjhammel at graphics-msue.org                           http://graphics-muse.org
------------------------------------------------------------------------------
      Technology keeps us apart.  Please, use it.  --  Michael J. Hammel




More information about the LUG mailing list