Changed printing messages to refer to ${OPSYSTEM} instead of NetBSD. Comments

left intact.

Simplified variables for drivename, drivetype, and sect_fwd.

Added rotdelay to newfs commands (defaults to newfs default except
for scsi disks where it defaults to 0).

Made the disk geometry questions more like what PC users are use to
reading (cylinders/heads/sectors).

Added minswap requirement of 8MB, recomendation of 2 x physical memory.

Added messages about what the blocking factor does.

Added message for mount point to NOT include the leading /

How to change disklabel to /sbin/disklabel due to bug in our /bin/sh,
I thought this has been fixed, but it has not!

Changed to use cpio instead of tar, since tar seems so brain dead.

Removed kernfs reference from /etc/fstab creation since FreeBSD does not
have the kernfs.  Made /etc/fstab tabbed so it looks pretty :-).

Added default of floppy drive 0 after we boot from hard disk.

Fixed path in inst1.profile, removed /usr/local/bin, /usr/contrib/bin and .
This commit is contained in:
Rodney W. Grimes 1993-08-11 12:30:00 +00:00
parent 6ad76e8d8e
commit ac3c7d3cff
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=279
2 changed files with 51 additions and 40 deletions

View File

@ -3,6 +3,11 @@
# Simplified, interactive NetBSD installation script.
# D.E. Silvia (dsilvia@net.com)
#
# (and again hacked on by rgrimes 1993/08/10,
# for FreeBSD, changed only the printing messages, not the comments
# about what OS this is for, now uses variable ${OPSYSTEM},
# converted to use cpio)
#
# (once again hacked on by rgrimes 1993/07/29,
# disabled old disktab.preinstall,
# added questions for what blocking factor to use in the file system,
@ -21,10 +26,11 @@
# 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.
#
OPSYSTEM=FreeBSD
echo "Welcome to the NetBSD."
echo "Welcome to ${OPSYSTEM}."
echo ""
echo "This program is designed to help you put NetBSD on your hard disk,"
echo "This program is designed to help you put ${OPSYSTEM} on your hard disk,"
echo "in a simple and rational way. You'll be asked several questions,"
echo "and it would probably be useful to have your disk's hardware"
echo "manual, the installation notes, and a calculator handy."
@ -52,36 +58,33 @@ case $resp in
exit
;;
esac
rotdelay=""
drivename=wd0
drivetype=wd
sect_fwd=""
echo ""
echo "Drive types can be ESDI, SCSI, ST506, or IDE."
echo -n "Drive type? "
read type
case "$type" in
esdi|ESDI|st506|ST506)
drivename=wd0
drivetype=wd
echo -n "Does it support _automatic_ sector remapping? [y] "
read remap
case "$remap" in
n*|N*)
sect_fwd="sf:"
;;
*)
sect_fwd=""
;;
esac
;;
ide|IDE)
drivename=wd0
drivetype=wd
sect_fwd=""
type=ST506
;;
scsi|SCSI)
drivename=sd0
drivetype=sd
sect_fwd=""
type=SCSI
rotdelay="-d 0"
;;
esac
echo ""
@ -100,10 +103,10 @@ echo ""
echo -n "Number of disk cylinders? "
read cyls_per_disk
echo ""
echo -n "Number of disk tracks (heads) per disk cylinder? "
echo -n "Number of disk heads? "
read tracks_per_cyl
echo ""
echo -n "Number of disk sectors per disk track? "
echo -n "Number of disk sectors? "
read sects_per_track
echo ""
cylindersize=`expr $sects_per_track \* $tracks_per_cyl`
@ -113,11 +116,11 @@ echo "For greater efficiency, partitions should begin and end on cylinder"
echo "boundaries. Cylinder size (in $bytes_per_sect byte sectors) on this"
echo "disk is $cylindersize. Choose multiples of this value."
echo ""
echo -n "Size of NetBSD portion of disk (in $bytes_per_sect byte sized sectors)? "
echo -n "Size of ${OPSYSTEM} portion of disk (in $bytes_per_sect byte sized sectors)? "
read partition
part_offset=0
if [ $partition -lt $disksize ]; then
echo -n "Offset of NetBSD portion of disk (in $bytes_per_sect byte sized sectors) "
echo -n "Offset of ${OPSYSTEM} portion of disk (in $bytes_per_sect byte sized sectors) "
read part_offset
fi
badspacesec=0
@ -157,15 +160,22 @@ done
root_offset=$part_offset
whats_left=`expr $partition - $part_used`
echo ""
minswap=`expr 8192 \* 1024 / $bytes_per_sect`
swap=0
while [ $swap -eq 0 ]; do
echo "$whats_left sectors remaining in NetBSD portion of disk"
echo "$whats_left sectors remaining in ${OPSYSTEM} portion of disk"
echo "Minimum swap space is $minswap."
echo "Recomended is 2 x physical memory / $bytes_per_sect"
echo -n "Swap partition size (in $bytes_per_sect byte sized sectors)? "
read swap
case $swap in
[1-9]*)
if [ $swap -gt $whats_left ]; then
echo Swap size is greater than remaining free space
echo "Swap size is greater than remaining free space"
swap=0
fi
if [ $swap -lt $minswap ]; then
echo "Swap space must be greater than $minswap"
swap=0
fi
;;
@ -175,6 +185,8 @@ while [ $swap -eq 0 ]; do
esac
done
echo ""
echo "A blocking factor of 1 builds 4k/512 file systems,"
echo "a blocking factor of 2 builds 8k/1k file systems."
echo -n "What blocking factor should be used for the filesystem? [1] "
read blocking_factor
if [ "$blocking_factor" = "" ]; then
@ -186,7 +198,7 @@ fragsize=`expr $bytes_per_sect \* $blocking_factor`
blocksize=`expr $bytes_per_sect \* $blocking_factor \* 8`
mount -u /dev/fd0a /
echo "" >/etc/disktab
echo "$name|NetBSD installation generated:\\" >>/etc/disktab
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
@ -199,8 +211,8 @@ ename="";fname="";gname="";hname=""
echo ""
echo "You will now have to enter information about any other partitions"
echo "to be created in the NetBSD portion of the disk. This process will"
echo "be complete when you've filled up all remaining space in the NetBSD"
echo "to be created in the ${OPSYSTEM} portion of the disk. This process will"
echo "be complete when you've filled up all remaining space in the ${OPSYSTEM}"
echo "portion of the disk."
while [ $part_used -lt $partition ]; do
@ -208,7 +220,7 @@ while [ $part_used -lt $partition ]; do
whats_left=`expr $partition - $part_used`
while [ $part_size -eq 0 ]; do
echo ""
echo "$whats_left sectors remaining in NetBSD portion of disk"
echo "$whats_left sectors remaining in ${OPSYSTEM} portion of disk"
echo -n "Next partition size (in $bytes_per_sect byte sized sectors)? "
read part_size
case $part_size in
@ -221,7 +233,7 @@ while [ $part_used -lt $partition ]; do
part_used=$total
part_name=""
while [ "$part_name" = "" ]; do
echo -n "Mount point? "
echo -n "Mount point (no leading / please)? "
read part_name
done
fi
@ -288,7 +300,7 @@ done
echo ""
echo -n "Labelling disk..."
disklabel -w -r $drivename $name /usr/mdec/${drivetype}boot /usr/mdec/boot${drivetype}
/sbin/disklabel -w -r $drivename $name /usr/mdec/${drivetype}boot /usr/mdec/boot${drivetype}
echo " done."
if [ "$sect_fwd" = "sf:" ]; then
@ -298,33 +310,33 @@ if [ "$sect_fwd" = "sf:" ]; then
fi
echo "Initializing root filesystem, and mounting..."
newfs /dev/r${drivename}a $name
newfs ${rotdelay} /dev/r${drivename}a $name
mount -v /dev/${drivename}a /mnt
if [ "$ename" != "" ]; then
echo ""
echo "Initializing $ename filesystem, and mounting..."
newfs /dev/r${drivename}e $name
newfs ${rotdelay} /dev/r${drivename}e $name
mkdir -p /mnt/$ename
mount -v /dev/${drivename}e /mnt/$ename
fi
if [ "$fname" != "" ]; then
echo ""
echo "Initializing $fname filesystem, and mounting..."
newfs /dev/r${drivename}f $name
newfs ${rotdelay} /dev/r${drivename}f $name
mkdir -p /mnt/$fname
mount -v /dev/${drivename}f /mnt/$fname
fi
if [ "$gname" != "" ]; then
echo ""
echo "Initializing $gname filesystem, and mounting..."
newfs /dev/r${drivename}g $name
newfs ${rotdelay} /dev/r${drivename}g $name
mkdir -p /mnt/$gname
mount -v /dev/${drivename}g /mnt/$gname
fi
if [ "$hname" != "" ]; then
echo ""
echo "Initializing $hname filesystem, and mounting..."
newfs /dev/r${drivename}h $name
newfs ${rotdelay} /dev/r${drivename}h $name
mkdir -p /mnt/$hname
mount -v /dev/${drivename}h /mnt/$hname
fi
@ -337,31 +349,29 @@ echo Copying to disk...
cd /
case $resp in
y*)
tarverbose=v
cpioverbose=v
;;
*)
tarverbose=
cpioverbose=
;;
esac
tar cfp - `cat /dirlist` | (cd /mnt ; tar xfp${tarverbose} - )
mkdir /mnt/mnt
cat filelist | cpio -pdalmu${cpioverbose} /mnt
cd /mnt
echo /dev/${drivename}a / ufs rw 1 1 >etc/fstab
echo "kernfs /kern kernfs rw 1 1" >>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
echo "/dev/${drivename}e /$ename ufs rw 1 2" >>etc/fstab
fi
if [ "$fname" != "" ]; then
echo /dev/${drivename}f /$fname ufs rw 1 3 >>etc/fstab
echo "/dev/${drivename}f /$fname ufs rw 1 3" >>etc/fstab
fi
if [ "$gname" != "" ]; then
echo /dev/${drivename}g /$gname ufs rw 1 4 >>etc/fstab
echo "/dev/${drivename}g /$gname ufs rw 1 4" >>etc/fstab
fi
if [ "$hname" != "" ]; then
echo /dev/${drivename}h /$hname ufs rw 1 5 >>etc/fstab
echo "/dev/${drivename}h /$hname ufs rw 1 5" >>etc/fstab
fi
cat << EOF >.profile
@ -373,7 +383,8 @@ TERM=pc3
export TERM
echo ""
echo "Insert second installation floppy in drive and"
echo -n "enter that drive's number (e.g. 0 or 1): "
echo -n "enter that drive's number (e.g. 0 or 1): [0]"
driveno=0
read driveno
mount -o ro /dev/fd\${driveno}a /mnt
cd /mnt

View File

@ -1,4 +1,4 @@
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/contrib/bin:.:
PATH=/sbin:/usr/sbin:/bin:/usr/bin:.:
export PATH
HOME=/root
export HOME