: "mkbf"
: "	Make a double side boot floppy." 
:
: " This floppy has only enough on them to initialize a wini with enough"
: " stuff to bring the rest of Xenix to the wini."
:
echo -n "Making a double side boot floppy.  Insert the floppy and hit return..."
read dummy
echo
:
: " Figure parameters based on argument."
:
dev=/dev/dxf0
rdev=/dev/rdxf0
size=900
sides=2
:
: " Format track 0, single-density, 128-byte sectors."
: " Install bootstrap (floppy version)."
:
echo "Formatting track 0..."
/etc/format /dev/rsft0
echo "Installing boot..."
/etc/ib215 -r $sides /dev/sft0
:
: " Format the rest of the floppy, 256-byte sectors, double-density."
: " Make a file-system on this part."
:
echo "Formatting rest of disk..."
/etc/format $rdev
echo "Making file system..."
/etc/mkfs $rdev $size
:
: "Copy a bunch of stuff to the floppy..."
:
echo "Mounting floppy on /mnt..."
/etc/mount $dev /mnt
cd /mnt
echo Copying...
mkdir bin etc tmp dev mnt
echo /xenix;          cp /xenix       /mnt
echo /xenix.gen;      cp /xenix.gen   /mnt
echo /bin/cat;        cp /bin/cat     /mnt/bin
echo /bin/chgrp;      cp /bin/chgrp   /mnt/bin
echo /bin/chmod;      cp /bin/chmod   /mnt/bin
echo /bin/chown;      cp /bin/chown   /mnt/bin
echo /bin/cp;         cp /bin/cp      /mnt/bin
echo /bin/echo;       cp /bin/echo    /mnt/bin
echo /bin/ed;         cp /bin/ed      /mnt/bin
echo /bin/fsck;       cp /bin/fsck    /mnt/bin
echo /bin/ln;         cp /bin/ln      /mnt/bin
echo /bin/ls;         cp /bin/ls      /mnt/bin
ln /mnt/bin/ls /mnt/bin/l
echo /bin/fsck;       cp /bin/fsck    /mnt/bin
echo /bin/make;       cp /bin/make    /mnt/bin
echo /bin/mkdir;      cp /bin/mkdir   /mnt/bin
echo /bin/mv;         cp /bin/mv      /mnt/bin
echo /bin/pwd;        cp /bin/pwd     /mnt/bin
echo /bin/expr;        cp /bin/expr    /mnt/bin
echo /bin/rm;         cp /bin/rm      /mnt/bin
echo /bin/sh;         cp /bin/sh      /mnt/bin
echo /bin/stty;       cp /bin/stty    /mnt/bin
echo /bin/sync;       cp /bin/sync    /mnt/bin
echo /bin/tar;        cp /bin/tar     /mnt/bin
echo /bin/test;       cp /bin/test    /mnt/bin
chmod u-t /mnt/bin/*
echo /etc/b215stage2; cp /etc/b215stage2 /mnt/etc/
echo /etc/firsttime;  cp /etc/firsttime /mnt/etc/
echo /etc/format;     cp /etc/format  /mnt/etc
echo /etc/ib215;      cp /etc/ib215   /mnt/etc
echo /etc/init;       cp /etc/init    /mnt/etc
echo /etc/inir;       ln /mnt/etc/init /mnt/etc/inir
echo /etc/install;    cp /etc/install /mnt/etc
echo /etc/mkbf;       cp /etc/mkbf    /mnt/etc
echo /etc/mkfs;       cp /etc/mkfs    /mnt/etc
echo /etc/mkwini;     cp /etc/mkwini  /mnt/etc
echo /etc/mknod;      cp /etc/mknod   /mnt/etc
echo /etc/mksys;      cp /etc/mksys   /mnt/etc
echo /etc/mount;      cp /etc/mount   /mnt/etc
echo /etc/passwd;	cp /etc/passwd	/mnt/etc
echo /etc/mtab;       >/mnt/etc/mtab
echo /etc/haltsys;    cp /etc/haltsys /mnt/etc
ln /mnt/etc/haltsys /mnt/etc/shutdown
echo /etc/umount;     cp /etc/umount  /mnt/etc
cat >/mnt/.profile <<PROF
stty erase "^h" kill "^x" -tabs
PS1="<bootsys> "        ; export PS1
PATH=:/bin:/etc:/usr/bin:/usr/lib:.:	; export PATH
EXINIT='set term=tvi950'		; export EXINIT
umask 022
echo
echo "  XENIX-86  Release 2.0  Distribution System   (Floppy)"
echo "      (backspace is ^h, erase line is ^x)   "
echo
echo "To format and install wini, type  /etc/mkwini
PROF
:
: "Make device-nodes."
:
echo "Making /dev..."
cd /mnt/dev
cp /dev/makefile .
make standard priam floppy
ln /mnt/$dev /mnt/dev/root
:
: "Finish up."
:
cd /
/etc/umount $dev
echo "Boot floppy completed."
