#!/bin/bash -x # # Create a minimal RootFS that fits on floppy # -------------------------------------------- # # Original Files # -------------- # http://Linux-Boot.net/Boot.Standalone/FD/Floppy.Howto.sh.txt # http://Linux-Boot.net/Boot.Standalone/FD/Floppy.RootFS.sh.txt # # # 21-Jan-05 amo Date-of-Birth # 16-Mar-05 amo Split apart Standalone-BootFloppy-Howto into sections # # # # Sanity Checking -- get the build environment # ============================================ # if [ ! -f Floppy.variables.sh.txt ]; then echo "#" echo "# ERROR: cannot find all the scripts " echo "#" # exit 1 # fi # source Floppy.variables.sh.txt # # # # ======================================================== # Directory Tree for minimum rootFS that runs in /dev/ram # ======================================================== # # CreateRootFS() { # DLoop="/tmp/loop.initrd" MLoop="/mnt/loop" # umount $MLoop # doecho "dd if=/dev/zero of=$DLoop count=8192 bs=1024" doecho "mke2fs -q -j $DLoop" # doecho "mount -o rw,loop $DLoop $MLoop" # doecho "cd $MLoop" echo "#" # # doecho "mkdir boot bin dev etc lib mnt proc sbin tmp usr var" chmod 1777 tmp # # doecho "cp -dpar /lib/libc.* /lib/ld-2.* /lib/ld-linux.* $MLoop/lib" # doecho "cp -dpar $FDEV /dev/ram /dev/ram0 /dev/ram1 /dev/loop0 /dev/loop1 $MLoop/dev" # doecho "cp -dpar /bin/ls /bin/bash /bin/sh /bin/tar $MLoop/bin" doecho "cp -dpar /bin/mount /bin/umount $MLoop/bin" # doecho "cp -dpar /sbin/ifconfig /sbin/route $MLoop/sbin" # # remove the prev copy rm -f $DLoop.gz ; sleep 2 # echo "#" doecho "sync ; gzip -9 $DLoop" echo "#" # doecho "cp -p $DLoop.gz $FMNT/boot/initrd-2.4.29.gz" # umount $MLoop # } # CreateRootFS # # # # =========================================================== # echo "#" echo "# Create a minimum RootFS " echo "#" # CreateRootFS # # # End of file