2.3. Construction

In this section, we will be building the actual boot disk and root disk floppies. Lines starting with bash# indicate a shell command.

2.3.1. Prepare the boot disk floppy

Insert a blank diskette labeled "boot disk".

Note

It may be necessary to erase the "blank" diskette if it comes factory pre-formatted for another, non-Linux operating system. This can be done using the command dd if=/dev/zero of=/dev/fd0 bs=1k count=1440

bash# mke2fs -m0 /dev/fd0
bash# mount /dev/fd0 /mnt

2.3.2. Build the kernel

The steps for building the kernel were tested using Linux kernel version 2.4.18 and should work any 2.4.x kernel. The latest version of the kernel source code may be downloaded from http://www.kernel.org or one of its mirrors.

bash# cd /usr/src/linux
bash# make menuconfig

Be sure to configure support for the following:

bash# make dep
bash# make clean
bash# make bzImage

2.3.3. Copy the kernel to diskette

bash# mkdir /mnt/boot
bash# cp /usr/src/linux/arch/i386/boot/bzImage /mnt/boot/vmlinuz

2.3.4. Copy the LILO boot loader

bash# cp /boot/boot.b /mnt/boot/boot.b

2.3.5. Create device files that LILO needs

bash# mkdir /mnt/dev
bash# cd /mnt/dev
bash# mknod fd0 b 2 0
bash# mknod console c 5 1

2.3.6. Write a simple lilo.conf

bash# mkdir /mnt/etc
bash# cd /mnt/etc

Use an editor like vi, emacs or pico to create the following lilo.conf file:

# /etc/lilo.conf - boot loader configuration file
#
boot=/dev/fd0
compact
prompt
read-only
vga=normal
image=/boot/vmlinuz
label=bootdisk
append="load_ramdisk=1 prompt_ramdisk=1"
root=/dev/fd0
#
# end of /etc/lilo.conf

2.3.7. Install the LILO boot loader

bash# lilo -r /mnt

2.3.8. Unmount the boot disk

bash# cd /
bash# umount /mnt

2.3.9. Prepare the root disk floppy

Insert a blank diskette labeled "root disk".

bash# mke2fs -m0 /dev/fd0
bash# mount /dev/fd0 /mnt

2.3.10. Build BASH

Get the bash-2.05 source code package from ftp://ftp.gnu.org/gnu/bash/ and untar it into the /usr/src directory.

Note

BASH version 2.05b, the latest version at the time of this writing, will not build successfully when using the --enable-minimal-config option. This leaves two choices. We can either fix 2.05b by applying the patch posted on news://gnu.bash.bug under the subject, "Compile error in execute_cmd.c with --enable-minimal-config" or we can simply use the 2.05a version.

Build BASH for an i386 CPU with the following commands:

bash# cd /usr/src/bash-2.05a
bash# export CC="gcc -mcpu=i386"
bash# ./configure --enable-static-link \
  --enable-minimal-config --host=i386-pc-linux-gnu
bash# make
bash# strip bash

2.3.11. Copy BASH to the root disk

bash# mkdir /mnt/bin
bash# cp bash /mnt/bin/bash
bash# ln -s bash /mnt/bin/sh

2.3.12. Create device files that BASH needs

bash# mkdir /mnt/dev
bash# mknod /mnt/dev/console c 5 1

2.3.13. Unmount the root disk

bash# cd /
bash# umount /mnt