1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-03 09:00:21 +00:00

Added DEFBLOCKING to hold the default blocking factor after the question

has been asked once.  Disabled the ability to have different blocking
factors on different partitions since this is known to trash the vm system.

Removed many extranious echo's of the users answers.  This was probably put
in for debugging and never removed.  It was quite confusing to my test users.

Added autoscan of disk for bad blocks for bad144 type disks using the new
bad144 -s option.

Renabled the asking for verbose installation.  Why was this disabled??

Added creation of etc/disktab.install on the hard disk that is a copy
of the disktab used to create the disk with.

Added a mount -at ufs to the .profile so that all the diskpartitions get
mounted on first boot from hard disk, this is so commands that may have been
loaded into a seperate usr partition can be found.
This commit is contained in:
Rodney W. Grimes 1993-08-26 03:16:51 +00:00
parent 6d946b2e52
commit f821ac3089
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=330

View File

@ -27,6 +27,7 @@
# already in /etc/disktab. You can edit it out of the file after installation. # already in /etc/disktab. You can edit it out of the file after installation.
# #
OPSYSTEM=FreeBSD OPSYSTEM=FreeBSD
DEFBLOCKING=2
echo "Welcome to ${OPSYSTEM}." echo "Welcome to ${OPSYSTEM}."
echo "" echo ""
@ -49,7 +50,6 @@ read resp junk
if [ "$resp" = "" ]; then if [ "$resp" = "" ]; then
resp=y resp=y
fi fi
echo $resp
case $resp in case $resp in
y*|Y*) y*|Y*)
echo echo
@ -122,35 +122,30 @@ read name junk
if [ "$name" = "" ]; then if [ "$name" = "" ]; then
name=mfr_model name=mfr_model
fi fi
echo $name
echo "" echo ""
echo -n "Number of bytes per disk sector? [512] " echo -n "Number of bytes per disk sector? [512] "
read bytes_per_sect junk read bytes_per_sect junk
if [ "$bytes_per_sect" = "" ]; then if [ "$bytes_per_sect" = "" ]; then
bytes_per_sect=512 bytes_per_sect=512
fi fi
echo $bytes_per_sect
echo "" echo ""
echo -n "Total number of disk cylinders? [1024] " echo -n "Total number of disk cylinders? [1024] "
read cyls_per_disk junk read cyls_per_disk junk
if [ "$cyls_per_disk" = "" ]; then if [ "$cyls_per_disk" = "" ]; then
cyls_per_disk=1024 cyls_per_disk=1024
fi fi
echo $cyls_per_disk
echo "" echo ""
echo -n "Number of disk heads (i.e., tracks/cylinder)? [12] " echo -n "Number of disk heads (i.e., tracks/cylinder)? [12] "
read tracks_per_cyl junk read tracks_per_cyl junk
if [ "$tracks_per_cyl" = "" ]; then if [ "$tracks_per_cyl" = "" ]; then
tracks_per_cyl=12 tracks_per_cyl=12
fi fi
echo $tracks_per_cyl
echo "" echo ""
echo -n "Number of disk sectors (i.e., sectors/track)? [36] " echo -n "Number of disk sectors (i.e., sectors/track)? [36] "
read sects_per_track junk read sects_per_track junk
if [ "$sects_per_track" = "" ]; then if [ "$sects_per_track" = "" ]; then
sects_per_track=36 sects_per_track=36
fi fi
echo $sects_per_track
echo "" echo ""
cylindersize=`expr $sects_per_track \* $tracks_per_cyl` cylindersize=`expr $sects_per_track \* $tracks_per_cyl`
disksize=`expr $cylindersize \* $cyls_per_disk` disksize=`expr $cylindersize \* $cyls_per_disk`
@ -171,7 +166,6 @@ read partition junk
if [ "$partition" = "" ]; then if [ "$partition" = "" ]; then
partition=$cyls_per_disk partition=$cyls_per_disk
fi fi
echo $partition
partition=`expr $partition \* $cylindersize` partition=`expr $partition \* $cylindersize`
part_offset=0 part_offset=0
if [ $partition -lt $disksize ]; then if [ $partition -lt $disksize ]; then
@ -214,7 +208,6 @@ while [ $root -eq 0 ]; do
if [ "$root" = "" ]; then if [ "$root" = "" ]; then
root=$part_size root=$part_size
fi fi
echo $root
case $root in case $root in
[1-9]*) [1-9]*)
root=`expr $root \* $cylindersize` root=`expr $root \* $cylindersize`
@ -236,15 +229,19 @@ whats_left=`expr $partition - $part_used`
cyl_left=`expr $whats_left / $cylindersize` cyl_left=`expr $whats_left / $cylindersize`
mb_left=`expr $whats_left / $mb_sect` mb_left=`expr $whats_left / $mb_sect`
echo "" echo ""
echo "We can build the root filesystem with block/fragment sizes of either" # 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 " 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 " 2) 8k/1k for speed at the expense of disk space."
echo -n "Which blocking factor should we use for the root filesystem? [2] " echo -n "Which blocking factor should we use for the filesystems? "
echo -n "[$DEFBLOCKING] "
read blocking_factor junk read blocking_factor junk
if [ "$blocking_factor" = "" ]; then if [ "$blocking_factor" = "" ]; then
blocking_factor=2 blocking_factor=$DEFBLOCKING
fi fi
echo $blocking_factor DEFBLOCKING=$blocking_factor
fragsize=`expr $bytes_per_sect \* $blocking_factor` fragsize=`expr $bytes_per_sect \* $blocking_factor`
blocksize=`expr $bytes_per_sect \* $blocking_factor \* 8` blocksize=`expr $bytes_per_sect \* $blocking_factor \* 8`
minswap=`expr 8 \* $mb_sect` minswap=`expr 8 \* $mb_sect`
@ -274,7 +271,6 @@ while [ $swap -eq 0 ]; do
if [ "$swap_cyl" = "" ]; then if [ "$swap_cyl" = "" ]; then
swap_cyl=$part_size swap_cyl=$part_size
fi fi
echo $swap_cyl
case $swap_cyl in case $swap_cyl in
[1-9]*) [1-9]*)
swap=`expr $swap_cyl \* $cylindersize` swap=`expr $swap_cyl \* $cylindersize`
@ -328,7 +324,6 @@ while [ $part_used -lt $partition ]; do
if [ "$part_size" = "" ]; then if [ "$part_size" = "" ]; then
part_size=$cyl_left part_size=$cyl_left
fi fi
echo $part_size
case $part_size in case $part_size in
[1-9]*) [1-9]*)
part_size=`expr $part_size \* $cylindersize` part_size=`expr $part_size \* $cylindersize`
@ -347,7 +342,6 @@ while [ $part_used -lt $partition ]; do
part_name=usr part_name=usr
fi fi
part_name=`expr "$part_name" : '/*\(.*\)'` part_name=`expr "$part_name" : '/*\(.*\)'`
echo $part_name
done done
fi fi
;; ;;
@ -356,18 +350,7 @@ while [ $part_used -lt $partition ]; do
;; ;;
esac esac
done done
echo echo ""
echo "We can build this filesystem 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 this filesystem? [1] "
read blocking_factor junk
if [ "$blocking_factor" = "" ]; then
blocking_factor=1
fi
echo $blocking_factor
fragsize=`expr $bytes_per_sect \* $blocking_factor`
blocksize=`expr $bytes_per_sect \* $blocking_factor \* 8`
if [ "$ename" = "" ]; then if [ "$ename" = "" ]; then
ename=$part_name ename=$part_name
offset=`expr $part_offset + $root + $swap` offset=`expr $part_offset + $root + $swap`
@ -394,8 +377,6 @@ done
echo " :pd#${disksize}:od#0:" >>/etc/disktab echo " :pd#${disksize}:od#0:" >>/etc/disktab
cat /etc/disktab cat /etc/disktab
#No longer provide a disktab.preinstall on the floppy!
#cat /etc/disktab.preinstall >> /etc/disktab
sync sync
echo "" echo ""
@ -404,7 +385,6 @@ echo -n "Are you sure you want to install on the hard drive? (yes/no) "
answer="" answer=""
while [ "$answer" = "" ]; do while [ "$answer" = "" ]; do
read answer junk read answer junk
echo $answer
case $answer in case $answer in
Yes|yes|YES) Yes|yes|YES)
verified_install=1 verified_install=1
@ -450,6 +430,9 @@ if [ "$sect_fwd" = "sf:" ]; then
echo -n "Initializing bad144 badblock table..." echo -n "Initializing bad144 badblock table..."
bad144 $drivename 0 bad144 $drivename 0
echo " done." echo " done."
echo "Scanning disk for bad blocks..."
bad144 -s $drivename
echo "done."
fi fi
echo "Initializing root filesystem, and mounting..." echo "Initializing root filesystem, and mounting..."
@ -485,25 +468,24 @@ if [ "$hname" != "" ]; then
fi fi
echo "" echo ""
#echo -n "Verbose installation? [n] " echo -n "Verbose installation? [n] "
#read resp read resp
#
#case $resp in
# y*)
# cpioverbose=v
# ;;
# *)
# cpioverbose=
# ;;
#esac
echo Copying to disk... case $resp in
y*)
cpioverbose=v
;;
*)
cpioverbose=
;;
esac
echo "Copying to disk..."
cd / cd /
cat filelist | cpio -pdalmuv /mnt cat filelist | cpio -pdamu${cpioverbose} /mnt
#cat filelist | cpio -pdalmu${cpioverbose} /mnt sync
cd /mnt cd /mnt
echo "/dev/${drivename}a / ufs rw 1 1" >etc/fstab echo "/dev/${drivename}a / ufs rw 1 1" >etc/fstab
if [ "$ename" != "" ]; then 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
@ -518,6 +500,8 @@ 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 fi
cat /etc/disktab >etc/disktab.install
cat << EOF >.profile cat << EOF >.profile
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/contrib/bin:.: PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/contrib/bin:.:
export PATH export PATH
@ -525,6 +509,7 @@ HOME=/root
export HOME export HOME
TERM=pc3 TERM=pc3
export TERM export TERM
mount -at ufs
echo "" echo ""
echo "Insert second installation floppy in drive and" echo "Insert second installation floppy in drive and"
echo -n "enter that drive's number (e.g. 0 or 1): [0]" echo -n "enter that drive's number (e.g. 0 or 1): [0]"