Listing 7. Makefile to create compressed root file system. The file
           on http://frank.harvard.edu/%7Ecoldwell/diskless was used
           as a template.

##############################################################################
# makefile
##############################################################################
# The idea is to run this makefile from the directory ./default
# by just typing 'make'
#
compress: check
        gzip -c rtfs | dd of=./rootfs.gz

check: copy umount
        e2fsck -f rtfs

copy: newfs mount
        mv root/usr .
        mv root/home .
        cp -a root/* loop0
        mv usr root
        mv home root
        mkdir loop0/usr
        mkdir loop0/home
        cp hosts loop0/etc
        cp fstab loop0/etc
        cp interfaces loop0/etc/network
        rm loop0/etc/hostname || true
        cp machines.LINUX loop0/etc/mpich || true

newfs:
        dd if=/dev/zero of=rtfs bs=1k count=32768
        mke2fs -F -L ROOT rtfs < /dev/null

mount: rtfs
        mount -o loop=/dev/loop0 rtfs loop0

umount:
        umount loop0
# end of file