next up previous contents index
Next: Building the bootloader Up: Setting up an initial Previous: Building a shell (and   Contents   Index

Bundle the Linux kernel and the initrd

Now, we are ready to collect everything we've just build and carry that bundle to our SEGA Dreamcast. So, we create a single file that will contain the content of the directory $INITRD.

But firstly, we have to chown everything to root:root for avoiding error messages during the boot process.

$ su
# cd INITRD
# chown -R 0.0 *
# cd ..
# dd if=/dev/zero of=initrd.img bs=1k count=4096
# mke2fs -F -v -m0 initrd.img
# mkdir initrd.DIR
# mount -o loop initrd.img initrd.DIR
# (cd INITRD ; tar -cf - .) | (cd initrd.DIR ; tar -xvf -)
# umount initrd.DIR
# gzip -c -9 initrd.img > initrd.bin
# exit

The command mke2fs -f -vm0 initrd.img forces the formatting process even if we're using a file instead of a block device. The option -m0 prohibits the creation of the reserved space for the super user. Now, you've archived everything into one single file.



Christian Berger 2004-10-19