Controlling boot options
Configuration for ISOLINUX is done through the isolinux.cfg file. It is a normal text file, and upon opening it you will see that it references the boot.msg and f1-f3 files. You could conceivably add more to this list.
More importantly are the listing for kernel images. This is where we'll add a listing for a new kernel. Let's consider adding a new kernel image of linux-2.6.8 kernel (the default in Knoppix 3.8 is 2.6.11). The following lines will give us a start:
LABEL knoppix268 KERNEL vmlinuz268 APPEND ramdisk_size=100000 nosound nomce quiet lang=us initrd=miniroot268.gz vga=791 init=/etc/init BOOT_IMAGE=knoppix
For this we'll need to create two new files in the isolinux directory: vmlinuz268 and miniroot268.gz. The former will be covered in a moment, but the latter can be based off of the current miniroot.gz file. At this point, a discussion of the boot process is in order. There are three main points:
- The Knoppix CD is booted by the BIOS, and the ISOLINUX subsystem (using isolinux.bin) reads the isolinux.cfg file. This results in the boot.msg data being displayed on screen, and any entries on the command line are then checked against the isolinux.cfg file. If a correct label is chosen, any additional arguments (such as nodhcp) are passed along with anything after the 'APPEND' statement. Based on the label, isolinux.bin will boot the kernel specified by KERNEL and use the file specified by initrd to start the miniroot. Note that transfer is never completed from this kernel to any other kernel—the existence of /boot/vmlinuz is superfluous once the CD-ROM environment boots! Those in dire need of space could remove it.
- Next, the miniroot.gz file is decompressed and used to start the minimal boot environment. In our example, the file would be miniroot268.gz, which contains a compressed loopback filesystem. Inside the filesystem is a single configuration file, linuxrc, which covers all the initializations before /etc/init starts on the actual system. It can insert a small subset of available kernel modules and then uncompresses the compressed filesystem from the CD. Modification of linuxrc and the modules will be covered later.
- At this point, the vmlinuz268 kernel is the running kernel on the computer, and has used the miniroot268.gz initrd file to bootstrap a Knoppix system (by adding the right modules and uncompressing the filesystem). Now the system behaves like a normal Linux installation. Any other bootable configurations (such as init.d scripts) must be done in the chrooted environment, as covered in the last article.
So, therefore, in order to upgrade the kernel, we need to compile a new one, copy it to the boot/isolinux directory, reference it in isolinux.cfg, and copy the kernel modules into the initrd file (by convention, miniroot.gz). Lastly, all the kernel modules must be available once the OS is loaded in the /lib/modules/kernel-version directory. For this reason I suggest recompiling the kernel within the chrooted Knoppix environment, since it provides access to that directory and Debian installation tools (which will help greatly).