# install1.fs disk 'install'
# Currently, no method for checking to see if the designated disk type is
# already in /etc/disktab. You can edit it out of the file after installation.
PATH
=/sbin
:/bin
:/usr
/bin
:/usr
/sbin
:.
DISKMIN
=`expr $ROOTMIN + $SWAPMIN + 1`
set_arbitrary_defaults
() {
fdisk
/dev
/r
${drivename}d
>fdisk.out
2>fdisk.err
echo "Can't open /dev/r${drivename}d for reading!"
elif [ -s fdisk.err
]; then
echo "Disk doesn't appear to be initialized..."
if [ ! "$cyls_per_disk" ]; then
cyls_per_disk
=`expr "$data" : '[^=]*=\([0-9]*\)'`
tracks_per_cyl
=`expr "$data" : '[^=]*=[^=]*=\([0-9]*\)'`
sects_per_track
=`expr "$data" : '[^=]*=[^=]*=[^=]*=\([0-9]*\)'`
if [ "$got_sysid" ]; then
start_part
=`expr "$data" : '[^0-9]*\([0-9]*\)'`
size_part
=`expr "$data" : '[^0-9]*[0-9]*[^0-9]*\([0-9]*\)'`
extent_part
=`expr $start_part + $size_part`
if [ $extent_part -gt $extent_max ]; then
eval start
${part_id}=$start_part
eval size
${part_id}=$size_part
sysid_cnt
=`expr $sysid_cnt + 1`
elif [ "$part_id" ]; then
sysid
=`expr "$data" : 'sysid \([0-9]*\)'`
sysname
=`expr "$data" : 'sysid[^(]*(\([^)]*\)'`
if [ "$no_part_table" -o "$sysid" = "0" -o \
"$(expr "$data" : '\(<UNUSED>\)')" = "<UNUSED>" ]; then
unused_last_part
=$part_id
if [ "$sysid" = "$OPSYSID" ]; then
elif [ ! "$have_dos_part" -a \
( "$sysid" = "$DOS1_ID" -o \
"$sysid" = "$DOS2_ID" -o "$sysid" = "$DOS3_ID" \
) ]; then
eval sysid
${part_id}=$sysid
eval sysname
${part_id}=\"$sysname\"
part_id
=`expr "$data" : 'The data[^0-9]*\([0-9]*\)'`
beg_cyl
=`expr "$data" : '[ ]*beg[^0-9]*\([0-9]*\)'`
end_cyl
=`expr "$data" : '[ ]*end[^0-9]*\([0-9]*\)'`
part_cnt
=`expr $part_cnt + 1`
elif [ "${beg_cyl}" -gt "${cyls_per_disk}" -o \
"${end_cyl}" -gt "${cyls_per_disk}" ]; then
unused_last_part
=`expr $part_cnt - 1`
if [ ! "$cyls_per_disk" ]; then
# Set existing partiton values as default (adjusting to cylinder boundaries)
eval opsys_size
=\
$size${opsys_part}
eval opsys_start
=\
$start${opsys_part}
[ $opsys_size -eq 50000 ] && opsys_size
=$disksize
opsys_off
=`expr $opsys_start / $cylindersize`
opsys_adjusted
=`expr $opsys_off \* $cylindersize`
if [ $opsys_adjusted -lt $opsys_start -o $opsys_off -eq 0 ]; then
opsys_off
=`expr $opsys_off + 1`
opsys_adjusted
=`expr $opsys_off \* $cylindersize`
opsys_size
=`expr $opsys_size - $opsys_adjusted + $opsys_start`
cyls_per_opsys
=`expr $opsys_size / $cylindersize`
echo -n "Please specify partition to overwrite: [3] "
if [ "$opsys_part" -ge 0 -a "$opsys_part" -le 3 ]; then
echo "Partition must be in the range [0-3]"
if [ "$part_cnt" -gt 0 ]; then
echo "Partition Offset* Size* Name"
echo "--------- ------ ---- ----"
while [ $i -lt $part_cnt ]; do
[ "$psize" -eq 50000 ] && psize
=$disksize
poff
=`expr $pstart / $cylindersize`
padjusted
=`expr $poff \* $cylindersize`
if [ "$padjusted" -lt "$pstart" ]; then
padjusted
=`expr $poff \* $cylindersize`
psize
=`expr $psize - $padjusted + $pstart`
pcyls
=`expr $psize / $cylindersize`
echo " ${pname:-(Unused)}"
echo "* Sizes and offsets are in units of cylinders."
# Case I: >1024 cylinders
if [ $cyls_per_disk -gt 1024 ]; then
echo " WARNING: >1024 cylinders. On some hardware, this prevents"
echo " ${OPSYSTEM} from sharing the disk with other operating systems."
echo -n "Install ${OPSYSTEM} on entire disk, overwriting existing partitions? [n] "
cyls_per_opsys
=${cyls_per_disk}
opsys_part
=${unused_last_part:-3}
echo "If the number of disk cylinders does not exceed 1024, then ${OPSYSTEM}"
echo "can be installed alongside other operating systems on a single disk."
echo "Otherwise, it is system-dependent whether this will work or not."
echo "In the worst case, ${OPSYSTEM} MUST be installed at the beginning of"
echo "the disk, and existing partitions will be lost."
echo "For now, we will assume that >1024 cylinders creates no problems..."
# Case II: no partitions used
if [ $sysid_cnt -eq 0 ]; then
echo " WARNING: partition table is either missing or corrupt."
echo " Existing partitions will be lost."
cyls_per_opsys
=`expr ${cyls_per_disk} - 1`
opsys_part
=${unused_last_part:-3}
# Case IIIa: overwrite an existing 386BSD/NetBSD/FreeBSD partition
elif [ "$have_opsys_part" ]; then
echo "386/Net/FreeBSD partition already exists!"
echo "${OPSYSTEM} cannot be installed alongside an existing BSD partition."
echo -n "Overwrite existing partition? [y] "
opsys_part
=${have_opsys_part}
echo "Installation aborted. Enter \`halt' to halt the machine."
echo "Once the machine has halted, remove the floppy,"
echo "and press any key to reboot."
# Case IIIb: no partitions available
if [ $sysid_cnt -eq $part_cnt -a ! "$have_opsys_part" ]; then
echo "No unused partitions."
echo -n "Install $OPSYSTEM and overwrite the entire disk? [n] "
# don't use first cylinder!
cyls_per_opsys
=`expr $cyls_per_disk - 1`
opsys_part
=${unused_last_part}
# $OPSYSTEM installs at the end of the disk. If the
# beginning of the disk is free but not the end, install fails!
# Assume `fdisk -u' to add $OPSYSTEM in last unused partition for remaining cases
opsys_part
=${unused_last_part}
mb_sect
=`expr 1024 \* 1024 / $bytes_per_sect`
disk_minimum
=`expr $DISKMIN \* $mb_sect`
# Case IV: No room (at end of disk) for mininal install
[ $extent_max -eq 50000 ] && extent_max
=$disksize
disk_remaining
=`expr $disksize - $extent_max`
if [ $disk_remaining -lt $disk_minimum ]; then
echo "Not enough space ($DISKMIN Mb) at end of disk to install $OPSYSTEM."
echo -n "Install FreeBSD and overwrite the entire disk? [n] "
# don't use first cylinder!
cyls_per_opsys
=`expr $cyls_per_disk - 1`
opsys_part
=${unused_last_part}
echo -n "Overwrite an existing partition? [n] "
echo " WARNING: To install ${OPSYSTEM}, you're on your own in figuring"
echo " out where on the disk it will fit without overwriting another"
# Set defaults assuming there is only one partition at end of disk
eval start
=\
$start${extent_max_part}
# don't use first cylinder!
cyls_per_opsys
=`expr $start / $cylindersize - 1`
[ $cyls_per_opsys -lt 0 ] && cyls_per_opsys
=0
# Case V: Room for $OPSYSTEM and partition data okay
opsys_off
=`expr $extent_max / $cylindersize`
opsys_extent
=`expr $opsys_off \* $cylindersize`
[ $opsys_extent -lt $extent_max ] && opsys_off
=`expr $opsys_off + 1`
cyls_per_opsys
=`expr $cyls_per_disk - $opsys_off`
if [ "$RUN_FDISK" = "overwrite" ]; then
# How do you overwrite without explicitly editing each entry?
n
=`expr ${part_cnt:-4} - 1`
fdisk
-u /dev
/r
${drivename}d
<fdisk.
script >/dev
/null
2>&1
elif [ "$RUN_FDISK" ]; then
$RUN_FDISK -${opsys_part:-${unused_last_part:-3}} /dev/r${drivename}d
<<-EOF >/dev/null 2>&1
${opsys_part:-${unused_last_part:-3}}
echo "Welcome to ${OPSYSTEM}."
echo "This program is designed to help put ${OPSYSTEM} on a hard disk with"
echo "at least $DISKMIN Megabytes of free space."
echo "Before starting, it is important to know your hard disk's geometry"
echo "(i.e., number of cylinders, heads and sectors/track). If installing"
echo "${OPSYSTEM} on the same disk as another operating system, then the"
echo "two systems should use the same geometry. In particular, ${OPSYSTEM}'s"
echo "default geometry is inappropriate for MS-DOS. So in this case, the"
echo "DOS geometry should be used instead."
echo "As with anything which modifies a hard drive's contents, this program"
echo "can cause SIGNIFICANT data loss. We strongly recommend making sure"
echo "that the hard drive is backed up before going further with the"
echo "installation process."
echo -n "Proceed with installation? [y] "
echo "Cool! Let's get to it..."
echo "If a mistake is made along the way, don't bail out."
echo "At the end, you have the option of redoing the configuration."
echo "If you really must quit at some point, type <CTRL>+C and"
echo "enter \`halt' at the command prompt, \`#'."
echo "Installation aborted. Enter \`halt' to halt the machine."
echo "Once the machine has halted, remove the floppy,"
echo "and press any key to reboot."
if mount
-u /dev
/fd1
/ ; then
echo "[Please ignore the above error message, that's normal.]"
echo "Oh boy, we're in trouble here: Could not mount floppy read-write."
while [ ! "$verified_install" ]; do # Begin of Big Loop
echo "First, we need to know the drive type. This can be can be one of"
echo "ESDI, SCSI, ST506, or IDE."
echo -n "Drive type? [${type:-IDE}] "
type=${resp:-${type:-IDE}}
echo -n "Does it support AUTOMATIC sector remapping? [y] "
echo "Unknown type. Assuming ST506 with automatic sectoring..."
echo "Disk is of device type $drivetype."
if [ ! "$partition" ]; then
echo "Please wait. Examining device /dev/r${drivename}d..."
echo "Hm - we can't seem to read that drive."
echo -n "Are you sure that $type is the correct type? [n] "
echo "Well, since we can't even open it, there isn't much"
echo "hope for writing a label on it. But you're free"
echo "to give it a try. You need to specify the geometry."
echo "Oops. Let's start again from the top."
echo "Now we want to build a data base entry in /etc/disktab describing"
echo "the geometry of the /dev/$drivename disk. The name of the entry"
echo "should be descriptive of the disk's type and model. For example,"
echo "a Maxtor IDE, model 7080 disk might be named \`maxtor7080'."
echo -n "Disk label name (one word, please)? [${name:-mfr_model}] "
name
=${resp:-${name:-mfr_model}}
echo "${OPSYSTEM} should use the same hard disk geometry as used by other"
echo "operating systems on the hard disk."
echo -n "Number of bytes per disk sector? [${bytes_per_sect:-512}] "
bytes_per_sect
=${resp:-${bytes_per_sect:-512}}
echo -n "Total number of disk cylinders? [${cyls_per_disk:-${DEFCYLN}}] "
cyls_per_disk
=${resp:-${cyls_per_disk:-${DEFCYLN}}}
echo -n "Number of disk heads (i.e., tracks/cylinder)? [${tracks_per_cyl:-${DEFHEAD}}] "
tracks_per_cyl
=${resp:-${tracks_per_cyl:-${DEFHEAD}}}
echo -n "Number of disk sectors (i.e., sectors/track)? [${sects_per_track:-${DEFSECT}}] "
sects_per_track
=${resp:-${sects_per_track:-${DEFSECT}}}
cylindersize
=`expr $sects_per_track \* $tracks_per_cyl`
disksize
=`expr $cylindersize \* $cyls_per_disk`
mb_sect
=`expr 1024 \* 1024 / $bytes_per_sect`
mb_per_disk
=`expr $disksize / $mb_sect`
opsys_cyls_min
=`expr $DISKMIN \* $mb_sect / $cylindersize`
partition
=`expr $cyls_per_opsys \* $cylindersize`
part_offset
=`expr $opsys_off \* $cylindersize`
echo "Disk has a total of $mb_per_disk Mb."
echo "The size of the ${OPSYSTEM} portion of the disk must be at least"
echo "${opsys_cyls_min} cylinders, and should not exceed $(expr $cyls_per_disk - 1) cylinders."
echo "The offset of ${OPSYSTEM} from the beginning of the disk should be at"
echo "For efficiency, partitions begin and end on cylinder boundaries."
echo "If you know the size NN in Megabytes (Mb) of a partition you want, then"
echo "use the following formula to determine the number NC of cylinders to use:"
echo " NC = integer { ( NN * $mb_sect ) / $cylindersize }"
echo -n "Total size of the ${OPSYSTEM} portion of the disk (in cylinders)? [${cyls_per_opsys:-`expr ${cyls_per_disk} - 1`}] "
cyls_per_opsys
=${resp:-${cyls_per_opsys:-`expr ${cyls_per_disk} - 1`}}
partition
=`expr $cyls_per_opsys \* $cylindersize`
if [ $cyls_per_opsys -lt $cyls_per_disk -a ! "$force_offset" ]; then
echo -n "Offset of ${OPSYSTEM} from beginning of disk (in cylinders)? [${opsys_off:-1}] "
opsys_off
=${resp:-${opsys_off:-1}}
echo " WARNING: Existing partitions will be lost. In addition,"
echo " installing at cylinder 0 may cause problems for some disk"
echo " controllers. If the filesystem is corrupted or install"
echo " fails, install at cylinder 1."
cyls_per_opsys
=$cyls_per_disk
part_offset
=`expr $opsys_off \* $cylindersize`
opsys_extent
=`expr $opsys_off + $cyls_per_opsys`
if [ ${opsys_extent} -gt ${cyls_per_disk} ]; then
echo "${OPSYSTEM} Size + Offset cannot exceed ${cyls_per_disk} cylinders."
elif [ ${cyls_per_opsys} -lt ${opsys_cyls_min} ]; then
echo "${OPSYSTEM} requires at least ${opsys_cyls_min} cylinders to install."
if [ "$sect_fwd" = "sf:" ]; then
badspacecyl
=`expr $sects_per_track + 126`
badspacecyl
=`expr $badspacecyl + $cylindersize - 1`
badspacecyl
=`expr $badspacecyl / $cylindersize`
badspacesec
=`expr $badspacecyl \* $cylindersize`
echo -n "Using $badspacesec sectors ($badspacecyl cylinders) for the "
echo "bad144 bad block table"
whats_left
=`expr $partition - $badspacesec`
cyl_left
=`expr $whats_left / $cylindersize`
mb_left
=`expr $whats_left / $mb_sect`
swap_cyls_min
=`expr $SWAPMIN \* $mb_sect / $cylindersize`
root_cyls_max
=`expr ${cyl_left} - ${swap_cyls_min}`
root_cyls_min
=`expr $ROOTMIN \* $mb_sect / $cylindersize`
echo "There are $mb_left Mb ($cyl_left cylinders) to allocate."
echo "The $OPSYSTEM portion of the disk must itself be divided into at least"
echo "two partitions: one for the root filesystem and one for swap. It is a"
echo "good idea to have at least a third (large) $OPSYSTEM partition for the /usr"
echo "The root partition cannot exceed ${root_cyls_max} cylinders. It is usually"
echo "no larger than about 15 Mb ($(expr 15 \* $mb_sect / $cylindersize) cylinders), and sometimes"
echo "as small as $ROOTMIN Mb ($root_cyls_min cylinders)."
if [ ! "$cyls_per_root" ]; then
# set default root partition to 15MB
cyls_per_root
=`expr \( 15 \* $mb_sect \) / $cylindersize`
usr_cyls_max
=`expr ${root_cyls_max} - ${cyls_per_root}`
mb_usr
=`expr ${usr_cyls_max} \* $cylindersize / $mb_sect`
[ $cyls_per_root -gt $root_cyls_max -o $mb_usr -lt $USRMIN ] &&
cyls_per_root
=$root_cyls_max
echo -n "Root partition size (in cylinders)? [${cyls_per_root}] "
cyls_per_root
=${resp:-${cyls_per_root}}
root
=`expr $cyls_per_root \* $cylindersize`
if [ ${cyls_per_root} -gt ${root_cyls_max} ]; then
echo "The root partition size cannot exceed $root_cyls_max cylinders."
elif [ ${cyls_per_root} -lt ${root_cyls_min} ]; then
echo "The root partition size must be at least $root_cyls_min cylinders."
part_used
=`expr $root + $badspacesec`
whats_left
=`expr $partition - $part_used`
cyl_left
=`expr $whats_left / $cylindersize`
mb_left
=`expr $whats_left / $mb_sect`
# DO NOT USE DIFFERENT BLOCKING FACTORS FOR EACH PARITION.. IT TRASHES THE
# VM SYSTEM! When that gets fixed this can go back the way it was...
echo "We can build the filesystems with block/fragment sizes of either"
echo " 1) 4k/512, to save disk space at the expense of speed, or"
echo " 2) 8k/1k for speed at the expense of disk space."
echo -n "Which blocking factor should we use for the filesystems? "
echo -n "[${blocking_factor:-${DEFBLOCKING}}] "
blocking_factor
=${resp:-${blocking_factor:-${DEFBLOCKING}}}
fragsize
=`expr $bytes_per_sect \* $blocking_factor`
blocksize
=`expr $bytes_per_sect \* $blocking_factor \* 8`
echo "$mb_left Mb ($cyl_left cylinders) remaining in ${OPSYSTEM} portion of disk."
echo "Minimum swap space is ${swap_cyls_min} cylinders."
echo "For running X, if your RAM size is NR Mb, then the recomended swap"
echo "size NS (in cylinders) is:"
echo " NS = integer { ( NR x `expr 21 \* $mb_sect / 10` ) / ${cylindersize} }"
if [ ! "$swap_cyl" ]; then
swap_cyl
=`expr \( 21 \* $mb_ram \* $mb_sect \) / 10`
swap_cyl
=`expr $swap_cyl / ${cylindersize}`
# but not swap size more than 10% of disk size...
swap_quot
=`expr $mb_left / $mb_ram`
if [ $swap_quot -lt 10 ]; then
echo -n "Swap partition size (in cylinders)? [${swap_cyl}] "
swap_cyl
=${resp:-${swap_cyl}}
swap
=`expr $swap_cyl \* $cylindersize`
if [ ${swap_cyl} -gt ${cyl_left} ]; then
echo "Swap size cannot exceed $cyl_left cylinders."
elif [ ${swap_cyl} -lt ${swap_cyls_min} ]; then
echo "Swap size must be at least ${swap_cyls_min} cylinders."
swap_offset
=`expr $root_offset + $root`
part_used
=`expr $part_used + $swap`
echo "$name|${OPSYSTEM} installation generated:\\" >>/etc
/disktab
echo " :dt=${type}:ty=winchester:\\" >>/etc
/disktab
echo -n " :nc#${cyls_per_disk}:ns#${sects_per_track}" >>/etc
/disktab
echo ":nt#${tracks_per_cyl}:\\" >>/etc
/disktab
echo " :se#${bytes_per_sect}:${sect_fwd}\\" >>/etc
/disktab
echo -n " :pa#${root}:oa#${root_offset}" >>/etc
/disktab
echo ":ta=4.2BSD:ba#${blocksize}:fa#${fragsize}:\\" >>/etc
/disktab
echo " :pb#${swap}:ob#${swap_offset}:tb=swap:\\" >>/etc
/disktab
echo " :pc#${partition}:oc#${part_offset}:\\" >>/etc
/disktab
ename
="";fname
="";gname
="";hname
=""
if [ $part_used -lt $partition ]; then
echo "Now we enter information about any other partitions and filesystems"
echo "to be created in the ${OPSYSTEM} portion of the disk. This process"
echo "is complete when we've filled up all remaining space in the ${OPSYSTEM}"
echo "portion of the disk."
while [ $part_used -lt $partition ]; do
whats_left
=`expr $partition - $part_used`
cyl_left
=`expr $whats_left / $cylindersize`
mb_left
=`expr $whats_left / $mb_sect`
echo "$mb_left Mb ($cyl_left cylinders) remaining in ${OPSYSTEM} portion of disk."
echo -n "Next partition size (in cylinders)? [${cyl_left}] "
part_size
=${resp:-${cyl_left}}
part_size
=`expr $part_size \* $cylindersize`
total
=`expr $part_used + $part_size`
if [ $total -gt $partition ]; then
echo "Partition size cannot exceed ${cyl_left} cylinders."
while [ "$part_name" = "" ]; do
echo -n "On which directory should this filesystem be mounted? [usr] "
part_name
=`expr X"$part_name" : 'X/*\(.*\)'`
offset
=`expr $part_offset + $root + $swap`
echo -n " :pe#${part_size}:oe#${offset}" >>/etc
/disktab
echo ":te=4.2BSD:be#${blocksize}:fe#${fragsize}:\\" >>/etc
/disktab
offset
=`expr $offset + $part_size`
elif [ ! "$fname" ]; then
echo -n " :pf#${part_size}:of#${offset}" >>/etc
/disktab
echo ":tf=4.2BSD:bf#${blocksize}:ff#${fragsize}:\\" >>/etc
/disktab
offset
=`expr $offset + $part_size`
elif [ ! "$gname" ]; then
echo -n " :pg#${part_size}:og#${offset}" >>/etc
/disktab
echo ":tg=4.2BSD:bg#${blocksize}:fg#${fragsize}:\\" >>/etc
/disktab
offset
=`expr $offset + $part_size`
elif [ ! "$hname" ]; then
echo -n " :ph#${part_size}:oh#${offset}" >>/etc
/disktab
echo ":th=4.2BSD:bh#${blocksize}:fh#${fragsize}:\\" >>/etc
/disktab
if [ "$have_dos_part" -a "$have_dos_part" != "$opsys_part" -a \
"$RUN_FDISK" != "overwrite" -a ! "$hname" ]; then
echo "There appears to be a MS-DOS filesystem on the hard disk."
echo -n "Make this be accessible from ${OPSYSTEM}? [y] "
while [ "$part_name" = "" ]; do
echo -n "On which directory should this filesystem be mounted? [dos] "
part_name
=`expr X"$part_name" : 'X/*\(.*\)'`
eval offset
=\
$start${have_dos_part}
eval part_size
=\
$size${have_dos_part}
echo -n " :ph#${part_size}:oh#${offset}" >>/etc
/disktab
echo ":th=MSDOS:\\" >>/etc
/disktab
echo " :pd#${disksize}:od#0:" >>/etc
/disktab
echo -n "Verbose installation? [n] "
echo "THIS IS THE LAST CHANCE!!! Data on the hard disk will be lost!"
echo -n "Are you sure you want to install on the hard drive? (yes/no) "
echo -n "Would you like to change the configuration? [y] "
echo "Installation aborted. Enter 'halt' to halt the machine."
echo "Once the machine has halted, remove the floppy,"
echo "and press any key to reboot."
echo "Please spell out either of \`yes' or \`no'..."
echo -n "Install on the hard disk? (yes/no) "
echo -n "Labelling disk..."
/sbin
/disklabel
-w -r ${drivename} $name /usr/mdec/${drivetype}boot /usr/mdec/boot${drivetype} >/dev
/null
2>&1
# XXX - Do it again, incase we disklabeled sector 0!
if [ "$sect_fwd" = "sf:" ]; then
echo -n "Initializing bad144 badblock table..."
echo "Updating badblock table..."
# `2>&1 >/dev/null' filters stdout and leaves only stderr...
badlist
=$
(bad144
-s $drivename 2>&1 >/dev
/null |
bad_seek
=$
(expr "$data" : '[^(]*(seek)[^0-9]*\([0-9]*\)')
bad_read
=$
(expr "$data" : '[^(]*(read)[^0-9]*\([0-9]*\)')
[ "$bad_seek" -o "$bad_read" ] && echo -n "$bad_seek $bad_read "
[ "$badlist" ] && bad144
-a -c $drivename "$badlist"
echo "Initializing root filesystem, and mounting..."
newfs
${rotdelay} /dev
/r
${drivename}a
$name
mount
-v /dev
/${drivename}a
/mnt
if [ "$ename" != "" ]; then
echo "Initializing $ename filesystem, and mounting..."
newfs
${rotdelay} /dev
/r
${drivename}e
$name
mount
-v /dev
/${drivename}e
/mnt
/$ename
if [ "$fname" != "" ]; then
echo "Initializing $fname filesystem, and mounting..."
newfs
${rotdelay} /dev
/r
${drivename}f
$name
mount
-v /dev
/${drivename}f
/mnt
/$fname
if [ "$gname" != "" ]; then
echo "Initializing $gname filesystem, and mounting..."
newfs
${rotdelay} /dev
/r
${drivename}g
$name
mount
-v /dev
/${drivename}g
/mnt
/$gname
if [ "$hname" != "" ]; then
if [ ! "$have_dos_part" ]; then
echo "Initializing $hname filesystem, and mounting..."
newfs
${rotdelay} /dev
/r
${drivename}h
$name
echo "Initializing $hname filesystem..."
[ ! "$have_dos_part" ] &&
mount
-v /dev
/${drivename}h
/mnt
/$hname
echo "Please wait. Copying to disk..."
# cat filelist | cpio -pdamu${cpioverbose} /mnt
done <filelist |
cpio -pdamu${cpioverbose} /mnt
echo "proc /proc procfs rw 0 0" >etc
/fstab
echo "/dev/${drivename}b none swap sw 0 0" >>etc
/fstab
echo "/dev/${drivename}a / ufs rw 1 1" >>etc
/fstab
if [ "$ename" != "" ]; then
echo "/dev/${drivename}e /$ename ufs rw 1 2" >>etc
/fstab
if [ "$fname" != "" ]; then
echo "/dev/${drivename}f /$fname ufs rw 1 3" >>etc
/fstab
if [ "$gname" != "" ]; then
echo "/dev/${drivename}g /$gname ufs rw 1 4" >>etc
/fstab
if [ "$hname" != "" ]; then
if [ ! "$have_dos_part" ]; then
echo "/dev/${drivename}h /$hname ufs rw 1 5" >>etc
/fstab
echo "/dev/${drivename}h /$hname pcfs rw 0 0" >>etc
/fstab
# cat /etc/disktab >etc/disktab.install
done </etc
/disktab
>etc
/disktab.
install
echo "PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/distbin:.:"
echo "echo \"Insert cpio installation floppy in drive and\""
echo "echo -n \"enter that drive's number (0 or 1): [0] \""
echo "driveno=\${resp:-0}"
echo "mount -o ro /dev/fd\${driveno} /mnt"
echo "umount /mnt >/dev/null 2>&1"
echo "echo -n \"Install optional dos floppy? [n] \""
echo "case \"\$resp\" in"
echo " echo \"Remove cpio floppy from drive, insert dos floppy, and\""
echo " echo -n \"enter that drive's number (0 or 1): [0] \""
echo " driveno=\${resp:-0}"
echo " mount -t pcfs -o ro /dev/fd\${driveno} /mnt"
echo " mkdir -p /usr/distbin"
echo " cp /mnt/* /usr/distbin/ >/dev/null 2>&1"
echo " umount /mnt >/dev/null 2>&1"
echo "echo \"OK. All of the base files are installed.\""
echo "echo \"The next step: reboot from the hard disk. Further\""
echo "echo \"instructions are presented upon rebooting.\""
echo "echo \"Enter 'halt' now at the prompt to halt the machine.\""
echo "echo \"After the machine has halted, remove the floppy from the disk\""
echo "echo \"drive, and hit any key to reboot from the hard disk.\""
echo "The next step: reboot from the kernel-copy disk, copy a kernel"
echo "to the hard disk, and finally reboot from the hard disk."
echo "To do this, enter \`halt' now to halt the machine. After it"
echo "announces that it has halted, remove the floppy from the drive"
echo "and insert the kernel-copy disk that was booted before."
echo "Press any key to reboot. When prompted to insert the filesystem"
echo "floppy this time, just hit RETURN without changing floppies."
echo "If all goes well, you can enter the command \`copy' at the prompt to"
echo "copy the kernel to the hard disk. When asked for which partition to"
echo "copy to, enter to \`${drivename}a' (without the quotes)."
echo "Okay, that's all for now. I'm waiting for you to enter \`halt'..."