#!/bin/sh # Create the distribution file system # if it exists, delete it if [ -e FS ]; then echo "Removing Old File System" rm -rf FS fi if [ -e FS.gz ]; then echo "Backing up old file system" mv FS.gz attic/_FS.gz fi # create empty space for filesystem - 4.0MB echo "Creating Space for File System" dd if=/dev/zero of=FS bs=1k count=4096 # create ext2 file system w/1500 i-nodes echo "Making new EXT2 File System" mke2fs -m 0 -N 1500 FS -F -q # now mount it echo "Mounting File System in /mnt2" mount -o loop=/dev/loop0 FS /mnt2 # Install packages # get list of packages to install from ./package_list { while read files; do echo "Adding package $files" cp packages/$files /mnt2 cd /mnt2; tar xfz $files; rm $files; cd ~/distro done } < package_list # create the etc/ archive from the local source/etc/ directory if [ -e packages/etc.tgz ]; then echo "Removing old etc/ directory" rm packages/etc.tgz fi echo "Creating etc/ archive" cd source; tar cfz ~/distro/packages/etc.tgz etc/; cd ~/distro; # and install it cp packages/etc.tgz /mnt2 cd /mnt2; tar xfz etc.tgz; rm etc.tgz; cd ~/distro # now unmount the new FS echo "Unmounting File System" sync; sync; umount /mnt2 # and zip it up echo "Ziping up new File System" gzip -9 FS # delete old FS.gz from floppy echo "Removing old File System from floppy" mdel a:FS.gz # and move in new one echo "Installing new File System on floppy" mcopy FS.gz a: echo "File System creation complete."