Create a bootable CD-ROM

Introduction

To create a bootable CD-ROM you may follow the instructions in the Bering User's Guide Chapter 10, with the exception that you don't have to build a new initrd if you use initrd_ide_cd.lrp renamed to initrd.lrp.

The approach described in the Bering User's Guide has the disadvantage that due to bad BIOS implementations, the CD may not boot in older computers.

We will describe the more general approach the Dachstein versions used to create a bootable CD-ROM, which allows to boot from CD on every computer that is able to boot from CD.

Main trick is to provide a bootable 1,44Mb floppy diskimage on the CD-ROM.

Step1 Create a bootable 1,44MB floppy

Format a floppy disk, add a msdos filesystem and make it bootable with syslinux:

# fdformat /dev/fd0 
# mkfs.msdos /dev/fd0 
# syslinux -sf /dev/fd0

Now mount the floppy and copy the kernel (linux), syslinux.cfg and syslinux.dpy from the Bering-uClibc diskimage onto the floppy. Copy initrd_ide_cd.lrp renamed to initrd.lrp onto the floppy.

Before umounting the floppy edit syslinux.cfg on the floppy disk.

syslinux.cfg for Bering-uClibc 2.1 and earlier versions

Edit syslinux.cfg and make shure the PKGPATH points to the CD-ROM device and floppy as well (that's the place where you store your configuration settings).

display syslinux.dpy
timeout 0
default linux initrd=initrd.lrp init=/linuxrc rw root=/dev/ram0 boot=/dev/fd0:msdos PKG
PATH=/dev/cdrom:iso9660,/dev/fd0:msdos LRP=root,etc,loca.....

Now you have a bootable floppy for your CD.

syslinuxcfg for Bering-uClibc 2.2 and later versions

Edit syslinux.cfg and change the LEAFCFG variable to point to your floppy device (so you can easily add or remove packages to load without buring a new ISO-image:

display syslinux.dpy
timeout 0
default linux initrd=initrd.lrp init=/linuxrc rw root=/dev/ram0 LEAFCFG=/dev/fd0:msdos

This will be your bootable the floppy for the CD creation.

The floppy device will be used to store your configuration settings.

Step 2: Create the CD

Now you are ready to build your CD-ROM. Create a new directory and put all packages you like to have available on your CD into it.

Next dump your boot floppy build above into the same directory.

# dd if=/dev/fd0 of=bootdisk.ima bs=8k

Create an ISO-Image from that directory and burn it.

# mkisofs -v -b bootdisk.ima -c boot.catalog -r -J -f -o Bering-uClibc-CD.iso 
# cdrecord -v dev=[target] Bering-uClibc-CD.iso

Step 3: Adding packages and backup configuration

Packages can be added or removed in a flexibel way by declaring/undeclaring them in lrpkg.cfg (Bering-uClibc <= 2.1) or leaf.cfg (Bering-uClibc >= 2.2) on a new formatted floppy.

Additionally your configuration settings for all packages can be stored on the same floppy.

Declaring packages for Bering-uClibc 2.1 and earlier versions

To add or remove packages just edit lrpkg.cfg on a blank formatted floppy disk - all entries on one line. It looks like:

root,etc,local,modules,pump,keyboard,shorwall,dnscache,webconf

Declaring packages for Bering-uClibc 2.2 and later versions

Edit leaf.cfg on a blank formatted floppy disk, add your packages to LRP and change PKGPATH to point to your CDROM and the floppy device.

LRP="root config etc local modules iptables dnsmasq keyboard shorwall ulogd libz mawk libssl libm ezipupd dropbear webconf ppp pppoe libpcap"
PKGPATH=/dev/fd0:msdos,/dev/cdrom:iso9660
syst_size=8M
log_size=2M

Note

The order in PKGPATH is important!

The leftmost entry will be loaded last - so your packages will be load first from CDROM and then from /dev/fd0. This will overwrite the configuration with the settings you stored on the floppy.

Backing up your configuration

You can backup your configuration changes onto the floppy, you have declared leaf.cfg/lrpkg.cfg.

To only backup the changes in configuration and not the complete packages, which may be too big to fit onto a floppy, choose "partial backup" and /dev/fd0 as destination for the packages.

Important

Partial backup does not work for etc.lrp.