Added DEFCYLN, DEFHEAD and DEFSECT parameters to inst1.install, these

are set to 1024/12/17
This commit is contained in:
rgrimes 1993-08-31 15:02:53 +00:00
parent 4cf9a80947
commit 991333f938
2 changed files with 110 additions and 132 deletions

View File

@ -1,50 +1,33 @@
#!/bin/sh #!/bin/sh
# install1.fs disk 'install' # filesystem-floppy disk /install
# Simplified, interactive NetBSD installation script. # Simplified, interactive *BSD installation script.
# D.E. Silvia (dsilvia@net.com) # D.E. Silvia (dsilvia@net.com)
# #
# (and again hacked on by rgrimes 1993/08/10, # Heavily hacked on by cgd and rwgrimes and miscilanious times
# for FreeBSD, changed only the printing messages, not the comments # comments here are brief to save disk space!
# 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,
# added (heads) to clarify what disk tracks means)
#
# (heavily hacked by cgd)
# (and again by rwgrimes, for bad144 support and some error checking)
#
# Provides for variable swap and multiple partitions.
#
# Installs first minimal part of basic NetBSD system.
#
# Does not appear to work properly IF not using whole disk _AND_ there is
# no DOS partition (kernel bug? Tries to chroot to partition 'd' :-{ )
#
# 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 OPSYSTEM=FreeBSD
DEFBLOCKING=2 DEFBLOCKING=2
DEFSECT=17
DEFHEAD=12
DEFCYLN=1024
echo "Welcome to ${OPSYSTEM}." echo "Welcome to ${OPSYSTEM}."
echo "" echo ""
echo "This program is designed to help put ${OPSYSTEM} on a hard disk," 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 "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" echo "and it would probably be useful to have a disk's hardware"
echo "manual, the installation notes, and a calculator handy." echo "manual, the installation notes, and a calculator handy."
echo "" echo ""
echo "In particular, we need to know some reasonably detailed" echo "In particular, we need to know some reasonably detailed"
echo "information about the disk's geometry, because there is currently" echo "information about the disk's geometry, because there is currently"
echo "no way we can figure out this information by ourselves." echo "no way we can figure out this information by ourselves."
echo "" echo ""
echo "As with anything which modifies a hard drive's contents, this" echo "As with anything which modifies a hard drive's contents, this"
echo "program can cause SIGNIFICANT data loss, and we strongly recommend" 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 "making sure that the hard drive is backed up before going further with"
echo "the installation process." echo "the installation process."
echo "" echo ""
echo -n "Proceed with installation? [y] " echo -n "Proceed with installation? [y] "
read resp junk read resp junk
if [ "$resp" = "" ]; then if [ "$resp" = "" ]; then
@ -53,7 +36,7 @@ fi
case $resp in case $resp in
y*|Y*) y*|Y*)
echo echo
echo "Cool! Let's get to it..." echo "Cool! Let's get to it..."
echo "" echo ""
echo "If a mistake is made along the way, don't bail out." 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 "At the end, you have the option to redo the configuration."
@ -61,10 +44,10 @@ case $resp in
echo "and enter \`halt' at the command prompt \`#'." echo "and enter \`halt' at the command prompt \`#'."
;; ;;
*) *)
echo "" echo ""
echo "OK, then. enter 'halt' to halt the machine." echo "OK, then enter 'halt' to halt the machine."
echo "Once the machine has halted, remove the floppy," echo "Once the machine has halted, remove the floppy,"
echo "and press any key to reboot." echo "and press any key to reboot."
exit exit
;; ;;
esac esac
@ -76,17 +59,17 @@ rotdelay=""
drivename=wd0 drivename=wd0
drivetype=wd drivetype=wd
sect_fwd="" sect_fwd=""
echo "" echo ""
echo "First, we need to know the drive type. This can be can be one of" echo "First, we need to know the drive type. This can be can be one of"
echo "ESDI, SCSI, ST506, or IDE." echo "ESDI, SCSI, ST506, or IDE."
echo -n "Drive type? [IDE] " echo -n "Drive type? [IDE] "
read type junk read type junk
if [ "$type" = "" ]; then if [ "$type" = "" ]; then
type=IDE type=IDE
fi fi
echo $type
case "$type" in case "$type" in
e*|E*|st*|ST*) e*|E*|st*|ST*)
echo
echo -n "Does it support _automatic_ sector remapping? [y] " echo -n "Does it support _automatic_ sector remapping? [y] "
read remap junk read remap junk
case "$remap" in case "$remap" in
@ -94,25 +77,33 @@ case "$type" in
sect_fwd="sf:" sect_fwd="sf:"
;; ;;
esac esac
case "$type" in
e*|E*)
DEFSECT=36
;;
esac
;; ;;
i*|I*) i*|I*)
type=ST506 type=ST506
rotdelay="-d 0"
;; ;;
sc*|SC*) sc*|SC*)
drivename=sd0 drivename=sd0
drivetype=sd drivetype=sd
type=SCSI type=SCSI
rotdelay="-d 0" rotdelay="-d 0"
DEFSECT=32
DEFHEAD=64
;; ;;
*) *)
echo "Unknown type. Assuming ST506 with automatic sectoring..." echo "Unknown type. Assuming ST506 with automatic sectoring..."
type=ST506 type=ST506
;; ;;
esac esac
echo "" echo ""
echo "Disk is of device type $drivetype." echo "Disk is of device type $drivetype."
echo "Installing on device /dev/$drivename..." echo "Installing on device /dev/$drivename..."
echo "" echo ""
echo "Now we want to build a data base entry in /etc/disktab describing" 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 "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 "should be descriptive of the disk's type and model. For example,"
@ -129,22 +120,22 @@ if [ "$bytes_per_sect" = "" ]; then
bytes_per_sect=512 bytes_per_sect=512
fi fi
echo "" echo ""
echo -n "Total number of disk cylinders? [1024] " echo -n "Total number of disk cylinders? [$DEFCYLN] "
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=$DEFCYLN
fi fi
echo "" echo ""
echo -n "Number of disk heads (i.e., tracks/cylinder)? [12] " echo -n "Number of disk heads (i.e., tracks/cylinder)? [$DEFHEAD] "
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=$DEFHEAD
fi fi
echo "" echo ""
echo -n "Number of disk sectors (i.e., sectors/track)? [36] " echo -n "Number of disk sectors (i.e., sectors/track)? [$DEFSECT] "
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=$DEFSECT
fi fi
echo "" echo ""
cylindersize=`expr $sects_per_track \* $tracks_per_cyl` cylindersize=`expr $sects_per_track \* $tracks_per_cyl`
@ -160,7 +151,7 @@ echo "For greater efficiency, partitions should begin and end on cylinder"
echo "boundaries. If you know the size NN in Megabytes (Mb) of a partition" 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 "you want, then use the following formula to determine the number NC of"
echo "cylinders to use:" echo "cylinders to use:"
echo " NC = integer { ( NN * $mb_sect ) / $cylindersize }" echo " NC = integer { ( NN * $mb_sect ) / $cylindersize }"
echo -n "Total size of the ${OPSYSTEM} portion of the disk (in cylinders)? [${cyls_per_disk}] " echo -n "Total size of the ${OPSYSTEM} portion of the disk (in cylinders)? [${cyls_per_disk}] "
read partition junk read partition junk
if [ "$partition" = "" ]; then if [ "$partition" = "" ]; then
@ -195,7 +186,7 @@ echo ""
echo "There are $mb_left Mb ($cyl_left cylinders) to allocate." echo "There are $mb_left Mb ($cyl_left cylinders) to allocate."
echo "" echo ""
# set default root partition to 15MB # set default root partition to 15MB
part_size=`expr \( 15 \* $mb_sect \) / $cylindersize` part_size=`expr \( 15 \* $mb_sect \) / $cylindersize`
if [ $part_size -gt $cyl_left ]; then if [ $part_size -gt $cyl_left ]; then
part_size=$cyl_left part_size=$cyl_left
fi fi
@ -249,7 +240,7 @@ min_cyl=`expr $minswap / $cylindersize`
swap=0 swap=0
while [ $swap -eq 0 ]; do while [ $swap -eq 0 ]; do
echo echo
echo "$mb_left Mb ($cyl_left cylinders) remaining in ${OPSYSTEM} portion of disk." echo "$mb_left Mb ($cyl_left cylinders) remaining in ${OPSYSTEM} portion of disk."
echo echo
echo "Minimum swap space is $min_cyl cylinders." echo "Minimum swap space is $min_cyl cylinders."
echo "For running X, if your RAM size is NR Mb, then the recomended swap" echo "For running X, if your RAM size is NR Mb, then the recomended swap"
@ -292,19 +283,19 @@ echo ""
swap_offset=`expr $root_offset + $root` swap_offset=`expr $root_offset + $root`
part_used=`expr $part_used + $swap` part_used=`expr $part_used + $swap`
mount -u /dev/fd0a / mount -u /dev/fd0a /
echo "" >/etc/disktab echo "" >/etc/disktab
echo "$name|${OPSYSTEM} installation generated:\\" >>/etc/disktab echo "$name|${OPSYSTEM} installation generated:\\" >>/etc/disktab
echo " :dt=${type}:ty=winchester:\\" >>/etc/disktab echo " :dt=${type}:ty=winchester:\\" >>/etc/disktab
echo -n " :nc#${cyls_per_disk}:ns#${sects_per_track}" >>/etc/disktab echo -n " :nc#${cyls_per_disk}:ns#${sects_per_track}" >>/etc/disktab
echo ":nt#${tracks_per_cyl}:\\" >>/etc/disktab echo ":nt#${tracks_per_cyl}:\\" >>/etc/disktab
echo " :se#${bytes_per_sect}:${sect_fwd}\\" >>/etc/disktab echo " :se#${bytes_per_sect}:${sect_fwd}\\" >>/etc/disktab
echo -n " :pa#${root}:oa#${root_offset}" >>/etc/disktab echo -n " :pa#${root}:oa#${root_offset}" >>/etc/disktab
echo ":ta=4.2BSD:ba#${blocksize}:fa#${fragsize}:\\" >>/etc/disktab echo ":ta=4.2BSD:ba#${blocksize}:fa#${fragsize}:\\" >>/etc/disktab
echo " :pb#${swap}:ob#${swap_offset}:tb=swap:\\" >>/etc/disktab echo " :pb#${swap}:ob#${swap_offset}:tb=swap:\\" >>/etc/disktab
echo " :pc#${partition}:oc#${part_offset}:\\" >>/etc/disktab echo " :pc#${partition}:oc#${part_offset}:\\" >>/etc/disktab
ename="";fname="";gname="";hname="" ename="";fname="";gname="";hname=""
echo "" echo ""
echo "Now we enter information about any other partitions and filesystems" 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 "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 "is complete when we've filled up all remaining space in the ${OPSYSTEM}"
@ -317,7 +308,7 @@ while [ $part_used -lt $partition ]; do
mb_left=`expr $whats_left / $mb_sect` mb_left=`expr $whats_left / $mb_sect`
while [ $part_size -eq 0 ]; do while [ $part_size -eq 0 ]; do
echo "" echo ""
echo "$mb_left Mb ($cyl_left cylinders) remaining in ${OPSYSTEM} portion of disk." echo "$mb_left Mb ($cyl_left cylinders) remaining in ${OPSYSTEM} portion of disk."
echo echo
echo -n "Next partition size (in cylinders)? [${cyl_left}] " echo -n "Next partition size (in cylinders)? [${cyl_left}] "
read part_size junk read part_size junk
@ -375,12 +366,25 @@ while [ $part_used -lt $partition ]; do
fi fi
done done
echo " :pd#${disksize}:od#0:" >>/etc/disktab echo " :pd#${disksize}:od#0:" >>/etc/disktab
cat /etc/disktab cat /etc/disktab
sync sync
echo "" echo ""
echo "OK! THIS IS THE LAST CHANCE!!! Data on the hard disk wil be lost." 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."
echo -n "Are you sure you want to install on the hard drive? (yes/no) " echo -n "Are you sure you want to install on the hard drive? (yes/no) "
answer="" answer=""
while [ "$answer" = "" ]; do while [ "$answer" = "" ]; do
@ -388,8 +392,8 @@ while [ "$answer" = "" ]; do
case $answer in case $answer in
Yes|yes|YES) Yes|yes|YES)
verified_install=1 verified_install=1
echo "" echo ""
echo "OK! Here we go..." echo "OK! Here we go..."
;; ;;
No|no|NO) No|no|NO)
echo "" echo ""
@ -403,10 +407,10 @@ while [ "$answer" = "" ]; do
y*|Y*) y*|Y*)
;; ;;
*) *)
echo "" echo ""
echo "OK, then. enter 'halt' to halt the machine." echo "OK, then enter 'halt' to halt the machine."
echo "Once the machine has halted, remove the floppy," echo "Once the machine has halted, remove the floppy,"
echo "and press any key to reboot." echo "and press any key to reboot."
exit exit
;; ;;
esac esac
@ -421,10 +425,10 @@ done
done # End of Big Loop done # End of Big Loop
echo "" echo ""
echo -n "Labelling disk..." echo -n "Labelling disk..."
/sbin/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." echo " done."
if [ "$sect_fwd" = "sf:" ]; then if [ "$sect_fwd" = "sf:" ]; then
echo -n "Initializing bad144 badblock table..." echo -n "Initializing bad144 badblock table..."
@ -435,51 +439,39 @@ if [ "$sect_fwd" = "sf:" ]; then
echo "done." echo "done."
fi fi
echo "Initializing root filesystem, and mounting..." echo "Initializing root filesystem, and mounting..."
newfs ${rotdelay} /dev/r${drivename}a $name newfs ${rotdelay} /dev/r${drivename}a $name
mount -v /dev/${drivename}a /mnt mount -v /dev/${drivename}a /mnt
if [ "$ename" != "" ]; then if [ "$ename" != "" ]; then
echo "" echo ""
echo "Initializing $ename filesystem, and mounting..." echo "Initializing $ename filesystem, and mounting..."
newfs ${rotdelay} /dev/r${drivename}e $name newfs ${rotdelay} /dev/r${drivename}e $name
mkdir -p /mnt/$ename mkdir -p /mnt/$ename
mount -v /dev/${drivename}e /mnt/$ename mount -v /dev/${drivename}e /mnt/$ename
fi fi
if [ "$fname" != "" ]; then if [ "$fname" != "" ]; then
echo "" echo ""
echo "Initializing $fname filesystem, and mounting..." echo "Initializing $fname filesystem, and mounting..."
newfs ${rotdelay} /dev/r${drivename}f $name newfs ${rotdelay} /dev/r${drivename}f $name
mkdir -p /mnt/$fname mkdir -p /mnt/$fname
mount -v /dev/${drivename}f /mnt/$fname mount -v /dev/${drivename}f /mnt/$fname
fi fi
if [ "$gname" != "" ]; then if [ "$gname" != "" ]; then
echo "" echo ""
echo "Initializing $gname filesystem, and mounting..." echo "Initializing $gname filesystem, and mounting..."
newfs ${rotdelay} /dev/r${drivename}g $name newfs ${rotdelay} /dev/r${drivename}g $name
mkdir -p /mnt/$gname mkdir -p /mnt/$gname
mount -v /dev/${drivename}g /mnt/$gname mount -v /dev/${drivename}g /mnt/$gname
fi fi
if [ "$hname" != "" ]; then if [ "$hname" != "" ]; then
echo "" echo ""
echo "Initializing $hname filesystem, and mounting..." echo "Initializing $hname filesystem, and mounting..."
newfs ${rotdelay} /dev/r${drivename}h $name newfs ${rotdelay} /dev/r${drivename}h $name
mkdir -p /mnt/$hname mkdir -p /mnt/$hname
mount -v /dev/${drivename}h /mnt/$hname mount -v /dev/${drivename}h /mnt/$hname
fi fi
echo "" echo
echo -n "Verbose installation? [n] "
read resp
case $resp in
y*)
cpioverbose=v
;;
*)
cpioverbose=
;;
esac
echo "Copying to disk..." echo "Copying to disk..."
cd / cd /
cat filelist | cpio -pdamu${cpioverbose} /mnt cat filelist | cpio -pdamu${cpioverbose} /mnt
@ -510,9 +502,9 @@ export HOME
TERM=pc3 TERM=pc3
export TERM export TERM
mount -at ufs mount -at ufs
echo "" echo
echo "Insert second installation floppy in drive and" echo "Insert cpio floppy in a drive and enter"
echo -n "enter that drive's number (e.g. 0 or 1): [0]" echo -n "that drive's number (e.g. 0 or 1): [0]"
read driveno junk read driveno junk
if [ "\$driveno" = "" ]; then if [ "\$driveno" = "" ]; then
driveno=0 driveno=0
@ -526,10 +518,10 @@ EOF
sync sync
echo "" echo ""
echo "The next step: reboot from the kernel-copy disk, copy a kernel" 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 the hard disk, and finally reboot from the hard disk."
echo "" echo ""
echo "To do this, enter 'halt' now to halt the machine. After it" 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 "announces that it has halted, remove the floppy from the drive"
echo "and insert the kernel-copy disk that was booted before." echo "and insert the kernel-copy disk that was booted before."
echo "Press any key to reboot." echo "Press any key to reboot."
@ -537,7 +529,7 @@ echo ""
echo "When prompted to insert the file system floppy, this time just" 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 "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" echo "enter the command \`copy' at the prompt to copy the kernel to the"
echo "hard disk. When asked for which partition to copy to, enter to" echo "hard disk. When asked for which partition to copy to, enter to"
echo "\`${drivename}a' (without the quotes)." echo "\`${drivename}a' (without the quotes)."
echo "" echo ""
echo "Okay, that's all for now. I'm waiting for you to enter \`halt'..." echo "Okay, that's all for now. I'm waiting for you to enter \`halt'..."

View File

@ -1,13 +1,8 @@
stty status '^T' stty status '^T'
# Set shell to ignore SIGINT (2), but not children;
# shell catches SIGQUIT (3) and returns to single user after fsck.
trap : 2 trap : 2
trap : 3 # shouldn't be needed trap : 3
HOME=/; export HOME HOME=/; export HOME
PATH=/sbin:/bin:/usr/sbin:/usr/bin; export PATH PATH=/sbin:/bin:/usr/sbin:/usr/bin; export PATH
if [ -e /fastboot ] if [ -e /fastboot ]
then then
echo Fast boot ... skipping disk checks echo Fast boot ... skipping disk checks
@ -21,11 +16,18 @@ else
exit 1 exit 1
;; ;;
4) 4)
echo "fsck changed the root file system..." echo; echo README README README README README README README
echo -n "halting, press return to reboot after the system has " echo
echo "halted" echo "NOTE: The above errors are expected if this is the"
echo "first time you have booted from the hard disk after"
echo "completing the floppy install"; echo
echo "Automatic file system check changed the root file system"
echo "The system must halt for these corrections to take effect"
echo ""
echo "Halting... press return after the system has halted to"
echo "boot from the hard disk again."
halt halt
echo "reboot failed... help!" echo "halt failed... help!"
exit 1 exit 1
;; ;;
8) 8)
@ -37,7 +39,6 @@ else
exit 1 exit 1
;; ;;
130) 130)
# interrupt before catcher installed
exit 1 exit 1
;; ;;
*) *)
@ -48,26 +49,11 @@ else
fi fi
trap "echo 'Reboot interrupted'; exit 1" 3 trap "echo 'Reboot interrupted'; exit 1" 3
swapon -a
umount -a >/dev/null 2>&1 umount -a >/dev/null 2>&1
mount -a -t nonfs mount -a -t nonfs
rm -f /fastboot # XXX (root now writeable) rm -f /fastboot
# clean up left-over files
rm -f /etc/nologin
rm -f /var/spool/uucp/LCK.*
rm -f /var/spool/uucp/STST/*
(cd /var/run && { rm -rf -- *; cp /dev/null utmp; chmod 644 utmp; }) (cd /var/run && { rm -rf -- *; cp /dev/null utmp; chmod 644 utmp; })
echo clearing /tmp
echo -n standard daemons:
echo -n ' update'; update
echo '.'
echo ''
TERM=pc3 # terminal emulator, for elvis TERM=pc3 # terminal emulator, for elvis
TERMCAP="\ TERMCAP="\
pc3|ibmpc3:li#25:co#80:am:bs:bw:eo:cd=\E[J:ce=\E[K:cl=\Ec:cm=\E[%i%2;%2H:\ pc3|ibmpc3:li#25:co#80:am:bs:bw:eo:cd=\E[J:ce=\E[K:cl=\Ec:cm=\E[%i%2;%2H:\