Listing 1
#
# Script to Make a bootable 3.5"
# Coherent 4.0 floppy diskette
#
# by David M. Knight, August 1992
#
# ----------------------------------
# List of Necessary files, per
# Lexicon "booting" entry, plus a
# few others useful for disaster
# recovery.
#
FL="/coherent
/bin/sh
/bin/sync
/etc/init
/etc/drvld.all
/etc/drvld
/etc/fsck
/etc/mkfs
/etc/mknod
/etc/mount
/etc/termcap
/etc/umount
/bin/cat
/bin/cp
/bin/cpdir
/bin/chroot
/bin/chown
/bin/chgrp
/bin/chmod
/bin/echo
/bin/find
/bin/ls
/bin/mkdir
/bin/pwd
/bin/rmdir
/bin/rm
/usr/bin/tar
/usr/bin/vi
"
set -xv
# just in case FD is mounted
/etc/umount /dev/fva0
# Prepare the diskette
fdformat /dev/rfd0
mkfs /dev/fva0 2880
# Copy the boot block
cp /conf/boot.fva /dev/fva0
#
# mount FD filesystem for the rest
#
/etc/mount /dev/fva0 /f0
# "tertiary boot" program
cp /tboot /f0
(cd /f0
mkdir bin etc conf conf/kbd usr
mkdir tmp mnt usr/bin usr/tmp
)
for nn in $FL
do
cp $nn /f0$nn
done
(cd /f0
ln coherent autoboot
ln usr/bin/tar usr/bin/cpio
)
cp /conf/kbd/* /f0/conf/kbd
cp /drv/* /f0/drv
cpdir /dev /f0/dev
#
# patch floppy kernel for 3.5"
# root drive
#
/conf/patch /f0/coherent \
rootdev=makedev\(4,15\)
/conf/patch /f0/coherent \
pipedev=makedev\(4,15\)
#
# add ramroot script to /f0
#
cat >/f0/ramroot << EOM
#
# ramroot - Shell Script
#
# Create, initialize and switch
# over to a RAMDRIVE root FS
# so that the (boot) floppy drive
# can be used for backup/restore
# diskettes.
#
/bin/rmdir ramdisk 2> /dev/null
/bin/rm /dev/ram0 /dev/rram0
/etc/mknod /dev/ram0 b 8 16
/etc/mknod /dev/rram0 c 8 16
/etc/mkfs /dev/ram0 2048
/bin/mkdir /ramdisk
/etc/mount /dev/ram0 /ramdisk
/bin/cpdir -sramdisk -v / /ramdisk
/bin/echo "RAMdrive root FS installed.
REMOVE BOOT FLOPPY NOW.
To run fsck on harddisk root FS enter:
fsck /dev/root
To mount harddrive root FS at /mnt:
mount /dev/root /mnt
After restoring files to the root FS,
you MUST:
umount /dev/root
before rebooting or the HD root FS
will be trashed!
"
TERM=ansipc
export TERM
/bin/chroot /ramdisk /bin/sh
EOM
chmod +x /f0/ramroot
#
# force single-user boot with
# /etc/brc exit code != 0
#
echo ":
/etc/drvld.all
echo \"SINGLE USER MODE - Commands:
ramroot - create and switch over to
RAMdrive root filesystem.
mount /dev/root /mnt - mounts HD root
filesystem at /mnt.
tar or cpio to backup/restore \"
exit 1" > /f0/etc/brc
chmod +x /f0/etc/brc
#
# ESSENTIAL LAST STEP
#
/etc/umount /dev/fva0
|