3.3. Construction

This section is written using ramdisk seven (/dev/ram7) to build the root image. There is nothing particularly special about ramdisk seven and it is possible to use any of the other available ramdisks provided they are not already in use.

3.3.1. Create a ramdisk

bash# dd if=/dev/zero of=/dev/ram7 bs=1k count=4096
bash# mke2fs -m0 /dev/ram7
bash# mount /dev/ram7 /mnt

3.3.2. Rebuild the BASH shell

bash# cd /usr/src/bash-2.05a
bash# make distclean
bash# ./configure --enable-minimal-config --host=i386-pc-linux-gnu
bash# make
bash# strip bash

3.3.3. Determine which libraries are required

bash# ldd bash

Note the output from the ldd command. It will most likely show that these library files are required for BASH: /lib/libdl.so.2, /lib/libc.so.6 & /lib/ld-linux.so.2

3.3.4. Copy BASH and its libraries to the ramdisk

bash# mkdir /mnt/bin
bash# cp bash /mnt/bin
bash# ln -s bash /mnt/bin/sh
bash# mkdir /mnt/lib
bash# cp /lib/libdl.so.2 /mnt/lib
bash# cp /lib/libc.so.6 /mnt/lib
bash# cp /lib/ld-linux.so.2 /mnt/lib

3.3.5. Create a console device

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

3.3.6. Compress the ramdisk image

bash# umount /dev/ram7
bash# dd if=/dev/ram7 of=~/phase2-image bs=1k
bash# gzip -9 ~/phase2-image

3.3.7. Copy the compressed image to diskette

Insert the floppy labeled "root disk" into drive fd0.

bash# dd if=~/phase2-image.gz of=/dev/fd0 bs=1k