: "mkwini.flop"
: "	Make the wini from a boot-floppy."
:
:
: "After making the wini in this way, the tar-backup floppies should be"
: "brought in one at a time."
:
: "Check arguments."
:
	wini="w0"
	boot="-W"
	fmt="-b -l 2549 -i 6"
	rootsize=6000
	restsize=23400
:
:
: "Set up device-variables."
:
	track0=/dev/${wini}t0
	rtrack0=/dev/r${wini}t0
	root=/dev/${wini}a
	rroot=/dev/r${wini}a
	swap=/dev/${wini}b
	rswap=/dev/r${wini}b
	rest=/dev/${wini}c
	rrest=/dev/r${wini}c
:
: "Format the wini && install the boostrap (wini version)."
:
echo -n "About to initialize wini. OK? "
read ans
if test A$ans = Ay; then

	echo "Formatting Winchester..."
	/etc/format $fmt $rtrack0
	/etc/ib215 $boot $track0
:
: "Make root and remainder file systems."
:
	echo "Making root file-system..."
	/etc/mkfs $rroot $rootsize 1 60
	echo "Making remainder file-system..."
	/etc/mkfs $rrest $restsize 1 60
else
	echo "install new bootstrap"
	/etc/ib215 $boot $track0
fi
:
: "Copy the floppy contents to the Wini."
:
echo "Mounting" $root "on /mnt...";	/etc/mount $root /mnt
umask 022
echo "Copying..."
cd /mnt
mkdir bin etc tmp dev mnt lib usr sys lost+found
cat >/mnt/.profile <<PROFILE
stty erase "^h" kill "^x" -tabs
PROFILE
echo "/xenix...";	cp /xenix /xenix.gen	/mnt
echo "/bin...";		cp /bin/*	/mnt/bin
PATH=/mnt/bin:/bin:/etc:.:      ; export PATH
echo "/etc...";		cp /etc/*	/mnt/etc
cd /mnt/lost+found
for J in 0 1 2 3 4 5 6 7 8 9; do
>$J
done
rm ?
:
: "Make device-nodes."
:
echo "Making /dev..."
cd /mnt/dev
cp /dev/makefile .
make standard priam priamroot floppy sbc534 sbc544 lp
:
: "Finish up."
:
cd /
/etc/umount $root
sync
sync
echo "/etc/haltsys and reboot xenix from wini."
