1993-08-11 04:06:14 +02:00
|
|
|
#!/bin/sh
|
1993-08-31 17:02:53 +02:00
|
|
|
# filesystem-floppy disk /install
|
|
|
|
# Simplified, interactive *BSD installation script.
|
1993-08-11 04:06:14 +02:00
|
|
|
# D.E. Silvia (dsilvia@net.com)
|
|
|
|
#
|
1993-08-31 17:02:53 +02:00
|
|
|
# Heavily hacked on by cgd and rwgrimes and miscilanious times
|
|
|
|
# comments here are brief to save disk space!
|
1993-08-11 04:06:14 +02:00
|
|
|
#
|
1993-08-11 14:30:00 +02:00
|
|
|
OPSYSTEM=FreeBSD
|
1993-08-26 05:16:51 +02:00
|
|
|
DEFBLOCKING=2
|
1993-08-31 17:02:53 +02:00
|
|
|
DEFSECT=17
|
|
|
|
DEFHEAD=12
|
|
|
|
DEFCYLN=1024
|
1993-08-11 04:06:14 +02:00
|
|
|
|
1993-08-31 17:02:53 +02:00
|
|
|
echo "Welcome to ${OPSYSTEM}."
|
|
|
|
echo ""
|
|
|
|
echo "This program is designed to help put ${OPSYSTEM} on a hard disk,"
|
|
|
|
echo "in a simple and rational way. We'll ask you several questions,"
|
|
|
|
echo "and it would probably be useful to have a disk's hardware"
|
1993-08-11 04:06:14 +02:00
|
|
|
echo "manual, the installation notes, and a calculator handy."
|
1993-08-31 17:02:53 +02:00
|
|
|
echo ""
|
1993-08-20 19:17:04 +02:00
|
|
|
echo "In particular, we need to know some reasonably detailed"
|
|
|
|
echo "information about the disk's geometry, because there is currently"
|
|
|
|
echo "no way we can figure out this information by ourselves."
|
1993-08-31 17:02:53 +02:00
|
|
|
echo ""
|
1993-08-20 19:17:04 +02:00
|
|
|
echo "As with anything which modifies a hard drive's contents, this"
|
|
|
|
echo "program can cause SIGNIFICANT data loss, and we strongly recommend"
|
|
|
|
echo "making sure that the hard drive is backed up before going further with"
|
|
|
|
echo "the installation process."
|
1993-08-31 17:02:53 +02:00
|
|
|
echo ""
|
1993-08-20 19:17:04 +02:00
|
|
|
echo -n "Proceed with installation? [y] "
|
|
|
|
read resp junk
|
|
|
|
if [ "$resp" = "" ]; then
|
|
|
|
resp=y
|
|
|
|
fi
|
1993-08-11 04:06:14 +02:00
|
|
|
case $resp in
|
|
|
|
y*|Y*)
|
1993-08-20 19:17:04 +02:00
|
|
|
echo
|
1993-08-31 17:02:53 +02:00
|
|
|
echo "Cool! Let's get to it..."
|
1993-08-20 20:07:39 +02:00
|
|
|
echo ""
|
|
|
|
echo "If a mistake is made along the way, don't bail out."
|
|
|
|
echo "At the end, you have the option to redo the configuration."
|
|
|
|
echo "If you really must bail out at some point, then type <CTRL>+C,"
|
|
|
|
echo "and enter \`halt' at the command prompt \`#'."
|
1993-08-11 04:06:14 +02:00
|
|
|
;;
|
|
|
|
*)
|
1993-08-31 17:02:53 +02:00
|
|
|
echo ""
|
|
|
|
echo "OK, then enter 'halt' to halt the machine."
|
|
|
|
echo "Once the machine has halted, remove the floppy,"
|
|
|
|
echo "and press any key to reboot."
|
1993-08-11 04:06:14 +02:00
|
|
|
exit
|
|
|
|
;;
|
|
|
|
esac
|
1993-08-11 14:30:00 +02:00
|
|
|
|
1993-08-20 20:07:39 +02:00
|
|
|
verified_install=""
|
|
|
|
while [ "$verified_install" = "" ]; do # Begin of Big Loop
|
|
|
|
|
1993-08-11 14:30:00 +02:00
|
|
|
rotdelay=""
|
|
|
|
drivename=wd0
|
|
|
|
drivetype=wd
|
|
|
|
sect_fwd=""
|
1993-08-31 17:02:53 +02:00
|
|
|
echo ""
|
|
|
|
echo "First, we need to know the drive type. This can be can be one of"
|
1993-08-20 19:17:04 +02:00
|
|
|
echo "ESDI, SCSI, ST506, or IDE."
|
|
|
|
echo -n "Drive type? [IDE] "
|
|
|
|
read type junk
|
|
|
|
if [ "$type" = "" ]; then
|
|
|
|
type=IDE
|
|
|
|
fi
|
1993-08-11 04:06:14 +02:00
|
|
|
case "$type" in
|
1993-08-20 19:17:04 +02:00
|
|
|
e*|E*|st*|ST*)
|
1993-08-31 17:02:53 +02:00
|
|
|
echo
|
1993-08-11 04:06:14 +02:00
|
|
|
echo -n "Does it support _automatic_ sector remapping? [y] "
|
1993-08-20 19:17:04 +02:00
|
|
|
read remap junk
|
1993-08-11 04:06:14 +02:00
|
|
|
case "$remap" in
|
|
|
|
n*|N*)
|
|
|
|
sect_fwd="sf:"
|
|
|
|
;;
|
|
|
|
esac
|
1993-08-31 17:02:53 +02:00
|
|
|
case "$type" in
|
|
|
|
e*|E*)
|
|
|
|
DEFSECT=36
|
|
|
|
;;
|
|
|
|
esac
|
1993-08-11 04:06:14 +02:00
|
|
|
;;
|
1993-08-20 19:17:04 +02:00
|
|
|
i*|I*)
|
1993-08-11 04:06:14 +02:00
|
|
|
type=ST506
|
1993-08-31 17:02:53 +02:00
|
|
|
rotdelay="-d 0"
|
1993-08-11 04:06:14 +02:00
|
|
|
;;
|
1993-08-20 19:17:04 +02:00
|
|
|
sc*|SC*)
|
1993-08-11 04:06:14 +02:00
|
|
|
drivename=sd0
|
|
|
|
drivetype=sd
|
|
|
|
type=SCSI
|
1993-08-11 14:30:00 +02:00
|
|
|
rotdelay="-d 0"
|
1993-08-31 17:02:53 +02:00
|
|
|
DEFSECT=32
|
|
|
|
DEFHEAD=64
|
1993-08-11 04:06:14 +02:00
|
|
|
;;
|
1993-08-20 19:17:04 +02:00
|
|
|
*)
|
|
|
|
echo "Unknown type. Assuming ST506 with automatic sectoring..."
|
|
|
|
type=ST506
|
|
|
|
;;
|
1993-08-11 04:06:14 +02:00
|
|
|
esac
|
1993-08-31 17:02:53 +02:00
|
|
|
echo ""
|
|
|
|
echo "Disk is of device type $drivetype."
|
|
|
|
echo "Installing on device /dev/$drivename..."
|
|
|
|
echo ""
|
1993-08-20 19:17:04 +02:00
|
|
|
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)? [mfr_model] "
|
|
|
|
read name junk
|
|
|
|
if [ "$name" = "" ]; then
|
|
|
|
name=mfr_model
|
|
|
|
fi
|
1993-08-11 04:06:14 +02:00
|
|
|
echo ""
|
|
|
|
echo -n "Number of bytes per disk sector? [512] "
|
1993-08-20 23:47:42 +02:00
|
|
|
read bytes_per_sect junk
|
1993-08-11 04:06:14 +02:00
|
|
|
if [ "$bytes_per_sect" = "" ]; then
|
|
|
|
bytes_per_sect=512
|
|
|
|
fi
|
|
|
|
echo ""
|
1993-08-31 17:02:53 +02:00
|
|
|
echo -n "Total number of disk cylinders? [$DEFCYLN] "
|
1993-08-20 23:47:42 +02:00
|
|
|
read cyls_per_disk junk
|
1993-08-20 19:17:04 +02:00
|
|
|
if [ "$cyls_per_disk" = "" ]; then
|
1993-08-31 17:02:53 +02:00
|
|
|
cyls_per_disk=$DEFCYLN
|
1993-08-20 19:17:04 +02:00
|
|
|
fi
|
1993-08-11 04:06:14 +02:00
|
|
|
echo ""
|
1993-08-31 17:02:53 +02:00
|
|
|
echo -n "Number of disk heads (i.e., tracks/cylinder)? [$DEFHEAD] "
|
1993-08-20 23:47:42 +02:00
|
|
|
read tracks_per_cyl junk
|
1993-08-20 19:17:04 +02:00
|
|
|
if [ "$tracks_per_cyl" = "" ]; then
|
1993-08-31 17:02:53 +02:00
|
|
|
tracks_per_cyl=$DEFHEAD
|
1993-08-20 19:17:04 +02:00
|
|
|
fi
|
1993-08-11 04:06:14 +02:00
|
|
|
echo ""
|
1993-08-31 17:02:53 +02:00
|
|
|
echo -n "Number of disk sectors (i.e., sectors/track)? [$DEFSECT] "
|
1993-08-20 23:47:42 +02:00
|
|
|
read sects_per_track junk
|
1993-08-20 19:17:04 +02:00
|
|
|
if [ "$sects_per_track" = "" ]; then
|
1993-08-31 17:02:53 +02:00
|
|
|
sects_per_track=$DEFSECT
|
1993-08-20 19:17:04 +02:00
|
|
|
fi
|
1993-08-11 04:06:14 +02:00
|
|
|
echo ""
|
|
|
|
cylindersize=`expr $sects_per_track \* $tracks_per_cyl`
|
|
|
|
disksize=`expr $cylindersize \* $cyls_per_disk`
|
1993-08-20 19:17:04 +02:00
|
|
|
mb_sect=`expr 1024 \* 1024 / $bytes_per_sect`
|
|
|
|
mb_per_disk=`expr $disksize / $mb_sect`
|
|
|
|
echo "Disk has a total of $mb_per_disk Mb."
|
1993-08-20 23:47:42 +02:00
|
|
|
echo "It must be divided into at least two partitions: one for the root"
|
|
|
|
echo "filesystem and one for swap. In addition, it is a very good idea to"
|
|
|
|
echo "have at least a third partition for the /usr filesystem."
|
|
|
|
echo ""
|
1993-08-20 19:17:04 +02:00
|
|
|
echo "For greater efficiency, partitions should begin and end on cylinder"
|
1993-08-20 23:47:42 +02:00
|
|
|
echo "boundaries. If you know the size NN in Megabytes (Mb) of a partition"
|
|
|
|
echo "you want, then use the following formula to determine the number NC of"
|
|
|
|
echo "cylinders to use:"
|
1993-08-31 17:02:53 +02:00
|
|
|
echo " NC = integer { ( NN * $mb_sect ) / $cylindersize }"
|
1993-08-20 19:17:04 +02:00
|
|
|
echo -n "Total size of the ${OPSYSTEM} portion of the disk (in cylinders)? [${cyls_per_disk}] "
|
|
|
|
read partition junk
|
|
|
|
if [ "$partition" = "" ]; then
|
|
|
|
partition=$cyls_per_disk
|
|
|
|
fi
|
|
|
|
partition=`expr $partition \* $cylindersize`
|
1993-08-11 04:06:14 +02:00
|
|
|
part_offset=0
|
|
|
|
if [ $partition -lt $disksize ]; then
|
1993-08-20 19:17:04 +02:00
|
|
|
echo ""
|
|
|
|
echo -n "Offset from beginning of the disk of first ${OPSYSTEM} partition (in cylinders)? [0] "
|
|
|
|
read part_offset junk
|
|
|
|
if [ "$part_offset" = "" ]; then
|
|
|
|
part_offset=0
|
|
|
|
fi
|
|
|
|
echo $part_offset
|
1993-08-11 04:06:14 +02:00
|
|
|
fi
|
1993-08-20 19:17:04 +02:00
|
|
|
part_offset=`expr $part_offset \* $cylindersize`
|
1993-08-11 04:06:14 +02:00
|
|
|
badspacesec=0
|
|
|
|
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 ""
|
|
|
|
echo -n "Using $badspacesec sectors ($badspacecyl cylinders) for the "
|
|
|
|
echo "bad144 bad block table"
|
|
|
|
fi
|
|
|
|
whats_left=`expr $partition - $badspacesec`
|
|
|
|
cyl_left=`expr $whats_left / $cylindersize`
|
1993-08-20 19:17:04 +02:00
|
|
|
mb_left=`expr $whats_left / $mb_sect`
|
1993-08-11 04:06:14 +02:00
|
|
|
echo ""
|
1993-08-20 23:47:42 +02:00
|
|
|
echo "There are $mb_left Mb ($cyl_left cylinders) to allocate."
|
1993-08-11 04:06:14 +02:00
|
|
|
echo ""
|
1993-08-20 19:17:04 +02:00
|
|
|
# set default root partition to 15MB
|
1993-08-31 17:02:53 +02:00
|
|
|
part_size=`expr \( 15 \* $mb_sect \) / $cylindersize`
|
1993-08-20 19:17:04 +02:00
|
|
|
if [ $part_size -gt $cyl_left ]; then
|
|
|
|
part_size=$cyl_left
|
|
|
|
fi
|
1993-08-20 23:47:42 +02:00
|
|
|
echo "The root partition is usually no larger than about 15 Mb, and sometimes"
|
|
|
|
echo "as small as 7 or 8 Mb."
|
1993-08-11 04:06:14 +02:00
|
|
|
root=0
|
|
|
|
while [ $root -eq 0 ]; do
|
1993-08-20 19:17:04 +02:00
|
|
|
echo -n "Root partition size (in cylinders)? [${part_size}] "
|
1993-08-20 23:47:42 +02:00
|
|
|
read root junk
|
1993-08-20 19:17:04 +02:00
|
|
|
if [ "$root" = "" ]; then
|
|
|
|
root=$part_size
|
|
|
|
fi
|
1993-08-11 04:06:14 +02:00
|
|
|
case $root in
|
|
|
|
[1-9]*)
|
1993-08-20 19:17:04 +02:00
|
|
|
root=`expr $root \* $cylindersize`
|
1993-08-11 04:06:14 +02:00
|
|
|
total=$root
|
|
|
|
if [ $total -gt $whats_left ]; then
|
|
|
|
echo Total is greater than remaining free space
|
|
|
|
root=0
|
|
|
|
else
|
|
|
|
part_used=`expr $root + $badspacesec`
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
root=0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
root_offset=$part_offset
|
|
|
|
whats_left=`expr $partition - $part_used`
|
1993-08-20 19:17:04 +02:00
|
|
|
cyl_left=`expr $whats_left / $cylindersize`
|
|
|
|
mb_left=`expr $whats_left / $mb_sect`
|
1993-08-11 04:06:14 +02:00
|
|
|
echo ""
|
1993-08-26 05:16:51 +02:00
|
|
|
# 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"
|
1993-08-20 19:17:04 +02:00
|
|
|
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."
|
1993-08-26 05:16:51 +02:00
|
|
|
echo -n "Which blocking factor should we use for the filesystems? "
|
|
|
|
echo -n "[$DEFBLOCKING] "
|
1993-08-20 23:47:42 +02:00
|
|
|
read blocking_factor junk
|
1993-08-20 19:17:04 +02:00
|
|
|
if [ "$blocking_factor" = "" ]; then
|
1993-08-26 05:16:51 +02:00
|
|
|
blocking_factor=$DEFBLOCKING
|
1993-08-20 19:17:04 +02:00
|
|
|
fi
|
1993-08-26 05:16:51 +02:00
|
|
|
DEFBLOCKING=$blocking_factor
|
1993-08-20 19:17:04 +02:00
|
|
|
fragsize=`expr $bytes_per_sect \* $blocking_factor`
|
|
|
|
blocksize=`expr $bytes_per_sect \* $blocking_factor \* 8`
|
|
|
|
minswap=`expr 8 \* $mb_sect`
|
|
|
|
min_cyl=`expr $minswap / $cylindersize`
|
1993-08-11 04:06:14 +02:00
|
|
|
swap=0
|
|
|
|
while [ $swap -eq 0 ]; do
|
1993-08-20 19:17:04 +02:00
|
|
|
echo
|
1993-08-31 17:02:53 +02:00
|
|
|
echo "$mb_left Mb ($cyl_left cylinders) remaining in ${OPSYSTEM} portion of disk."
|
1993-08-20 19:17:04 +02:00
|
|
|
echo
|
|
|
|
echo "Minimum swap space is $min_cyl cylinders."
|
1993-08-20 23:47:42 +02:00
|
|
|
echo "For running X, if your RAM size is NR Mb, then the recomended swap"
|
|
|
|
echo "size NS (in cylinders) is:"
|
1993-08-20 19:17:04 +02:00
|
|
|
echo " NS = integer { ( 2.1 x NR x $mb_sect ) / ${cylindersize} }"
|
|
|
|
|
|
|
|
# guess memory size
|
|
|
|
mb_ram=16
|
|
|
|
part_size=`expr \( 21 \* $mb_ram \* $mb_sect \) / 10`
|
|
|
|
part_size=`expr $part_size / ${cylindersize}`
|
|
|
|
|
|
|
|
# but not swap size more than 10% of disk size...
|
|
|
|
swap_quot=`expr $mb_left / $mb_ram`
|
|
|
|
if [ $swap_quot -lt 10 ]; then
|
|
|
|
part_size=$min_cyl
|
|
|
|
fi
|
|
|
|
echo -n "Swap partition size (in cylinders)? [${part_size}] "
|
|
|
|
read swap_cyl junk
|
|
|
|
if [ "$swap_cyl" = "" ]; then
|
|
|
|
swap_cyl=$part_size
|
|
|
|
fi
|
|
|
|
case $swap_cyl in
|
1993-08-11 04:06:14 +02:00
|
|
|
[1-9]*)
|
1993-08-20 19:17:04 +02:00
|
|
|
swap=`expr $swap_cyl \* $cylindersize`
|
1993-08-20 23:47:42 +02:00
|
|
|
if [ $swap_cyl -gt $cyl_left ]; then
|
1993-08-11 14:30:00 +02:00
|
|
|
echo "Swap size is greater than remaining free space"
|
|
|
|
swap=0
|
|
|
|
fi
|
1993-08-20 19:17:04 +02:00
|
|
|
if [ $swap_cyl -lt $min_cyl ]; then
|
|
|
|
echo "Swap space must be greater than $min_cyl"
|
1993-08-11 04:06:14 +02:00
|
|
|
swap=0
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
swap=0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
echo ""
|
|
|
|
swap_offset=`expr $root_offset + $root`
|
|
|
|
part_used=`expr $part_used + $swap`
|
|
|
|
mount -u /dev/fd0a /
|
1993-08-31 17:02:53 +02:00
|
|
|
echo "" >/etc/disktab
|
|
|
|
echo "$name|${OPSYSTEM} installation generated:\\" >>/etc/disktab
|
|
|
|
echo " :dt=${type}:ty=winchester:\\" >>/etc/disktab
|
1993-08-11 04:06:14 +02:00
|
|
|
echo -n " :nc#${cyls_per_disk}:ns#${sects_per_track}" >>/etc/disktab
|
1993-08-31 17:02:53 +02:00
|
|
|
echo ":nt#${tracks_per_cyl}:\\" >>/etc/disktab
|
|
|
|
echo " :se#${bytes_per_sect}:${sect_fwd}\\" >>/etc/disktab
|
1993-08-11 04:06:14 +02:00
|
|
|
echo -n " :pa#${root}:oa#${root_offset}" >>/etc/disktab
|
1993-08-31 17:02:53 +02:00
|
|
|
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
|
1993-08-11 04:06:14 +02:00
|
|
|
ename="";fname="";gname="";hname=""
|
|
|
|
|
1993-08-31 17:02:53 +02:00
|
|
|
echo ""
|
1993-08-20 19:17:04 +02:00
|
|
|
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}"
|
1993-08-11 04:06:14 +02:00
|
|
|
echo "portion of the disk."
|
|
|
|
|
|
|
|
while [ $part_used -lt $partition ]; do
|
|
|
|
part_size=0
|
|
|
|
whats_left=`expr $partition - $part_used`
|
1993-08-20 19:17:04 +02:00
|
|
|
cyl_left=`expr $whats_left / $cylindersize`
|
|
|
|
mb_left=`expr $whats_left / $mb_sect`
|
1993-08-11 04:06:14 +02:00
|
|
|
while [ $part_size -eq 0 ]; do
|
|
|
|
echo ""
|
1993-08-31 17:02:53 +02:00
|
|
|
echo "$mb_left Mb ($cyl_left cylinders) remaining in ${OPSYSTEM} portion of disk."
|
1993-08-20 19:17:04 +02:00
|
|
|
echo
|
|
|
|
echo -n "Next partition size (in cylinders)? [${cyl_left}] "
|
|
|
|
read part_size junk
|
|
|
|
if [ "$part_size" = "" ]; then
|
|
|
|
part_size=$cyl_left
|
|
|
|
fi
|
1993-08-11 04:06:14 +02:00
|
|
|
case $part_size in
|
|
|
|
[1-9]*)
|
1993-08-20 19:17:04 +02:00
|
|
|
part_size=`expr $part_size \* $cylindersize`
|
1993-08-11 04:06:14 +02:00
|
|
|
total=`expr $part_used + $part_size`
|
|
|
|
if [ $total -gt $partition ]; then
|
|
|
|
echo Total is greater than partition size
|
|
|
|
part_size=0
|
|
|
|
else
|
|
|
|
part_used=$total
|
|
|
|
part_name=""
|
|
|
|
while [ "$part_name" = "" ]; do
|
1993-08-20 19:17:04 +02:00
|
|
|
echo
|
|
|
|
echo -n "On which directory should this filesystem be mounted? [usr] "
|
|
|
|
read part_name junk
|
|
|
|
if [ "$part_name" = "" ]; then
|
|
|
|
part_name=usr
|
|
|
|
fi
|
|
|
|
part_name=`expr "$part_name" : '/*\(.*\)'`
|
1993-08-11 04:06:14 +02:00
|
|
|
done
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
part_size=0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
1993-08-26 05:16:51 +02:00
|
|
|
echo ""
|
1993-08-11 04:06:14 +02:00
|
|
|
if [ "$ename" = "" ]; then
|
|
|
|
ename=$part_name
|
|
|
|
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
|
|
|
|
fname=$part_name
|
|
|
|
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
|
|
|
|
gname=$part_name
|
|
|
|
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
|
|
|
|
hname=$part_name
|
|
|
|
echo -n " :ph#${part_size}:oh#${offset}" >>/etc/disktab
|
|
|
|
echo ":th=4.2BSD:bh#${blocksize}:fh#${fragsize}:\\" >>/etc/disktab
|
|
|
|
part_used=partition
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
1993-08-31 17:02:53 +02:00
|
|
|
echo " :pd#${disksize}:od#0:" >>/etc/disktab
|
1993-08-11 04:06:14 +02:00
|
|
|
cat /etc/disktab
|
|
|
|
sync
|
|
|
|
|
1993-08-31 17:02:53 +02:00
|
|
|
echo ""
|
|
|
|
echo -n "Verbose installation? [n] "
|
|
|
|
read resp
|
|
|
|
|
|
|
|
case $resp in
|
|
|
|
y*)
|
|
|
|
cpioverbose=v
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
cpioverbose=
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "OK! THIS IS THE LAST CHANCE!!! Data on the hard disk wil be lost."
|
1993-08-20 19:17:04 +02:00
|
|
|
echo -n "Are you sure you want to install on the hard drive? (yes/no) "
|
1993-08-11 04:06:14 +02:00
|
|
|
answer=""
|
|
|
|
while [ "$answer" = "" ]; do
|
1993-08-20 19:17:04 +02:00
|
|
|
read answer junk
|
1993-08-11 04:06:14 +02:00
|
|
|
case $answer in
|
1993-08-20 19:17:04 +02:00
|
|
|
Yes|yes|YES)
|
1993-08-20 20:07:39 +02:00
|
|
|
verified_install=1
|
1993-08-31 17:02:53 +02:00
|
|
|
echo ""
|
|
|
|
echo "OK! Here we go..."
|
1993-08-11 04:06:14 +02:00
|
|
|
;;
|
1993-08-20 19:17:04 +02:00
|
|
|
No|no|NO)
|
1993-08-20 20:07:39 +02:00
|
|
|
echo ""
|
|
|
|
echo -n "Would you like to change the configuration? [y] "
|
|
|
|
read answer junk
|
|
|
|
if [ "$answer" = "" ]; then
|
|
|
|
answer=y
|
|
|
|
fi
|
|
|
|
echo $answer
|
|
|
|
case $answer in
|
|
|
|
y*|Y*)
|
|
|
|
;;
|
|
|
|
*)
|
1993-08-31 17:02:53 +02:00
|
|
|
echo ""
|
|
|
|
echo "OK, then enter 'halt' to halt the machine."
|
|
|
|
echo "Once the machine has halted, remove the floppy,"
|
|
|
|
echo "and press any key to reboot."
|
1993-08-20 20:07:39 +02:00
|
|
|
exit
|
|
|
|
;;
|
|
|
|
esac
|
1993-08-11 04:06:14 +02:00
|
|
|
;;
|
|
|
|
*)
|
1993-08-20 19:17:04 +02:00
|
|
|
echo "Please spell out either of \`yes' or \`no'..."
|
|
|
|
echo -n "Install on the hard disk? (yes/no) "
|
1993-08-11 04:06:14 +02:00
|
|
|
answer=
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
1993-08-20 20:07:39 +02:00
|
|
|
done # End of Big Loop
|
|
|
|
|
1993-08-31 17:02:53 +02:00
|
|
|
echo ""
|
1993-08-11 04:06:14 +02:00
|
|
|
echo -n "Labelling disk..."
|
1993-08-11 14:30:00 +02:00
|
|
|
/sbin/disklabel -w -r $drivename $name /usr/mdec/${drivetype}boot /usr/mdec/boot${drivetype}
|
1993-08-31 17:02:53 +02:00
|
|
|
echo " done."
|
1993-08-11 04:06:14 +02:00
|
|
|
|
|
|
|
if [ "$sect_fwd" = "sf:" ]; then
|
|
|
|
echo -n "Initializing bad144 badblock table..."
|
|
|
|
bad144 $drivename 0
|
|
|
|
echo " done."
|
1993-08-26 05:16:51 +02:00
|
|
|
echo "Scanning disk for bad blocks..."
|
|
|
|
bad144 -s $drivename
|
|
|
|
echo "done."
|
1993-08-11 04:06:14 +02:00
|
|
|
fi
|
|
|
|
|
1993-08-31 17:02:53 +02:00
|
|
|
echo "Initializing root filesystem, and mounting..."
|
1993-08-11 14:30:00 +02:00
|
|
|
newfs ${rotdelay} /dev/r${drivename}a $name
|
1993-08-11 04:06:14 +02:00
|
|
|
mount -v /dev/${drivename}a /mnt
|
|
|
|
if [ "$ename" != "" ]; then
|
1993-08-31 17:02:53 +02:00
|
|
|
echo ""
|
|
|
|
echo "Initializing $ename filesystem, and mounting..."
|
1993-08-11 14:30:00 +02:00
|
|
|
newfs ${rotdelay} /dev/r${drivename}e $name
|
1993-08-11 04:06:14 +02:00
|
|
|
mkdir -p /mnt/$ename
|
|
|
|
mount -v /dev/${drivename}e /mnt/$ename
|
|
|
|
fi
|
|
|
|
if [ "$fname" != "" ]; then
|
1993-08-31 17:02:53 +02:00
|
|
|
echo ""
|
|
|
|
echo "Initializing $fname filesystem, and mounting..."
|
1993-08-11 14:30:00 +02:00
|
|
|
newfs ${rotdelay} /dev/r${drivename}f $name
|
1993-08-11 04:06:14 +02:00
|
|
|
mkdir -p /mnt/$fname
|
|
|
|
mount -v /dev/${drivename}f /mnt/$fname
|
|
|
|
fi
|
|
|
|
if [ "$gname" != "" ]; then
|
1993-08-31 17:02:53 +02:00
|
|
|
echo ""
|
|
|
|
echo "Initializing $gname filesystem, and mounting..."
|
1993-08-11 14:30:00 +02:00
|
|
|
newfs ${rotdelay} /dev/r${drivename}g $name
|
1993-08-11 04:06:14 +02:00
|
|
|
mkdir -p /mnt/$gname
|
|
|
|
mount -v /dev/${drivename}g /mnt/$gname
|
|
|
|
fi
|
|
|
|
if [ "$hname" != "" ]; then
|
1993-08-31 17:02:53 +02:00
|
|
|
echo ""
|
|
|
|
echo "Initializing $hname filesystem, and mounting..."
|
1993-08-11 14:30:00 +02:00
|
|
|
newfs ${rotdelay} /dev/r${drivename}h $name
|
1993-08-11 04:06:14 +02:00
|
|
|
mkdir -p /mnt/$hname
|
|
|
|
mount -v /dev/${drivename}h /mnt/$hname
|
|
|
|
fi
|
|
|
|
|
1993-08-31 17:02:53 +02:00
|
|
|
echo
|
1993-08-26 05:16:51 +02:00
|
|
|
echo "Copying to disk..."
|
1993-08-11 04:06:14 +02:00
|
|
|
cd /
|
1993-08-26 05:16:51 +02:00
|
|
|
cat filelist | cpio -pdamu${cpioverbose} /mnt
|
|
|
|
sync
|
1993-08-11 04:06:14 +02:00
|
|
|
|
|
|
|
cd /mnt
|
1993-08-11 14:30:00 +02:00
|
|
|
echo "/dev/${drivename}a / ufs rw 1 1" >etc/fstab
|
1993-08-11 04:06:14 +02:00
|
|
|
if [ "$ename" != "" ]; then
|
1993-08-11 14:30:00 +02:00
|
|
|
echo "/dev/${drivename}e /$ename ufs rw 1 2" >>etc/fstab
|
1993-08-11 04:06:14 +02:00
|
|
|
fi
|
|
|
|
if [ "$fname" != "" ]; then
|
1993-08-11 14:30:00 +02:00
|
|
|
echo "/dev/${drivename}f /$fname ufs rw 1 3" >>etc/fstab
|
1993-08-11 04:06:14 +02:00
|
|
|
fi
|
|
|
|
if [ "$gname" != "" ]; then
|
1993-08-11 14:30:00 +02:00
|
|
|
echo "/dev/${drivename}g /$gname ufs rw 1 4" >>etc/fstab
|
1993-08-11 04:06:14 +02:00
|
|
|
fi
|
|
|
|
if [ "$hname" != "" ]; then
|
1993-08-11 14:30:00 +02:00
|
|
|
echo "/dev/${drivename}h /$hname ufs rw 1 5" >>etc/fstab
|
1993-08-11 04:06:14 +02:00
|
|
|
fi
|
|
|
|
|
1993-08-26 05:16:51 +02:00
|
|
|
cat /etc/disktab >etc/disktab.install
|
|
|
|
|
1993-08-11 04:06:14 +02:00
|
|
|
cat << EOF >.profile
|
|
|
|
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/contrib/bin:.:
|
|
|
|
export PATH
|
|
|
|
HOME=/root
|
|
|
|
export HOME
|
|
|
|
TERM=pc3
|
|
|
|
export TERM
|
1993-08-26 05:16:51 +02:00
|
|
|
mount -at ufs
|
1993-08-31 17:02:53 +02:00
|
|
|
echo
|
|
|
|
echo "Insert cpio floppy in a drive and enter"
|
|
|
|
echo -n "that drive's number (e.g. 0 or 1): [0]"
|
1993-08-20 19:17:04 +02:00
|
|
|
read driveno junk
|
1993-08-12 09:14:23 +02:00
|
|
|
if [ "\$driveno" = "" ]; then
|
|
|
|
driveno=0
|
|
|
|
fi
|
1993-08-20 19:17:04 +02:00
|
|
|
echo $driveno
|
1993-08-11 04:06:14 +02:00
|
|
|
mount -o ro /dev/fd\${driveno}a /mnt
|
|
|
|
cd /mnt
|
|
|
|
install
|
|
|
|
EOF
|
|
|
|
|
|
|
|
sync
|
|
|
|
|
1993-08-20 19:17:04 +02:00
|
|
|
echo ""
|
1993-08-31 17:02:53 +02:00
|
|
|
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 ""
|
|
|
|
echo "To do this, enter 'halt' now to halt the machine. After it"
|
1993-08-20 19:17:04 +02:00
|
|
|
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."
|
|
|
|
echo ""
|
|
|
|
echo "When prompted to insert the file system floppy, this time just"
|
|
|
|
echo "hit RETURN without changing floppies. If all goes well, you can"
|
|
|
|
echo "enter the command \`copy' at the prompt to copy the kernel to the"
|
1993-08-31 17:02:53 +02:00
|
|
|
echo "hard disk. When asked for which partition to copy to, enter to"
|
|
|
|
echo "\`${drivename}a' (without the quotes)."
|
1993-08-20 19:17:04 +02:00
|
|
|
echo ""
|
|
|
|
echo "Okay, that's all for now. I'm waiting for you to enter \`halt'..."
|