Home | History | Annotate | Line # | Download | only in inst
install.sh revision 1.1
      1  1.1  chopps #!/bin/sh
      2  1.1  chopps #
      3  1.1  chopps # Copyright (c) 1994 Christopher G. Demetriou
      4  1.1  chopps # All rights reserved.
      5  1.1  chopps #
      6  1.1  chopps # Redistribution and use in source and binary forms, with or without
      7  1.1  chopps # modification, are permitted provided that the following conditions
      8  1.1  chopps # are met:
      9  1.1  chopps # 1. Redistributions of source code must retain the above copyright
     10  1.1  chopps #    notice, this list of conditions and the following disclaimer.
     11  1.1  chopps # 2. Redistributions in binary form must reproduce the above copyright
     12  1.1  chopps #    notice, this list of conditions and the following disclaimer in the
     13  1.1  chopps #    documentation and/or other materials provided with the distribution.
     14  1.1  chopps # 3. All advertising materials mentioning features or use of this software
     15  1.1  chopps #    must display the following acknowledgement:
     16  1.1  chopps #	This product includes software developed by Christopher G. Demetriou.
     17  1.1  chopps # 4. The name of the author may not be used to endorse or promote products
     18  1.1  chopps #    derived from this software without specific prior written permission
     19  1.1  chopps #
     20  1.1  chopps # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     21  1.1  chopps # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     22  1.1  chopps # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     23  1.1  chopps # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     24  1.1  chopps # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     25  1.1  chopps # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     26  1.1  chopps # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     27  1.1  chopps # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     28  1.1  chopps # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     29  1.1  chopps # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     30  1.1  chopps #
     31  1.1  chopps #	$Id: install.sh,v 1.1 1994/10/06 20:25:47 chopps Exp $
     32  1.1  chopps 
     33  1.1  chopps #	NetBSD installation script.
     34  1.1  chopps #	In a perfect world, this would be a nice C program, with a reasonable
     35  1.1  chopps #	user interface.
     36  1.1  chopps 
     37  1.1  chopps DT=/etc/disktab				# /etc/disktab
     38  1.1  chopps FSTABDIR=/mnt/etc			# /mnt/etc
     39  1.1  chopps #DONTDOIT=echo
     40  1.1  chopps 
     41  1.1  chopps VERSION=1.0
     42  1.1  chopps FSTAB=${FSTABDIR}/fstab
     43  1.1  chopps 
     44  1.1  chopps getresp() {
     45  1.1  chopps 	read resp
     46  1.1  chopps 	if [ "X$resp" = "X" ]; then
     47  1.1  chopps 		resp=$1
     48  1.1  chopps 	fi
     49  1.1  chopps }
     50  1.1  chopps 
     51  1.1  chopps echo	"Welcome to the NetBSD ${VERSION} installation program."
     52  1.1  chopps echo	""
     53  1.1  chopps echo	"This program is designed to help you put NetBSD on your hard disk,"
     54  1.1  chopps echo	"in a simple and rational way.  You'll be asked several questions,"
     55  1.1  chopps echo	"and it would probably be useful to have your disk's hardware"
     56  1.1  chopps echo	"manual, the installation notes, and a calculator handy."
     57  1.1  chopps echo	""
     58  1.1  chopps echo	"In particular, you will need to know some reasonably detailed"
     59  1.1  chopps echo	"information about your disk's geometry, because there is currently"
     60  1.1  chopps echo	"no way this this program can figure that information out."
     61  1.1  chopps echo	""
     62  1.1  chopps echo	"As with anything which modifies your hard drive's contents, this"
     63  1.1  chopps echo	"program can cause SIGNIFICANT data loss, and you are advised"
     64  1.1  chopps echo	"to make sure your hard drive is backed up before beginning the"
     65  1.1  chopps echo	"installation process."
     66  1.1  chopps echo	""
     67  1.1  chopps echo	"Default answers are displyed in brackets after the questions."
     68  1.1  chopps echo	"You can hit Control-C at any time to quit, but if you do so at a"
     69  1.1  chopps echo	"prompt, you may have to hit return.  Also, quitting in the middle of"
     70  1.1  chopps echo	"installation may leave your system in an inconsistent state."
     71  1.1  chopps echo	""
     72  1.1  chopps echo -n "Proceed with installation? [n] "
     73  1.1  chopps getresp "n"
     74  1.1  chopps case "$resp" in
     75  1.1  chopps 	y*|Y*)
     76  1.1  chopps 		echo	"Cool!  Let's get to it..."
     77  1.1  chopps 		;;
     78  1.1  chopps 	*)
     79  1.1  chopps 		echo	""
     80  1.1  chopps 		echo	"OK, then.  Enter 'halt' at the prompt to halt the"
     81  1.1  chopps 		echo	"machine.  Once the machine has halted, remove the"
     82  1.1  chopps 		echo	"floppy and press any key to reboot."
     83  1.1  chopps 		exit
     84  1.1  chopps 		;;
     85  1.1  chopps esac
     86  1.1  chopps 
     87  1.1  chopps echo	""
     88  1.1  chopps echo	"To do the installation, you'll need to provide some information about"
     89  1.1  chopps echo	"your disk."
     90  1.1  chopps echo	""
     91  1.1  chopps echo	"NetBSD can be installed on ST506, ESDI, IDE, or SCSI disks."
     92  1.1  chopps echo -n	"What kind of disk will you be installing on? [SCSI] "
     93  1.1  chopps getresp "SCSI"
     94  1.1  chopps case "$resp" in
     95  1.1  chopps 	esdi|ESDI|st506|ST506)
     96  1.1  chopps 		drivetype=wd
     97  1.1  chopps 		echo -n "Does it support _automatic_ sector remapping? [y] "
     98  1.1  chopps 		getresp "y"
     99  1.1  chopps 		case "$resp" in
    100  1.1  chopps 			n*|N*)
    101  1.1  chopps 				sect_fwd="sf:"
    102  1.1  chopps 				;;
    103  1.1  chopps 			*)
    104  1.1  chopps 				sect_fwd=""
    105  1.1  chopps 				;;
    106  1.1  chopps 		esac
    107  1.1  chopps 		;;
    108  1.1  chopps 	ide|IDE)
    109  1.1  chopps 		drivetype=wd
    110  1.1  chopps 		sect_fwd=""
    111  1.1  chopps 		type=ST506
    112  1.1  chopps 		;;
    113  1.1  chopps 	scsi|SCSI)
    114  1.1  chopps 		drivetype=sd
    115  1.1  chopps 		sect_fwd=""
    116  1.1  chopps 		type=SCSI
    117  1.1  chopps 		;;
    118  1.1  chopps esac
    119  1.1  chopps 
    120  1.1  chopps # find out what units are possible for that disk, and query the user.
    121  1.1  chopps driveunits=`ls /dev/${drivetype}?a | sed -e 's,/dev/\(...\)a,\1,g'`
    122  1.1  chopps if [ "X${driveunits}" = "X" ]; then
    123  1.1  chopps 	echo	"FATAL ERROR:"
    124  1.1  chopps 	echo	"No devices for disks of type '${drivetype}'."
    125  1.1  chopps 	echo	"This is probably a bug in the install disks."
    126  1.1  chopps 	echo	"Exiting install program."
    127  1.1  chopps 	exit
    128  1.1  chopps fi
    129  1.1  chopps prefdrive=${drivetype}0
    130  1.1  chopps 
    131  1.1  chopps echo	""
    132  1.1  chopps echo	"The following ${drivetype}-type disks are supported by this"
    133  1.1  chopps echo	"installation procedure:"
    134  1.1  chopps echo	"	"${driveunits}
    135  1.1  chopps echo	"Note that they may not exist in _your_ machine; the list of"
    136  1.1  chopps echo	"disks in your machine was printed when the system was booting."
    137  1.1  chopps echo	""
    138  1.1  chopps while [ "X${drivename}" = "X" ]; do
    139  1.1  chopps 	echo -n	"Which disk would like to install on? [${prefdrive}] "
    140  1.1  chopps 	getresp ${prefdrive}
    141  1.1  chopps 	otherdrives=`echo "${driveunits}" | sed -e s,${resp},,`
    142  1.1  chopps 	if [ "X${driveunits}" = "X${otherdrives}" ]; then
    143  1.1  chopps 		echo	""
    144  1.1  chopps 		echo	"\"${resp}\" is an invalid drive name.  Valid choices"
    145  1.1  chopps 		echo	"are: "${driveunits}
    146  1.1  chopps 		echo	""
    147  1.1  chopps 	else
    148  1.1  chopps 		drivename=${resp}
    149  1.1  chopps 	fi
    150  1.1  chopps done
    151  1.1  chopps 
    152  1.1  chopps echo	""
    153  1.1  chopps echo	"Using disk ${drivename}."
    154  1.1  chopps echo	""
    155  1.1  chopps echo -n	"What kind of disk is it? (one word please) [my${drivetype}] "
    156  1.1  chopps getresp "my${drivetype}"
    157  1.1  chopps labelname=$resp
    158  1.1  chopps 
    159  1.1  chopps echo	""
    160  1.1  chopps echo	"You will now need to provide some information about your disk's"
    161  1.1  chopps echo	"geometry.  This should either be in the User's Manual for your disk,"
    162  1.1  chopps echo	"or you should have written down what NetBSD printed when booting."
    163  1.1  chopps echo	"(Note that he geometry that's printed at boot time is preferred.)"
    164  1.1  chopps echo	""
    165  1.1  chopps echo -n	"Number of bytes per disk sector? [512] "
    166  1.1  chopps getresp 512
    167  1.1  chopps bytes_per_sect="$resp"
    168  1.1  chopps 
    169  1.1  chopps echo -n "Number of disk cylinders? "
    170  1.1  chopps getresp
    171  1.1  chopps cyls_per_disk="$resp"
    172  1.1  chopps 
    173  1.1  chopps echo -n	"Number of disk tracks (heads) per disk cylinder? "
    174  1.1  chopps getresp
    175  1.1  chopps tracks_per_cyl="$resp"
    176  1.1  chopps 
    177  1.1  chopps echo -n	"Number of disk sectors per disk track? "
    178  1.1  chopps getresp
    179  1.1  chopps sects_per_track="$resp"
    180  1.1  chopps 
    181  1.1  chopps cylindersize=`expr $sects_per_track \* $tracks_per_cyl`
    182  1.1  chopps cylbytes=`expr $cylindersize \* $bytes_per_sect`
    183  1.1  chopps disksize=`expr $cylindersize \* $cyls_per_disk`
    184  1.1  chopps 
    185  1.1  chopps echo	""
    186  1.1  chopps echo	"Your disk has a total of $disksize $bytes_per_sect byte sectors,"
    187  1.1  chopps echo	"arranged as $cyls_per_disk cylinders which contain $cylindersize"
    188  1.1  chopps echo	"sectors ($cylbytes bytes) each."
    189  1.1  chopps echo	""
    190  1.1  chopps echo	"You can specify partition sizes in cylinders ('c') or sectors ('s')."
    191  1.1  chopps while [ "X${sizemult}" = "X" ]; do
    192  1.1  chopps 	echo -n	"What units would you like to use? [cylinders] "
    193  1.1  chopps 	getresp cylinders
    194  1.1  chopps 	case "$resp" in
    195  1.1  chopps 		c*|C*)
    196  1.1  chopps 			sizemult=$cylindersize
    197  1.1  chopps 			sizeunit="cylinders"
    198  1.1  chopps 			;;
    199  1.1  chopps 		s*|S*)
    200  1.1  chopps 			sizemult=1
    201  1.1  chopps 			sizeunit="sectors"
    202  1.1  chopps 			;;
    203  1.1  chopps 		*)
    204  1.1  chopps 			echo	""
    205  1.1  chopps 			echo	"Enter cylinders ('c') or sectors ('s')."
    206  1.1  chopps 			;;
    207  1.1  chopps 	esac
    208  1.1  chopps done
    209  1.1  chopps 
    210  1.1  chopps if [ $sizeunit = "sectors" ]; then
    211  1.1  chopps 	echo	""
    212  1.1  chopps 	echo	"For best disk performance, partitions should being and end on"
    213  1.1  chopps 	echo	"cylinder boundaries.  Wherever possible, pick sizes that are"
    214  1.1  chopps 	echo -n	"multiples are multiples of the cylinder size ($cylindersize"
    215  1.1  chopps 	echo	"sectors)."
    216  1.1  chopps fi
    217  1.1  chopps 
    218  1.1  chopps echo -n ""
    219  1.1  chopps echo -n "Size of NetBSD portion of disk (in $sizeunit)? "
    220  1.1  chopps getresp
    221  1.1  chopps partition=$resp
    222  1.1  chopps partition_sects=`expr $resp \* $sizemult`
    223  1.1  chopps part_offset=0
    224  1.1  chopps if [ $partition_sects -lt $disksize ]; then
    225  1.1  chopps 	echo -n "Offset of NetBSD portion of disk (in $sizeunit)? "
    226  1.1  chopps 	getresp
    227  1.1  chopps 	part_offset=$resp
    228  1.1  chopps fi
    229  1.1  chopps badspacesec=0
    230  1.1  chopps if [ "$sect_fwd" = "sf:" ]; then
    231  1.1  chopps 	badspacecyl=`expr $sects_per_track + 126`
    232  1.1  chopps 	badspacecyl=`expr $badspacecyl + $cylindersize - 1`
    233  1.1  chopps 	badspacecyl=`expr $badspacecyl / $cylindersize`
    234  1.1  chopps 	badspacesec=`expr $badspacecyl \* $cylindersize`
    235  1.1  chopps 	echo	""
    236  1.1  chopps 	echo -n "Using $badspacesec sectors ($badspacecyl cylinders) for the "
    237  1.1  chopps 	echo	"bad144 bad block table"
    238  1.1  chopps fi
    239  1.1  chopps 
    240  1.1  chopps sects_left=`expr $partition_sects - $badspacesec`
    241  1.1  chopps units_left=`expr $sects_left / $sizemult`
    242  1.1  chopps echo	""
    243  1.1  chopps echo	"There are $units_left $sizeunit left to allocate."
    244  1.1  chopps echo	""
    245  1.1  chopps root=0
    246  1.1  chopps while [ $root -eq 0 ]; do
    247  1.1  chopps 	echo -n "Root partition size (in $sizeunit)? "
    248  1.1  chopps 	getresp
    249  1.1  chopps 	case $resp in
    250  1.1  chopps 		[1-9]*)
    251  1.1  chopps 			total=$resp
    252  1.1  chopps 			if [ $total -gt $units_left ]; then
    253  1.1  chopps 				echo -n	"Root size is greater than remaining "
    254  1.1  chopps 				echo	"free space on disk."
    255  1.1  chopps 			else
    256  1.1  chopps 				root=$resp
    257  1.1  chopps 			fi
    258  1.1  chopps 			;;
    259  1.1  chopps 	esac
    260  1.1  chopps done
    261  1.1  chopps root_offset=$part_offset
    262  1.1  chopps part_used=`expr $root + $badspacesec / $sizemult`
    263  1.1  chopps units_left=`expr $partition - $part_used`
    264  1.1  chopps echo	""
    265  1.1  chopps 
    266  1.1  chopps swap=0
    267  1.1  chopps while [ $swap -eq 0 ]; do 
    268  1.1  chopps 	echo	"$units_left $sizeunit remaining in NetBSD portion of disk."
    269  1.1  chopps 	echo -n	"Swap partition size (in $sizeunit)? "
    270  1.1  chopps 	getresp
    271  1.1  chopps 	case $resp in
    272  1.1  chopps 		[1-9]*)
    273  1.1  chopps 			if [ $swap -gt $units_left ]; then
    274  1.1  chopps 				echo -n	"Swap size is greater than remaining "
    275  1.1  chopps 				echo	"free space on disk."
    276  1.1  chopps 			else
    277  1.1  chopps 				swap=$resp
    278  1.1  chopps 			fi
    279  1.1  chopps 			;;
    280  1.1  chopps 	esac
    281  1.1  chopps done
    282  1.1  chopps swap_offset=`expr $root_offset + $root`
    283  1.1  chopps part_used=`expr $part_used + $swap`
    284  1.1  chopps echo	""
    285  1.1  chopps 
    286  1.1  chopps fragsize=1024
    287  1.1  chopps blocksize=8192
    288  1.1  chopps $DONTDOIT mount -u /dev/fd0a /
    289  1.1  chopps cat /etc/disktab.preinstall > $DT
    290  1.1  chopps echo	"" >> $DT
    291  1.1  chopps echo	"$labelname|NetBSD installation generated:\\" >> $DT
    292  1.1  chopps echo	"	:dt=${type}:ty=winchester:\\" >> $DT
    293  1.1  chopps echo -n	"	:nc#${cyls_per_disk}:ns#${sects_per_track}" >> $DT
    294  1.1  chopps echo	":nt#${tracks_per_cyl}:\\" >> $DT
    295  1.1  chopps echo	"	:se#${bytes_per_sect}:${sect_fwd}\\" >> $DT
    296  1.1  chopps _size=`expr $root \* $sizemult`
    297  1.1  chopps _offset=`expr $root_offset \* $sizemult`
    298  1.1  chopps echo -n	"	:pa#${_size}:oa#${_offset}" >> $DT
    299  1.1  chopps echo	":ta=4.2BSD:ba#${blocksize}:fa#${fragsize}:\\" >> $DT
    300  1.1  chopps _size=`expr $swap \* $sizemult`
    301  1.1  chopps _offset=`expr $swap_offset \* $sizemult`
    302  1.1  chopps echo	"	:pb#${_size}:ob#${_offset}:tb=swap:\\" >> $DT
    303  1.1  chopps _size=`expr $partition \* $sizemult`
    304  1.1  chopps _offset=`expr $part_offset \* $sizemult`
    305  1.1  chopps echo	"	:pc#${_size}:oc#${_offset}:\\" >> $DT
    306  1.1  chopps 
    307  1.1  chopps echo	"You will now have to enter information about any other partitions"
    308  1.1  chopps echo	"to be created in the NetBSD portion of the disk.  This process will"
    309  1.1  chopps echo	"be complete when you've filled up all remaining space in the NetBSD"
    310  1.1  chopps echo	"portion of the disk."
    311  1.1  chopps 
    312  1.1  chopps while [ $part_used -lt $partition ]; do
    313  1.1  chopps 	part_size=0
    314  1.1  chopps 	units_left=`expr $partition - $part_used`
    315  1.1  chopps 	while [ $part_size -eq 0 ]; do
    316  1.1  chopps 		echo	""
    317  1.1  chopps 		echo -n	"$units_left $sizeunit remaining in NetBSD portion of "
    318  1.1  chopps 		echo	"the disk"
    319  1.1  chopps 		echo -n "Next partition size (in $sizeunit)? "
    320  1.1  chopps 		getresp
    321  1.1  chopps 		case $resp in
    322  1.1  chopps 			[1-9]*)
    323  1.1  chopps 				total=`expr $part_used + $resp`
    324  1.1  chopps 				if [ $total -gt $partition ]; then
    325  1.1  chopps 					echo -n	"That would make the parition"
    326  1.1  chopps 					echo	"too large to fit!"
    327  1.1  chopps 				else
    328  1.1  chopps 					part_size=$resp
    329  1.1  chopps 					part_used=$total
    330  1.1  chopps 					part_name=""
    331  1.1  chopps 					while [ "$part_name" = "" ]; do
    332  1.1  chopps 						echo -n "Mount point? "
    333  1.1  chopps 						getresp
    334  1.1  chopps 						part_name=$resp
    335  1.1  chopps 					done
    336  1.1  chopps 				fi
    337  1.1  chopps 				;;
    338  1.1  chopps 		esac
    339  1.1  chopps 	done
    340  1.1  chopps 	if [ "$ename" = "" ]; then
    341  1.1  chopps 		ename=$part_name
    342  1.1  chopps 		offset=`expr $part_offset + $root + $swap`
    343  1.1  chopps 		_size=`expr $part_size \* $sizemult`
    344  1.1  chopps 		_offset=`expr $offset \* $sizemult`
    345  1.1  chopps 		echo -n "	:pe#${_size}:oe#${_offset}" >> $DT
    346  1.1  chopps 		echo ":te=4.2BSD:be#${blocksize}:fe#${fragsize}:\\" >> $DT
    347  1.1  chopps 		offset=`expr $offset + $part_size`
    348  1.1  chopps 	elif [ "$fname" = "" ]; then
    349  1.1  chopps 		fname=$part_name
    350  1.1  chopps 		_size=`expr $part_size \* $sizemult`
    351  1.1  chopps 		_offset=`expr $offset \* $sizemult`
    352  1.1  chopps 		echo -n "	:pf#${_size}:of#${_offset}" >> $DT
    353  1.1  chopps 		echo ":tf=4.2BSD:bf#${blocksize}:ff#${fragsize}:\\" >> $DT
    354  1.1  chopps 		offset=`expr $offset + $part_size`
    355  1.1  chopps 	elif [ "$gname" = "" ]; then
    356  1.1  chopps 		gname=$part_name
    357  1.1  chopps 		_size=`expr $part_size \* $sizemult`
    358  1.1  chopps 		_offset=`expr $offset \* $sizemult`
    359  1.1  chopps 		echo -n "	:pg#${_size}:og#${_offset}" >> $DT
    360  1.1  chopps 		echo ":tg=4.2BSD:bg#${blocksize}:fg#${fragsize}:\\" >> $DT
    361  1.1  chopps 		offset=`expr $offset + $part_size`
    362  1.1  chopps 	elif [ "$hname" = "" ]; then
    363  1.1  chopps 		hname=$part_name
    364  1.1  chopps 		_size=`expr $part_size \* $sizemult`
    365  1.1  chopps 		_offset=`expr $offset \* $sizemult`
    366  1.1  chopps 		echo -n "	:ph#${_size}:oh#${_offset}" >> $DT
    367  1.1  chopps 		echo ":th=4.2BSD:bh#${blocksize}:fh#${fragsize}:\\" >> $DT
    368  1.1  chopps 		part_used=$partition
    369  1.1  chopps 	fi
    370  1.1  chopps done
    371  1.1  chopps echo	"	:pd#${disksize}:od#0:" >> $DT
    372  1.1  chopps sync
    373  1.1  chopps 
    374  1.1  chopps echo	""
    375  1.1  chopps echo	"THIS IS YOUR LAST CHANCE!!!"
    376  1.1  chopps echo	""
    377  1.1  chopps echo -n	"Are you SURE you want NetBSD installed on your hard drive? (yes/no) "
    378  1.1  chopps answer=""
    379  1.1  chopps while [ "$answer" = "" ]; do
    380  1.1  chopps 	getresp
    381  1.1  chopps 	case $resp in
    382  1.1  chopps 		yes|YES)
    383  1.1  chopps 			echo	""
    384  1.1  chopps 			echo	"Here we go..."
    385  1.1  chopps 			answer=yes
    386  1.1  chopps 			;;
    387  1.1  chopps 		no|NO)
    388  1.1  chopps 			echo	""
    389  1.1  chopps 			echo -n	"OK, then.  enter 'halt' to halt the machine.  "
    390  1.1  chopps 			echo    "Once the machine has halted,"
    391  1.1  chopps 			echo -n	"remove the floppy, and press any key to "
    392  1.1  chopps 			echo	"reboot."
    393  1.1  chopps 			exit
    394  1.1  chopps 			;;
    395  1.1  chopps 		*)
    396  1.1  chopps 			echo -n "I want a yes or no answer...  well? "
    397  1.1  chopps 			;;
    398  1.1  chopps 	esac
    399  1.1  chopps done
    400  1.1  chopps 
    401  1.1  chopps echo	""
    402  1.1  chopps echo -n	"Labellling disk $drivename..."
    403  1.1  chopps $DONTDOIT disklabel -w -B $drivename $labelname
    404  1.1  chopps echo	" done."
    405  1.1  chopps 
    406  1.1  chopps if [ "$sect_fwd" = "sf:" ]; then
    407  1.1  chopps 	echo -n "Initializing bad144 badblock table..."
    408  1.1  chopps 	$DONTDOIT bad144 $drivename 0
    409  1.1  chopps 	echo " done."
    410  1.1  chopps fi
    411  1.1  chopps 
    412  1.1  chopps echo	"Initializing root filesystem, and mounting..."
    413  1.1  chopps $DONTDOIT newfs /dev/r${drivename}a $name
    414  1.1  chopps $DONTDOIT mount -v /dev/${drivename}a /mnt
    415  1.1  chopps if [ "$ename" != "" ]; then
    416  1.1  chopps 	echo	""
    417  1.1  chopps 	echo	"Initializing $ename filesystem, and mounting..."
    418  1.1  chopps 	$DONTDOIT newfs /dev/r${drivename}e $name
    419  1.1  chopps 	$DONTDOIT mkdir -p /mnt/$ename
    420  1.1  chopps 	$DONTDOIT mount -v /dev/${drivename}e /mnt/$ename
    421  1.1  chopps fi
    422  1.1  chopps if [ "$fname" != "" ]; then
    423  1.1  chopps 	echo	""
    424  1.1  chopps 	echo	"Initializing $fname filesystem, and mounting..."
    425  1.1  chopps 	$DONTDOIT newfs /dev/r${drivename}f $name
    426  1.1  chopps 	$DONTDOIT mkdir -p /mnt/$fname
    427  1.1  chopps 	$DONTDOIT mount -v /dev/${drivename}f /mnt/$fname
    428  1.1  chopps fi
    429  1.1  chopps if [ "$gname" != "" ]; then
    430  1.1  chopps 	echo	""
    431  1.1  chopps 	echo	"Initializing $gname filesystem, and mounting..."
    432  1.1  chopps 	$DONTDOIT newfs /dev/r${drivename}g $name
    433  1.1  chopps 	$DONTDOIT mkdir -p /mnt/$gname
    434  1.1  chopps 	$DONTDOIT mount -v /dev/${drivename}g /mnt/$gname
    435  1.1  chopps fi
    436  1.1  chopps if [ "$hname" != "" ]; then
    437  1.1  chopps 	echo	""
    438  1.1  chopps 	echo	"Initializing $hname filesystem, and mounting..."
    439  1.1  chopps 	$DONTDOIT newfs /dev/r${drivename}h $name
    440  1.1  chopps 	$DONTDOIT mkdir -p /mnt/$hname
    441  1.1  chopps 	$DONTDOIT mount -v /dev/${drivename}h /mnt/$hname
    442  1.1  chopps fi
    443  1.1  chopps 
    444  1.1  chopps echo -n	"Creating a fstab..."
    445  1.1  chopps $DONTDOIT mkdir -p $FSTABDIR
    446  1.1  chopps echo /dev/${drivename}a / ufs rw 1 1 | sed -e s,//,/, > $FSTAB
    447  1.1  chopps if [ "$ename" != "" ]; then
    448  1.1  chopps 	echo /dev/${drivename}e /$ename ufs rw 1 2 | sed -e s,//,/, >> $FSTAB
    449  1.1  chopps fi
    450  1.1  chopps if [ "$fname" != "" ]; then
    451  1.1  chopps 	echo /dev/${drivename}f /$fname ufs rw 1 3 | sed -e s,//,/, >> $FSTAB
    452  1.1  chopps fi
    453  1.1  chopps if [ "$gname" != "" ]; then
    454  1.1  chopps 	echo /dev/${drivename}g /$gname ufs rw 1 4 | sed -e s,//,/, >> $FSTAB
    455  1.1  chopps fi
    456  1.1  chopps if [ "$hname" != "" ]; then
    457  1.1  chopps 	echo /dev/${drivename}h /$hname ufs rw 1 5 | sed -e s,//,/, >> $FSTAB
    458  1.1  chopps fi
    459  1.1  chopps sync
    460  1.1  chopps echo	" done."
    461  1.1  chopps 
    462  1.1  chopps echo	""
    463  1.1  chopps echo	""
    464  1.1  chopps echo	"OK!  The preliminary work of setting up your disk is now complete,"
    465  1.1  chopps echo	"and you can install the actual NetBSD software."
    466  1.1  chopps echo	""
    467  1.1  chopps echo	"Right now, your disk is mounted on /mnt.  You should consult"
    468  1.1  chopps echo	"the installation notes to determine how to load and install the"
    469  1.1  chopps echo	"NetBSD distribution sets, and how to configure your system when"
    470  1.1  chopps echo	"you are done."
    471  1.1  chopps echo	""
    472  1.1  chopps echo	"GOOD LUCK!"
    473  1.1  chopps echo	""
    474