#!/bin/bash

PATH=/sbin:/usr/sbin:/bin:/usr/bin
HERE=${PWD}

FLOPPY=/dev/fd0
if [ $# = 1 ]
then
	if [ -e $1 ]
	then
		FLOPPY=$1
	else
		echo "Error: Cannot access $1."
		exit 1
	fi
fi

echo "Mounting $FLOPPY..."
mount -o ro $FLOPPY /mnt

echo "Copying all the files to the RAMDISK..."
cd /mnt
cp -a . /

echo "Unmounting $FLOPPY..."
cd ${HERE}
umount $FLOPPY

echo "Uncompressing gzip'ed binaries..."
gunzip --quiet --recursive /

echo "Making links..."
cd /usr/bin
ln elvis ex
ln elvis input
ln elvis vi
ln elvis view
ln grep egrep
ln grep fgrep
ln -s rdev ramsize
ln -s rdev rootflags
ln -s rdev swapdev
ln -s rdev vidmode

mv /etc/passwd.inst /etc/passwd
