Create boot-able CDs 

linux single boot 

http://rescuecd.sourceforge.net/288.html#isolinux

use isolinux as the bootloader? nothing easier than that.

first make a direcory isolinux in the root tree of your rescue system: mkdir $ROOTFS/isolinux

copy the kernel image, the gzipped initrd image, isolinux.bin and isolinux.cfg to $ROOTFS/isolinux

make the cd image with the following command:

mkisofs -R -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table $ROOTFS > cd.iso

voila, that's it.

Help mkisofs 

mkisofs will only write 8.3 style uppercase only filenames by default. If you want filenames up to 31 chars long, then specify the -l option. If you want mixed case filenames you need to enable the Rock Ridge extensions with the -R option, and may want to use the -r option as well which assigns sensible user/group ownership to all files. You will definately need the -R option if you want to copy whole unix directory trees to the CD.

-no-emul-boot
       Specifies that  the  boot  image  used  to  create  "El  Torito"
       bootable CDs is a 'no emulation' image. The system will load and
       execute this image without performing any disk emulation.
-boot-load-size load_sectors
       Specifies  the number of "virtual" (512-byte) sectors to load in
       no-emulation mode.  The default is to load the entire boot file.
       Some BIOSes may have problems if this is not a multiple of 4.

When the -boot-info-table option is given, mkisofs will modify the boot file specified by the -b option by inserting a 56-byte "boot informa- tion table" at offset 8 in the file. This modification is done in the source filesystem, so make sure you use a copy if this file is not eas- ily recreated! This file contains pointers which may not be easily or reliably obtained at boot time.

The format of this table is as follows; all integers are in section 7.3.1 ("little endian") format.

Offset    Name           Size      Meaning
 8        bi_pvd         4 bytes   LBA of primary volume descriptor
12        bi_file        4 bytes   LBA of boot file
16        bi_length      4 bytes   Boot file length in bytes
20        bi_csum        4 bytes   32-bit checksum
24        bi_reserved    40 bytes  Reserved

The 32-bit checksum is the sum of all the 32-bit words in the boot file starting at byte offset 64. All linear block addresses (LBAs) are given in CD sectors (normally 2048 bytes).

Help isolinux.cfg 

# isolinux.cfg

DEFAULT RescueSystem
PROMPT 1

LABEL RescueSystem
KERNEL /isolinux/vmlinuz
APPEND initrd=initrdfs.gz ramdisk_size=40960 root=/dev/ram0
TIMEOUT 100

In the configuration file blank lines and comment lines beginning with a hash mark (#) are ignored.

DEFAULT kernel options… 

Sets the default command line. If SYSLINUX boots automatically, it will act just as if the entries after DEFAULT had been typed in at the "boot:" prompt, except that the option "auto" is automatically added, indicating an automatic boot.

If no configuration file is present, or no DEFAULT entry is present in the config file, the default is kernel name "linux", with no options.

APPEND options… 

Add one or more options to the kernel command line. These are added both for automatic and manual boots. The options are added at the very beginning of the kernel command line, usually permitting explicitly entered kernel options to override them. This is the equivalent of the LILO "append" option.

Labels 

Indicates that if "label" is entered as the kernel to boot, SYSLINUX should instead boot "image", and the specified APPEND and IPAPPEND options should be used instead of the ones specified in the global section of the file (before the first LABEL command.) The default for "image" is the same as "label", and if no APPEND is given the default is to use the global entry (if any). Up to 64 LABEL entries are permitted for ISOLINUX.

Labels are mangled as if they were filenames, and must be unique after mangling. For example, two labels "v2.1.30" and "v2.1.31" will not be distinguishable under SYSLINUX, since both mangle to the same DOS filename.

TIMEOUT timeout 

Indicates how long to wait at the boot: prompt until booting automatically, in units of 1/10 s. The timeout is cancelled as soon as the user types anything on the keyboard, the assumption being that the user will complete the command line already begun. A timeout of zero will disable the timeout completely, this is also the default.

Note The maximum possible timeout value is 35996; corresponding to just below one hour.
DISPLAY filename 

Displays the indicated file on the screen at boot time (before the boot: prompt, if displayed). Please see the section below on DISPLAY files.

Note If the file is missing, this option is simply ignored.

multi boot cdrom images 

you can use isolinux in conjunction with memdisk to create multi boot cds. http://syslinux.zytor.com/memdisk.php

tree hierarchy 

you can download the tree shown below without the image files here. just untar the archive, copy the images you want to boot into the images directory and adjust the isolinux.cfg file.

        cd_root/
            |
            |
            |- RESCUECD
            |
            |- isolinux/
                  |
                  |- images/
                  |    |
                  |    |- dr_image.img
                  |    |- part_img.img
                  |    |- rescuecd.iso
                  |    |- win_95a.img
                  |    |- win_95b.img
                  |    |- win_98.img
                  |    |- win_98se.img
                  |    |- win_me.img
                  |
                  |- txt/
                  |    |
                  |    |- message.txt
                  |
                  |- initrdfs.gz
                  |- isolinux.bin
                  |- isolinux.cfg
                  |- memdisk
                  |- vmlinuz

isolinux.cfg 

the rescuecd image is a special case 'cause we don't want to load the whole iso into RAM, so there is a special initrdfs.gz which takes care of starting it. the other images will all straightforward booted by the memdisk tool.

DEFAULT 1
DISPLAY /isolinux/txt/message.txt
PROMPT 1

LABEL 1
    KERNEL /isolinux/vmlinuz
    APPEND initrd=initrdfs.gz init=/linuxrc ramdisk_size=5000 root=/dev/ram0
    TIMEOUT 100

LABEL 2
    KERNEL /isolinux/vmlinuz
    APPEND initrd=initrdfs.gz init=/linuxrc ramdisk_size=5000 root=/dev/ram0 cd_into_ram
    TIMEOUT 100

LABEL 3
    KERNEL /isolinux/memdisk
    APPEND initrd=images/dr_image.img
    TIMEOUT 100

LABEL 4
    KERNEL /isolinux/memdisk
    APPEND initrd=images/part_img.img
    TIMEOUT 100

LABEL 5
    KERNEL /isolinux/memdisk
    APPEND initrd=images/win_95a.img
    TIMEOUT 100

LABEL 6
    KERNEL /isolinux/memdisk
    APPEND initrd=images/win_95b.img
    TIMEOUT 100

LABEL 7
    KERNEL /isolinux/memdisk
    APPEND initrd=images/win_98.img
    TIMEOUT 100

LABEL 8
    KERNEL /isolinux/memdisk
    APPEND initrd=images/win_98se.img
    TIMEOUT 100

LABEL 9
    KERNEL /isolinux/memdisk
    APPEND initrd=images/win_me.img
    TIMEOUT 100

creating the image 

mkisofs -R -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table cd_root > rescuecd.iso

MEMDISK 

http://syslinux.zytor.com/memdisk.php

What is MEMDISK? 

MEMDISK is meant to allow booting the boot image of legacy operating systems.

The boot image is a sector by sector image taken from a bootable floppy. When a PC boots from floppy this is normally done from the first floppy drive, known as drive number 0 or as drive A:. So, to let the CD-Rom boot there must be some mechanism that emulates a floppy drive (drive number 0).

MEMDISK simulates a disk by claiming a chunk of high memory for the disk and a (very small - 2K typical) chunk of low (DOS) memory for the driver itself, then hooking the INT 13h (disk driver) and INT 15h (memory query) BIOS interrupts.

How can I use MEMDISK? 

MEMDISK is an auxillary module used in conjunction with ISOLINUX. You need a disk image as well as the memdisk file itself. As far as the bootloader is concerned, memdisk is the "kernel" and disk image is the initial ramdisk (initrd).

You can use MEMDISK straight off the boot loader command line like the following:

memdisk initrd=diskimg.img
.. where, of course, diskimg.img is the name of the disk image file. The

memdisk file and the disk image need to be present in the appropriate location.

Normally, however, you would put something like following in the configuration file:

label dos
   kernel memdisk
   append initrd=dosboot.img

How should the image be constructed? 

The image file should contain a disk image, either a floppy disk or hard disk image. The disk image should not be compressed.

If the disk image is one of the following sizes, it's assumed to be a floppy image:

368,640 bytes 360K floppy (old 5.25")
737,280 bytes 720K floppy (old 3.5")
1,222,800 bytes 1200K floppy (standard 5.25")
1,474,560 bytes 1440K floppy (standard 3.5")
2,949,120 bytes 2880K floppy (enhanced 3.5")

For any other size, the image is assumed to be a hard disk image, and should have an MBR and a partition table. The C/H/S geometry is determined by examining the partition table, so the image does need to contain a valid partition table which convers the entirety of the image for proper operation.

It is also possible to specify the geometry manually, overriding the autodetect feature, by specifying the following command-line options:

c=number Specify the number of cylinders (max 1024[*])
h=number Specify the number of heads (max 256[*])
s=number Specify the number of sectors (max 63)
floppy The image is a floppy disk image
harddisk The image is a hard disk image

Make my bootable CD 

isolinux.cfg 

W98_ID=$(echo $(ls Boot/*.img | wc -l))
MEMTEST_ID=`expr $W98_ID + 1`
svs W98_ID MEMTEST_ID

cat <<EOF > isolinux.cfg
PROMPT  1
DISPLAY /isolinux/menu.txt
DEFAULT $W98_ID
TIMEOUT 100

EOF
 cat !$

ls Boot/*.img | cat -n | awk '{printf "LABEL "$1"\n  KERNEL /isolinux/memdisk\n  APPEND initrd="$2"\n\n"}'    >> !$
 cat !$

cat <<EOF >> !$
LABEL $MEMTEST_ID
  KERNEL /isolinux/memtest.86
EOF
 cat !$

ls Boot/*.img | cat -n | sed "s/$t/) /; s|Boot/|Boot - |; s/\.img$//" > menu.txt.s
printf "     $MEMTEST_ID) Launch - Mem Test 86" >> !$
 cat !$
cat !$ >> menu.txt
es !$
results 
$ cat menu.txt
     1) Boot - Norton Ghost (Network)
     2) Boot - Tech W0rm
     3) Boot - Win98 (se)       [*]
     4) Launch - Mem Test 86

$ cat isolinux.cfg
PROMPT  1
DISPLAY /isolinux/menu.txt
DEFAULT 3
TIMEOUT 100

LABEL 1
  KERNEL /isolinux/memdisk
  APPEND initrd=Boot/NGhost.img

LABEL 2
  KERNEL /isolinux/memdisk
  APPEND initrd=Boot/TechW0rm.img

LABEL 3
  KERNEL /isolinux/memdisk
  APPEND initrd=Boot/Win98se.img

LABEL 4
  KERNEL /isolinux/memtest.86

Disk image 

MKISOPTS="-r -N -L -d -D -J"
TODAY=`date '+%Y-%m-%d'`
ISOFILE="../wincombo.iso"
mkisofs $MKISOPTS -f           \
  -V "W98+Office2k"            \
  -A "MS Win98 & Office2000 (Created $TODAY)"     \
  -o $ISOFILE                   \
  -b isolinux/isolinux.bin -c isolinux/boot.cat \
  -no-emul-boot -boot-load-size 4 -boot-info-table .
dir $ISOFILE

burn test CD 

cdrecord -multi dev=0,0,0 -eject -v speed=8 $ISOFILE

Problems 

Create wincombo 

Windows single boot 

MKISOPTS="-r -N -L -d -D -J"
TODAY=`date '+%Y-%m-%d'`
ISOFILE="../wincombo.iso"
mkisofs $MKISOPTS               \
  -V "W98+Office2k"       \
  -A "MS Win98, Office2000 & IE6. Created on $TODAY"     \
  -o $ISOFILE                   \
  -b Boot/TECHW0RM.IMG -c Boot/boot.cat .
dir $ISOFILE

Windows multi boot 

md ~/briefcase/wincombo/isolinux

Files 

cp /usr/lib/syslinux/isolinux.bin .
cp /usr/lib/syslinux/memdisk .

isolinux.cfg 

cat <<EOF > isolinux.cfg
PROMPT 1
DISPLAY /isolinux/menu.txt
DEFAULT   2
TIMEOUT 100

EOF

ls Boot/*.img | cat -n | awk '{printf "LABEL "$1"\n  KERNEL /isolinux/memdisk\n  APPEND initrd="$2"\n\n"}'    >> !$

$ cat !$
PROMPT 1
DISPLAY /isolinux/menu.txt
DEFAULT   2
TIMEOUT 100

LABEL 1
  KERNEL /isolinux/memdisk
  APPEND initrd=Boot/TechW0rm.img

LABEL 2
  KERNEL /isolinux/memdisk
  APPEND initrd=Boot/win98se.img

  -- The 'KERNEL' has to appear under every LABEL!

ls Boot/*.img | cat -n | sed "s/$t/) /; s|Boot/|Boot |; s/\.img$//" > menu.txt

$ cat !$
     1) Boot TechW0rm
     2) Boot win98se
history 
$ ls Boot/*.img | cat -n | awk '{printf "LABEL $1\n\tAPPEND initrd=$2\n\n"}'
LABEL $1
        APPEND initrd=$2

LABEL $1
        APPEND initrd=$2

isolinux.cfg, history 1 

The problem of the following approach is that using 1 or 2 doesn't work when booted.

cat <<EOF > isolinux.cfg
PROMPT 1
TIMEOUT 100
KERNEL /isolinux/memdisk
DEFAULT   win98se

EOF

for ff in Boot/*.img; do printf "LABEL $(fname $ff)\n\tAPPEND initrd=$ff\n\n"; done >> !$

$ cat !$
PROMPT 1
TIMEOUT 100
KERNEL /isolinux/memdisk
DEFAULT   win98se

LABEL TechW0rm
        APPEND initrd=Boot/TechW0rm.img

LABEL win98se
        APPEND initrd=Boot/win98se.img

Disk image 

MKISOPTS="-r -N -L -d -D -J"
TODAY=`date '+%Y-%m-%d'`
ISOFILE="../wincombo.iso"

mkisofs $MKISOPTS -f            \
  -V "W98+Office2k"             \
  -A "MS Win98, Office2000 & IE6. Created on $TODAY"     \
  -o $ISOFILE                   \
  -b isolinux/isolinux.bin -c isolinux/boot.cat \
  -no-emul-boot -boot-load-size 4 -boot-info-table .

dir $ISOFILE
-f     Follow symbolic links when generating the filesystem.  When this
       option  is not in use, symbolic links will be entered using Rock
       Ridge if enabled, otherwise the file will be ignored.

burn test CD 

cdrecord dev=0,0,0 blank=fast
cdrecord -multi dev=0,0,0 -eject -v speed=4 ~/try/wincombo.iso