next up previous contents
Next: Building a Kernel Up: Making Linux Installation Disks Previous: Other Essential Binaries   Contents

Populating the Root File System

The binaries and libraries are already installed in the rootfs directory as well as some support files, such as the key maps and the terminfo file. Now we will complete the root file system. First create the remaining directories in rootfs.

cd $MYBOOT/rootfs
mkdir dev tmp etc proc mnt etc/init.d target usr/scripts

Add the device nodes. We will only add the necessary device nodes: two floppy disks, four IDE hard disks with 8 partitions each, two SCSI hard disk with 8 partitions each, two SCSI CD-ROMs, and four terminals. Further we need some memory related devices and a ram disk. Become root and cd to the dev subdirectory in the myboot/rootfs file system.

mknod fd0 b 2 0
mknod fd1 b 2 1
mknod hda b 3 0
mknod hda1 b 3 1
mknod hda2 b 3 2
mknod hda3 b 3 3
mknod hda4 b 3 4
mknod hda5 b 3 5
mknod hda6 b 3 6
mknod hda7 b 3 7
mknod hda8 b 3 8
mknod hdb b 3 64
mknod hdb1 b 3 65
mknod hdb2 b 3 66
mknod hdb3 b 3 67
mknod hdb4 b 3 68
mknod hdb5 b 3 69
mknod hdb6 b 3 70
mknod hdb7 b 3 71
mknod hdb8 b 3 72
mknod hdc b 22 0
mknod hdc1 b 22 1
mknod hdc2 b 22 2
mknod hdc3 b 22 3
mknod hdc4 b 22 4
mknod hdc5 b 22 5
mknod hdc6 b 22 6
mknod hdc7 b 22 7
mknod hdc8 b 22 8
mknod hdd b 22 64
mknod hdd1 b 22 65
mknod hdd2 b 22 66
mknod hdd3 b 22 67
mknod hdd4 b 22 68
mknod hdd5 b 22 69
mknod hdd6 b 22 70
mknod hdd7 b 22 71
mknod hdd8 b 22 72
mknod sda b 8 0
mknod sda1 b 8 1
mknod sda2 b 8 2
mknod sda3 b 8 3
mknod sda4 b 8 4
mknod sda5 b 8 5
mknod sda6 b 8 6
mknod sda7 b 8 7
mknod sda8 b 8 8
mknod sdb b 8 16
mknod sdb1 b 8 17
mknod sdb2 b 8 18
mknod sdb3 b 8 19
mknod sdb4 b 8 20
mknod sdb5 b 8 21
mknod sdb6 b 8 22
mknod sdb7 b 8 23
mknod sdb8 b 8 24
mknod sr0 b 11 0
mknod sr1 b 11 1
mknod tty c 5 0
mknod console c 5 1
mknod tty1 c 4 1
mknod tty2 c 4 2
mknod tty3 c 4 3
mknod tty4 c 4 4
mknod ram b 1 1
mknod mem c 1 1
mknod kmem c 1 2
mknod null c 1 3
mknod zero c 1 5

Add files in the /etc subdirectory. The init program from busybox works without a login procedure, so the passwd and group files are not really needed. You could of course create single line versions for the root user and group. Even the inittab file is not essential and busybox provides a reasonable default. In our example we do copy the file scripts/inittab from the busybox directory to /etc and make the following changes to it:

I created the file/etc/init.d/rcS, which must have execute permissions.

#!/bin/sh
mount -t proc none /proc

For the time being create a dummy install script /usr/scripts/install_top (remember to make it executable):

#!/bin/sh
dialog --msgbox "This can be your install script" 5 50
exit 0

Make all files in the root file system owned by root:

chown -R 0:0 /home/lennartb/myboot/rootfs

Now we have a complete root file system in a directory. We still need a kernel and a way to boot. Further we need to transfer the file system to a floppy disk.


next up previous contents
Next: Building a Kernel Up: Making Linux Installation Disks Previous: Other Essential Binaries   Contents
Lennart Benschop 2003-07-16