Baked Cheesecake Linux: Version 1

Simon Hood

Rough Plan

The Boot Sequence

Building a CD-Bootable Linux Distribution: Summary


Summary of What Was Done

Building the Kernel

Ensure the kernel-sources and gcc RPMs are installed.

Don't forget the latter like I did the first time around. Proceed as follows: I omitted Frambuffer Support to save space.


Kernel Command-Line Options

I had a little trouble getting the root-pivotting/chroot/second-init sequence to work properly. (Judging by results from Google, so do many others.) Solution: read /usr/src/linux-2.4/Documentation/initrd.txt carefully. In particular, the kernel (within BOOT.IMG) needs to be supplied with some boot-time options (these go within SYSLINUX.CFG if using SYSLINUX, or within lilo.conf, if using lilo --- e.g., if testing):

For details, see syslinux.cfg (below, Building the Floppy Boot Image) or lilo.conf (below, Testing the Kernel).

Building the initrd

We combine the contents of Maragda's script Init_initrd with the gist of the description contained in Rute. Points to note:


Building initrd.gz


Contents and Structure

I used two different initrds --- one to aid in debugging, whilst testing, which includes some extra bits and pieces, and is to big to fit on a floppy with the custom kernel, and a second one which is the actual, real, working mccoy:


Building

Given the above listed files within directory initrd, then:

    dd if=/dev/zero of=initrd.img count=2500 bs=1024
            # ...count may need to be made bigger, and can perhaps be made
            #    smaller;

    losetup /dev/loop0 initrd.img
    mke2fs /dev/loop0
    mkdir mnt
    mount /dev/loop0 mnt
    cp -a initrd/* mnt
    umount mnt
    losetup -d /dev/loop0
    gzip -c -9 initrd.img > initrd.gz

linuxrc


The script used

Again, two different version, one for testing and debugging, a second actually used:


The Obsolete Sequence

The Maragda documentation (and linuxrc) describes and uses an obsolete root-pivotting method, as mentioned in /usr/src/linux-2.4/Documentation/initrd.txt. This involves all sorts of weird and wonderful stuff like...???. Thankfully it is obsolete.

Testing the Kernel and Associated initrd

Put copies of, or links to ROOT.FS and WHOLE.FS in place so that linuxrc can find them, e.g., in /system, on one of the linux installations; place the custom kernel, bzImage-2002Mar22, say, and the initial ramdisk, initrd.gz-2002Mar22 in /boot on the same installation. Edit your boot loader configuration so that the new kernel is a bootable option, e.g., with lilo: /etc/lilo.conf should include:

    image=/boot/bzImage--<version>
            label=my_cd_kernel
            initrd=/boot/initrd.gz.my_cd_k
            read-only
            append="root=/dev/ram0 init=/linuxrc rw ramdisk_size=100000"
(note the append line). Then run lilo and (and lilo -q if you want), then reboot and choose the new kernel from the lilo menu. Check all is ok before making the floppy boot image, BOOT.IMG.


Tip

If running linuxrc works from the command line but when booting and running it looks ok, but the wrong init sequence is run, e.g., that on the harddisk, check:

Building the Floppy Boot Image (Using syslinux)

We follow Maragda and use syslinux, rather than lilo as our boot loader (its smaller???).

Making ROOT.FS

Essentially we follow the Cp_root script of Maragda, with a few modifications.


The Init Sequence


Making ROOT.FS

Its done.


Issues and Usage

There are some issues which remain --- in particular, how to get our IP address. See Current Status. One can simply run netconfig after logging in as root as a work around/solution.

Making USR.FS

This, thankfully, is simple.

Done.

Testing Before Making the CD

See "Testing the Kernel and Associated initrd", above.

Making the CD




About this document:

Produced from the SGML: /home/isd/public_html/_simaragda/_reml_grp/v1.reml_lib
On: 26/3/2002 at 11:2:18
Options: reml2 -i noindex -l long -o html -p single