Create bootable images, and bootable CD-Rom's
Creating a CD-ROM
Most modern PCs can boot from CD-ROM and in the near future most computers
will not even have floppy drives. Therefore we present an alternative
configuration using a CD-ROM. In our method we are essentially creating three
levels of disk image files:
- At the outermost level there is the iso file created by mkisofs.
- At the intermediate level there is the diskette image file that the BIOS can boot from.
- At the innermost level there is the compressed RAM disk image.
We have to start at the innermost level.
Creating the RAM disk image
Creating the RAM disk image for a CD is really the same as for a diskette, only
this time we will fit the modules.tar.gz file into the RAM disk and hence
the RAM disk will be larger. Run the following commands (put them in a shell script):
dd if=/dev/zero of=initrd.img bs=1k count=3000
mke2fs -F -N 300 initrd.img
mount -o loop initrd.img mnt
cp -a rootfs/* mnt
cp modules.tar.gz mnt/lib
gzip -9 initrd.img
Creating the Diskette Image
On the CD-ROM we will use a diskette image of 2.88MB. Real diskettes of this
size are really rare, but most PCs can boot from a diskette image on a CD.
First prepare an image file of a 2.88MB diskette and copy GRUB to it.
dd if=/dev/zero of=isoboot.img bs=1k count=2880
mke2fs -F isoboot.img
mount -o loop isoboot.img mnt
cp grub-0.92/stage1/stage1 mnt/boot/grub
cp grub-0.92/stage2/stage2 mnt/boot/grub
Next create the file mnt/boot/grub/menu.lst with the following contents:
title Linux Installation Disk
Unmount and run GRUB:
Inside GRUB type the following commands:
device (fd0) isoboot.img
Now the diskette image (hopefully) contains a working boot loader. Keep a copy
of this image, so you can add your kernels and RAM disk images later.
Finally copy your RAM disk and kernel to it:
mount -o loop isoboot.img mnt
cp linux-2.4.21/arch/i386/boot/bzImage mnt/boot/kernel
cp initrd.img.gz mnt/boot
This diskette image is already quite full, so this spells the worst for newer
software versions or extensions. As a first measure we can remove the Ethernet
drivers from modules.tar.gz. If we can boot from a CD-ROM, we may as
well assume we have a CD-ROM and we can install from there. Otherwise you can
consider the isolinux CD boot loader, which does not use diskette
images, but can use kernels and RAM disk images anywhere on the CD.
It's worth considering the removal of both module support and network support
from the kernel and to compile most common SCSI host adapters directly into
the kernel. Functionality related to modules and networking can then also be
removed from Busybox.
Creating the Bootable CD
First create a directory tree for the ISO image.
Next copy some files to the data subdirectory (in our example we use a
hypothetical file distro.tar.gz and copy the diskette image
to the boot directory.
cp distro.tar.gz iso/data
cp isoboot.img iso/boot
Now create the ISO image.
mkisofs -o bootcd.iso -b boot/isoboot.img \
-c boot/boot.catalog -r iso
Finally burn it to a CD-ROM. Use the appropriate device ID.
cdrecord dev=0,1,0 -eject -pad -data bootcd.iso
This CD is bootable and from the booted Linux you should be able to mount the CD-ROM to access the data files.
Booting from USB
It is also possible to boot this release from a USB storage device. To transfer the live/installation you may use the ROSA Image Writer available from our repos:
At least 2GB of flash drive capacity is recommended. Persistent storage is not necessary. Note that this will erase everything on your USB!
You may alternatively dd the image to your USB stick:
dd if=<iso_name> of=<usb_drive> bs=4M
<iso_name> with the path to the ISO and
<usb_drive> with the device node of the USB drive, i.e.