head	1.12;
access;
symbols
	perseant-exfatfs-base-20250801:1.12
	perseant-exfatfs-base-20240630:1.12
	perseant-exfatfs:1.12.0.48
	perseant-exfatfs-base:1.12
	cjep_sun2x:1.12.0.46
	cjep_sun2x-base:1.12
	cjep_staticlib_x-base1:1.12
	cjep_staticlib_x:1.12.0.44
	cjep_staticlib_x-base:1.12
	phil-wifi-20200421:1.12
	phil-wifi-20200411:1.12
	phil-wifi-20200406:1.12
	pgoyette-compat-merge-20190127:1.12
	pgoyette-compat-20190127:1.12
	pgoyette-compat-20190118:1.12
	pgoyette-compat-1226:1.12
	pgoyette-compat-1126:1.12
	pgoyette-compat-1020:1.12
	pgoyette-compat-0930:1.12
	pgoyette-compat-0906:1.12
	pgoyette-compat-0728:1.12
	pgoyette-compat-0625:1.12
	pgoyette-compat-0521:1.12
	pgoyette-compat-0502:1.12
	pgoyette-compat-0422:1.12
	pgoyette-compat-0415:1.12
	pgoyette-compat-0407:1.12
	pgoyette-compat-0330:1.12
	pgoyette-compat-0322:1.12
	pgoyette-compat-0315:1.12
	pgoyette-compat:1.12.0.42
	pgoyette-compat-base:1.12
	perseant-stdc-iso10646:1.12.0.40
	perseant-stdc-iso10646-base:1.12
	prg-localcount2-base3:1.12
	prg-localcount2-base2:1.12
	prg-localcount2-base1:1.12
	prg-localcount2:1.12.0.38
	prg-localcount2-base:1.12
	pgoyette-localcount-20170426:1.12
	bouyer-socketcan-base1:1.12
	pgoyette-localcount-20170320:1.12
	bouyer-socketcan:1.12.0.36
	bouyer-socketcan-base:1.12
	pgoyette-localcount-20170107:1.12
	pgoyette-localcount-20161104:1.12
	localcount-20160914:1.12
	pgoyette-localcount-20160806:1.12
	pgoyette-localcount-20160726:1.12
	pgoyette-localcount:1.12.0.34
	pgoyette-localcount-base:1.12
	netbsd-5-2-3-RELEASE:1.12
	netbsd-5-1-5-RELEASE:1.12
	yamt-pagecache-base9:1.12
	yamt-pagecache-tag8:1.12
	tls-earlyentropy:1.12.0.30
	tls-earlyentropy-base:1.12
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.12
	riastradh-drm2-base3:1.12
	netbsd-5-2-2-RELEASE:1.12
	netbsd-5-1-4-RELEASE:1.12
	netbsd-5-2-1-RELEASE:1.12
	netbsd-5-1-3-RELEASE:1.12
	agc-symver:1.12.0.32
	agc-symver-base:1.12
	tls-maxphys-base:1.12
	yamt-pagecache-base8:1.12
	netbsd-5-2:1.12.0.28
	yamt-pagecache-base7:1.12
	netbsd-5-2-RELEASE:1.12
	netbsd-5-2-RC1:1.12
	yamt-pagecache-base6:1.12
	yamt-pagecache-base5:1.12
	yamt-pagecache-base4:1.12
	netbsd-5-1-2-RELEASE:1.12
	netbsd-5-1-1-RELEASE:1.12
	yamt-pagecache-base3:1.12
	yamt-pagecache-base2:1.12
	yamt-pagecache:1.12.0.26
	yamt-pagecache-base:1.12
	bouyer-quota2-nbase:1.12
	bouyer-quota2:1.12.0.24
	bouyer-quota2-base:1.12
	matt-nb5-pq3:1.12.0.22
	matt-nb5-pq3-base:1.12
	netbsd-5-1:1.12.0.20
	netbsd-5-1-RELEASE:1.12
	netbsd-5-1-RC4:1.12
	netbsd-5-1-RC3:1.12
	netbsd-5-1-RC2:1.12
	netbsd-5-1-RC1:1.12
	netbsd-5-0-2-RELEASE:1.12
	netbsd-5-0-1-RELEASE:1.12
	jym-xensuspend-nbase:1.12
	netbsd-5-0:1.12.0.18
	netbsd-5-0-RELEASE:1.12
	netbsd-5-0-RC4:1.12
	netbsd-5-0-RC3:1.12
	netbsd-5-0-RC2:1.12
	jym-xensuspend:1.12.0.16
	jym-xensuspend-base:1.12
	netbsd-5-0-RC1:1.12
	netbsd-5:1.12.0.14
	netbsd-5-base:1.12
	yamt-pf42-base4:1.12
	yamt-pf42-base3:1.12
	hpcarm-cleanup-nbase:1.12
	yamt-pf42-base2:1.12
	yamt-pf42:1.12.0.12
	yamt-pf42-base:1.12
	mjf-devfs2:1.12.0.10
	mjf-devfs2-base:1.12
	keiichi-mipv6:1.12.0.8
	keiichi-mipv6-base:1.12
	mjf-devfs:1.12.0.6
	mjf-devfs-base:1.12
	cube-autoconf:1.12.0.4
	cube-autoconf-base:1.12
	hpcarm-cleanup:1.12.0.2
	hpcarm-cleanup-base:1.12
	netbsd-1-5-PATCH003:1.10.2.2
	netbsd-1-5-PATCH002:1.10.2.2
	netbsd-1-5-PATCH001:1.10.2.2
	netbsd-1-5-RELEASE:1.10.2.1
	netbsd-1-5-BETA2:1.10.2.1
	netbsd-1-5-BETA:1.10.2.1
	netbsd-1-4-PATCH003:1.6.2.2
	netbsd-1-5-ALPHA2:1.10
	netbsd-1-5:1.10.0.2
	netbsd-1-5-base:1.10
	minoura-xpg4dl:1.8.0.6
	minoura-xpg4dl-base:1.8
	netbsd-1-4-PATCH002:1.6.2.2
	wrstuden-devbsize-19991221:1.8
	wrstuden-devbsize:1.8.0.4
	wrstuden-devbsize-base:1.8
	comdex-fall-1999:1.8.0.2
	comdex-fall-1999-base:1.8
	netbsd-1-4-PATCH001:1.6.2.2
	netbsd-1-4-RELEASE:1.6.2.2
	netbsd-1-4:1.6.0.2
	netbsd-1-4-base:1.6
	netbsd-1-3-PATCH003:1.1.2.1
	netbsd-1-3-PATCH003-CANDIDATE2:1.1.2.1
	netbsd-1-3-PATCH003-CANDIDATE1:1.1.2.1
	netbsd-1-3-PATCH003-CANDIDATE0:1.1.2.1
	netbsd-1-3-PATCH002:1.1
	netbsd-1-3-PATCH001:1.1
	netbsd-1-3-RELEASE:1.1
	netbsd-1-3-BETA:1.1
	netbsd-1-3:1.1.0.2
	netbsd-1-3-base:1.1;
locks; strict;
comment	@# @;


1.12
date	2000.11.28.03.03.28;	author minoura;	state dead;
branches;
next	1.11;

1.11
date	2000.09.12.15.40.00;	author minoura;	state Exp;
branches;
next	1.10;

1.10
date	2000.06.14.22.52.49;	author cgd;	state Exp;
branches
	1.10.2.1;
next	1.9;

1.9
date	2000.06.14.06.48.58;	author cgd;	state Exp;
branches;
next	1.8;

1.8
date	99.04.15.15.20.21;	author minoura;	state Exp;
branches;
next	1.7;

1.7
date	99.04.02.15.46.34;	author minoura;	state Exp;
branches;
next	1.6;

1.6
date	99.03.24.15.54.46;	author minoura;	state Exp;
branches
	1.6.2.1;
next	1.5;

1.5
date	99.01.31.17.35.49;	author minoura;	state Exp;
branches;
next	1.4;

1.4
date	99.01.25.23.34.25;	author garbled;	state Exp;
branches;
next	1.3;

1.3
date	98.10.18.15.15.46;	author minoura;	state Exp;
branches;
next	1.2;

1.2
date	98.10.01.16.49.10;	author minoura;	state Exp;
branches;
next	1.1;

1.1
date	97.10.19.15.29.10;	author oki;	state Exp;
branches
	1.1.2.1;
next	;

1.10.2.1
date	2000.09.14.14.15.24;	author minoura;	state Exp;
branches;
next	1.10.2.2;

1.10.2.2
date	2000.12.15.05.30.15;	author he;	state dead;
branches;
next	;

1.6.2.1
date	99.04.02.23.56.29;	author minoura;	state Exp;
branches;
next	1.6.2.2;

1.6.2.2
date	99.04.15.16.34.50;	author minoura;	state Exp;
branches;
next	;

1.1.2.1
date	98.10.24.01.05.20;	author cgd;	state Exp;
branches;
next	1.1.2.2;

1.1.2.2
date	99.02.05.06.45.56;	author cgd;	state Exp;
branches;
next	;


desc
@@


1.12
log
@Reorganize (again) the installation system.
 - Remove historical `script' installer, which was provided for
  4MB RAM systems.
 - Instead we provide `floppy-root' installer, which is composed
  of 2 floppies just like the installation system used in the netbsd-1-2
  days; one floppy contains (GENERIC) kernel and the other contains
  the miniroot.
 - The miniroots for both `ramdisk-root' installation system and
  `floppy-root' installation system are identical.
@
text
@#!/bin/sh
# $NetBSD: install.tmpl,v 1.11 2000/09/12 15:40:00 minoura Exp $
#
# Copyright (c) 1997 Perry E. Metzger
# Copyright (c) 1994 Christopher G. Demetriou
# All rights reserved.
# 
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
#    must display the following acknowledgement:
#          This product includes software developed for the
#          NetBSD Project.  See http://www.netbsd.org/ for
#          information about NetBSD.
# 4. The name of the author may not be used to endorse or promote products
#    derived from this software without specific prior written permission.
# 
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# 
# <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>

#	NetBSD installation script.
#	In a perfect world, this would be a nice C program, with a reasonable
#	user interface.

DT=/etc/disktab				# /etc/disktab
FSTABDIR=/mnt/etc			# /mnt/etc
#DONTDOIT=echo
ASYNC="-o async"

FSTAB=${FSTABDIR}/fstab

getresp() {
	read resp
	if [ "X$resp" = "X" ]; then
		resp=$1
	fi
}

echo	"Welcome to the NetBSD @@@@VERSION@@@@ installation program."
echo	""
echo	"This program is designed to help you put NetBSD 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."
echo	""
echo	"In particular, you will need to know some reasonably detailed"
echo	"information about your disk's geometry, because there is currently"
echo	"no way this this program can figure that information out."
echo	""
echo	"As with anything which modifies your hard drive's contents, this"
echo	"program can cause SIGNIFICANT data loss, and you are advised"
echo	"to make sure your hard drive is backed up before beginning the"
echo	"installation process."
echo	""
echo	"Default answers are displyed in brackets after the questions."
echo	"You can hit Control-C at any time to quit, but if you do so at a"
echo	"prompt, you may have to hit return.  Also, quitting in the middle of"
echo	"installation may leave your system in an inconsistent state."
echo	""
echo -n "Proceed with installation? [n] "
getresp "n"
case "$resp" in
	y*|Y*)
		echo	"Cool!  Let's get to it..."
		;;
	*)
		echo	""
		echo	"OK, then.  Enter 'halt' at the prompt to halt the"
		echo	"machine.  Once the machine has halted, remove the"
		echo	"floppy and press any key to reboot."
		exit
		;;
esac

echo	""
echo	"To do the installation, you'll need to provide some information about"
echo	"your disk."
echo	""

# support only SCSI disks.
drivetype=sd
sect_fwd=""
type=SCSI
prefdrive=${drivetype}0

# find out what units are possible for that disk, and query the user.
driveunits=`ls /dev/${drivetype}?a | sed -e 's,/dev/\(...\)a,\1,g'`
if [ "X${driveunits}" = "X" ]; then
	echo	"No devices for disks of type '${drivetype}'."
	echo	"This is probably a bug in the install disks."
	echo	"Exiting install program."
	exit
fi

echo	"NetBSD can be SCSI disks."
echo	""
echo	"The following ${drivetype}-type disks are supported by this"
echo	"installation procedure:"
echo	"	"${driveunits}
echo	"Note that they may not exist in _your_ machine; the list of"
echo	"disks in your machine was printed when the system was booting."
echo	""
while [ "X${drivename}" = "X" ]; do
	echo -n	"Which disk would like to install on? [${prefdrive}] "
	getresp ${prefdrive}
	otherdrives=`echo "${driveunits}" | sed -e s,${resp},,`
	if [ "X${driveunits}" = "X${otherdrives}" ]; then
		echo	""
		echo	"\"${resp}\" is an invalid drive name.  Valid choices"
		echo	"are: "${driveunits}
		echo	""
	else
		drivename=${resp}
	fi
done

echo	""
echo	"Using disk ${drivename}."
echo	""
echo -n	"What kind of disk is it? (one word please) [my${drivetype}] "
getresp "my${drivetype}"
labelname=$resp

echo	""
echo	"You will now need to provide some information about your disk's"
echo	"geometry.  This should either be in the User's Manual for your disk,"
echo	"or you should have written down what NetBSD printed when booting."
echo	"(Note that he geometry that's printed at boot time is preferred.)"
echo	""
echo    "You may choose to view the initial boot messages for your system"
echo    "again right now if you like."
echo -n "View the boot messages again? [n] "
getresp "n"
case "$resp" in
	y*|Y*)
		dmesg | more
		;;
	*)
		echo	""
		;;
esac

echo	""
echo	"You will now enter the disk geometry information"
echo	""

echo -n	"Number of bytes per disk sector? [512] "
getresp 512
bytes_per_sect="$resp"

echo -n "Number of disk cylinders? "
getresp
cyls_per_disk="$resp"

echo -n	"Number of disk tracks (heads) per disk cylinder? "
getresp
tracks_per_cyl="$resp"

echo -n	"Number of disk sectors per disk track? "
getresp
sects_per_track="$resp"

cylindersize=$(( $sects_per_track * $tracks_per_cyl ))
cylbytes=$(( $cylindersize * $bytes_per_sect ))
disksize=$(( $cylindersize * $cyls_per_disk ))

echo	""
echo	"Your disk has a total of $disksize $bytes_per_sect byte sectors,"
echo	"arranged as $cyls_per_disk cylinders which contain $cylindersize "
echo	"sectors ($cylbytes bytes) each."
echo	""
echo	"You can specify partition sizes in cylinders ('c') or sectors ('s')."
while [ "X${sizemult}" = "X" ]; do
	echo -n	"What units would you like to use? [cylinders] "
	getresp cylinders
	case "$resp" in
		c*|C*)
			sizemult=$cylindersize
			sizeunit="cylinders"
			;;
		s*|S*)
			sizemult=1
			sizeunit="sectors"
			;;
		*)
			echo	""
			echo	"Enter cylinders ('c') or sectors ('s')."
			;;
	esac
done

if [ $sizeunit = "sectors" ]; then
	echo	""
	echo	"For best disk performance, partitions should begin and end on"
	echo	"cylinder boundaries.  Wherever possible, pick sizes that are"
	echo	"multiples of the cylinder size ($cylindersize sectors)."
fi

part_offset=0
partition_sects=$(( $disksize - 64 ))
partition=$(( $partition_sects / $sizemult ))
badspacesec=0
if [ "$sect_fwd" = "sf:" ]; then
	badspacecyl=$(( $sects_per_track + 126 ))
	badspacecyl=$(( $badspacecyl + $cylindersize - 1 ))
	badspacecyl=$(( $badspacecyl / $cylindersize ))
	badspacesec=$(( $badspacecyl * $cylindersize ))
	echo	""
	echo -n "Using $badspacesec sectors ($badspacecyl cylinders) for the "
	echo	"bad144 bad block table"
fi

sects_left=$(( $partition_sects - $badspacesec ))
units_left=$(( $sects_left / $sizemult ))
echo	""
echo	"There are $units_left $sizeunit left to allocate."
echo	""
root=0
while [ $root -eq 0 ]; do
	echo -n "Root partition size (in $sizeunit)? "
	getresp
	case $resp in
		[1-9]*)
			total=$resp
			if [ $total -gt $units_left ]; then
				echo -n	"Root size is greater than remaining "
				echo	"free space on disk."
			else
				root=$resp
			fi
			;;
	esac
done
root_offset=$part_offset
part_used=$(( $root + $badspacesec / $sizemult ))
units_left=$(( $partition - $part_used ))
echo	""

swap=0
while [ $swap -eq 0 ]; do 
	echo	"$units_left $sizeunit remaining in NetBSD portion of disk."
	echo -n	"Swap partition size (in $sizeunit)? "
	getresp
	case $resp in
		[1-9]*)
			if [ $swap -gt $units_left ]; then
				echo -n	"Swap size is greater than remaining "
				echo	"free space on disk."
			else
				swap=$resp
			fi
			;;
	esac
done
swap_offset=$(( $root_offset + $root ))
part_used=$(( $part_used + $swap ))
echo	""

fragsize=1024
blocksize=8192

cat /etc/disktab.preinstall > $DT
echo	"" >> $DT
echo	"$labelname|NetBSD installation generated:\\" >> $DT
echo	"	:dt=${type}:ty=winchester:\\" >> $DT
echo -n	"	:nc#${cyls_per_disk}:ns#${sects_per_track}" >> $DT
echo	":nt#${tracks_per_cyl}:\\" >> $DT
echo	"	:se#${bytes_per_sect}:${sect_fwd}\\" >> $DT
_size=$(( $root * $sizemult ))
_offset=$(( $root_offset * $sizemult + 64 ))
echo -n	"	:pa#${_size}:oa#${_offset}" >> $DT
echo	":ta=4.2BSD:ba#${blocksize}:fa#${fragsize}:\\" >> $DT
_size=$(( $swap * $sizemult ))
_offset=$(( $swap_offset * $sizemult + 64 ))
echo	"	:pb#${_size}:ob#${_offset}:tb=swap:\\" >> $DT

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	"portion of the disk."

while [ $part_used -lt $partition ]; do
	part_size=0
	units_left=$(( $partition - $part_used ))
	while [ $part_size -eq 0 ]; do
		echo	""
		echo -n	"$units_left $sizeunit remaining in NetBSD portion of "
		echo	"the disk"
		echo -n "Next partition size (in $sizeunit)? "
		getresp
		case $resp in
			[1-9]*)
				total=$(( $part_used + $resp ))
				if [ $total -gt $partition ]; then
					echo -n	"That would make the parition"
					echo	"too large to fit!"
				else
					part_size=$resp
					part_used=$total
					part_name=""
					while [ "$part_name" = "" ]; do
						echo -n "Mount point? "
						getresp
						part_name=$resp
					done
				fi
				;;
		esac
	done
	if [ "$dname" = "" ]; then
		dname=$part_name
		offset=$(( $part_offset + $root + $swap ))
		_size=$(( $part_size * $sizemult ))
		_offset=$(( $offset * $sizemult + 64 ))
		echo -n "	:pd#${_size}:od#${_offset}" >> $DT
		echo ":td=4.2BSD:bd#${blocksize}:fd#${fragsize}:\\" >> $DT
		offset=$(( $offset + $part_size ))
	elif [ "$ename" = "" ]; then
		ename=$part_name
		_size=$(( $part_size * $sizemult ))
		_offset=$(( $offset * $sizemult + 64 ))
		echo -n "	:pe#${_size}:oe#${_offset}" >> $DT
		echo ":te=4.2BSD:be#${blocksize}:fe#${fragsize}:\\" >> $DT
		offset=$(( $offset + $part_size ))
	elif [ "$fname" = "" ]; then
		fname=$part_name
		_size=$(( $part_size * $sizemult ))
		_offset=$(( $offset * $sizemult + 64 ))
		echo -n "	:pf#${_size}:of#${_offset}" >> $DT
		echo ":tf=4.2BSD:bf#${blocksize}:ff#${fragsize}:\\" >> $DT
		offset=$(( $offset + $part_size ))
	elif [ "$gname" = "" ]; then
		gname=$part_name
		_size=$(( $part_size * $sizemult ))
		_offset=$(( $offset * $sizemult + 64 ))
		echo -n "	:pg#${_size}:og#${_offset}" >> $DT
		echo ":tg=4.2BSD:bg#${blocksize}:fg#${fragsize}:\\" >> $DT
		offset=$(( $offset + $part_size ))
	elif [ "$hname" = "" ]; then
		hname=$part_name
		_size=$(( $part_size * $sizemult ))
		_offset=$(( $offset * $sizemult + 64 ))
		echo -n "	:ph#${_size}:oh#${_offset}" >> $DT
		echo ":th=4.2BSD:bh#${blocksize}:fh#${fragsize}:\\" >> $DT
		part_used=$partition
	fi
done
echo	"	:pc#${disksize}:oc#0:" >> $DT
sync

echo	""
echo	"THIS IS YOUR LAST CHANCE!!!"
echo	""
echo -n	"Are you SURE you want NetBSD installed on your hard drive? (yes/no) "
answer=""
while [ "$answer" = "" ]; do
	getresp
	case $resp in
		yes|YES)
			echo	""
			echo	"Here we go..."
			answer=yes
			;;
		no|NO)
			echo	""
			echo -n	"OK, then.  enter 'halt' to halt the machine.  "
			echo    "Once the machine has halted,"
			echo -n	"remove the floppy, and press any key to "
			echo	"reboot."
			exit
			;;
		*)
			echo -n "I want a yes or no answer...  well? "
			;;
	esac
done

echo	""
echo -n	"Labeling disk $drivename..."
$DONTDOIT disklabel -w $drivename $labelname
echo	" done."

if [ `sysctl -n hw.physmem` -le 4194304 ]; then # less than 4megs
	echo	""
	echo	"You have to increase the virtual memory by activating"
	echo	"the swap device you have just configured especially if"
	echo	"you are going to retrieve the distribution sets via network."
	echo	""
	echo -n	"Enable swapping? (yes/no)"
	getresp "y"
	case $resp in
		n*)
			echo	""
			echo	"Good, swapping is not enabled."
			;;
		*)
			echo	""
			echo	"Here we go..."
			swapctl -a /dev/${drivename}b
			;;
	esac
fi

if [ "$sect_fwd" = "sf:" ]; then
	echo -n "Initializing bad144 badblock table..."
	$DONTDOIT bad144 $drivename 0
	echo " done."
fi

echo	"Initializing root filesystem, and mounting..."
$DONTDOIT newfs /dev/r${drivename}a $name
$DONTDOIT mount -v $ASYNC /dev/${drivename}a /mnt
if [ "$dname" != "" ]; then
	echo	""
	echo	"Initializing $dname filesystem, and mounting..."
	$DONTDOIT newfs /dev/r${drivename}d $name
	$DONTDOIT mkdir -p /mnt/$dname
	$DONTDOIT mount -v $ASYNC /dev/${drivename}d /mnt/$dname
fi
if [ "$ename" != "" ]; then
	echo	""
	echo	"Initializing $ename filesystem, and mounting..."
	$DONTDOIT newfs /dev/r${drivename}e $name
	$DONTDOIT mkdir -p /mnt/$ename
	$DONTDOIT mount -v $ASYNC /dev/${drivename}e /mnt/$ename
fi
if [ "$fname" != "" ]; then
	echo	""
	echo	"Initializing $fname filesystem, and mounting..."
	$DONTDOIT newfs /dev/r${drivename}f $name
	$DONTDOIT mkdir -p /mnt/$fname
	$DONTDOIT mount -v $ASYNC /dev/${drivename}f /mnt/$fname
fi
if [ "$gname" != "" ]; then
	echo	""
	echo	"Initializing $gname filesystem, and mounting..."
	$DONTDOIT newfs /dev/r${drivename}g $name
	$DONTDOIT mkdir -p /mnt/$gname
	$DONTDOIT mount -v $ASYNC /dev/${drivename}g /mnt/$gname
fi
if [ "$hname" != "" ]; then
	echo	""
	echo	"Initializing $hname filesystem, and mounting..."
	$DONTDOIT newfs /dev/r${drivename}h $name
	$DONTDOIT mkdir -p /mnt/$hname
	$DONTDOIT mount -v $ASYNC /dev/${drivename}h /mnt/$hname
fi

echo	""
echo    "Populating filesystems with bootstrapping binaries and config files"
$DONTDOIT pax -Xrwpe . /mnt
$DONTDOIT cp /tmp/.hdprofile /mnt/.profile

echo	""
echo -n	"Creating an fstab..."
echo /dev/${drivename}a / ffs rw 1 1 | sed -e s,//,/, > $FSTAB
echo /dev/${drivename}b none swap sw 0 0 | sed -e s,//,/, >> $FSTAB
if [ "$dname" != "" ]; then
	echo /dev/${drivename}d /$dname ffs rw 1 2 | sed -e s,//,/, >> $FSTAB
fi
if [ "$ename" != "" ]; then
	echo /dev/${drivename}e /$ename ffs rw 1 3 | sed -e s,//,/, >> $FSTAB
fi
if [ "$fname" != "" ]; then
	echo /dev/${drivename}f /$fname ffs rw 1 4 | sed -e s,//,/, >> $FSTAB
fi
if [ "$gname" != "" ]; then
	echo /dev/${drivename}g /$gname ffs rw 1 5 | sed -e s,//,/, >> $FSTAB
fi
if [ "$hname" != "" ]; then
	echo /dev/${drivename}h /$hname ffs rw 1 6 | sed -e s,//,/, >> $FSTAB
fi
sync
echo	" done."

echo	""
echo -n	"Installing boot blocks on $drivename..."
# shouldn't be needed, but...
$DONTDOIT /usr/mdec/installboot /usr/mdec/sdboot /dev/r${drivename}a
echo	" done."


echo	""
echo	""
echo	"OK!  The preliminary work of setting up your disk is now complete."
echo 	""
echo	"The remaining tasks are:"
echo	""
echo	"To load and install the NetBSD distribution sets."
echo	"Currently the hard drive's root filesystem is mounted on /mnt"
echo	""
echo	"To copy a NetBSD kernel to the hard drive's root filesystem."
echo	"Once accomplished, you can boot off the hard drive."
echo	""
echo	"Consult the installation notes which will describe how to"
echo	"install the distribution sets and kernel.  Post-installation"
echo	"configuration is also discussed therein."
echo	""
echo	"GOOD LUCK!"
echo	""
@


1.11
log
@Reduce ramdisk size by using hacked commands in distrib/utils.
@
text
@d2 1
a2 1
# $NetBSD: install.tmpl,v 1.10 2000/06/14 22:52:49 cgd Exp $
@


1.10
log
@sweep of my licenses for consistency.  (no functional changes)  These
files have copyright held by people in addition to myself.  (I did the
original work, they copied it, enhanced it, and added their copyright
to the derivative work.)  Their approval has been given re: the license
change.
@
text
@d2 1
a2 1
# $NetBSD: install.tmpl,v 1.9 2000/06/14 06:48:58 cgd Exp $
d152 1
a152 1
		more /kern/msgbuf
d399 1
a399 1
if [ `cat /kern/physmem` -le 1024 ]; then # less than 4megs
a417 5
	echo	""
	echo	"Note that you have to use the SMALL kernel named"
	echo	"netbsd.SMALL in x68k/binary/kernel/ directory instead of"
	echo	"the standard kernel which is included the kern.tgz."
	echo	""
d495 1
a495 1
$DONTDOIT dd if=/usr/mdec/sdboot of=/dev/r${drivename}a conv=sync
@


1.10.2.1
log
@Pullup from the trunk; approved by thorpej.

> From: Minoura Makoto <minoura@@netbsd.org>
> Subject: CVS commit: syssrc
> To: source-changes@@netbsd.org
> Date: Tue, 12 Sep 2000 18:40:02 +0300 (EEST)
> Reply-To: minoura@@netbsd.org
>
>
> Module Name:	syssrc
> Committed By:	minoura
> Date:		Tue Sep 12 15:40:01 UTC 2000
>
> Modified Files:
> 	basesrc/distrib/x68k/floppies/ramdisk: Makefile dot.hdprofile
> 	    dot.profile install.tmpl list ramdiskbin.conf upgrade.tmpl
> 	syssrc/sys/arch/x68k/conf: INSTALL_SMALL
>
> Log Message:
> Reduce ramdisk size by using hacked commands in distrib/utils.
>
>
> To generate a diff of this commit:
> cvs rdiff -r1.16 -r1.17 basesrc/distrib/x68k/floppies/ramdisk/Makefile
> cvs rdiff -r1.7 -r1.8 basesrc/distrib/x68k/floppies/ramdisk/dot.hdprofile
> cvs rdiff -r1.10 -r1.11 basesrc/distrib/x68k/floppies/ramdisk/dot.profile \
>     basesrc/distrib/x68k/floppies/ramdisk/install.tmpl \
>     basesrc/distrib/x68k/floppies/ramdisk/upgrade.tmpl
> cvs rdiff -r1.11 -r1.12 basesrc/distrib/x68k/floppies/ramdisk/list
> cvs rdiff -r1.8 -r1.9 basesrc/distrib/x68k/floppies/ramdisk/ramdiskbin.conf
> cvs rdiff -r1.5 -r1.6 syssrc/sys/arch/x68k/conf/INSTALL_SMALL
>
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
@
text
@d2 1
a2 1
# $NetBSD: install.tmpl,v 1.10 2000/06/14 22:52:49 cgd Exp $
d152 1
a152 1
		dmesg | more
d399 1
a399 1
if [ `sysctl -n hw.physmem` -le 4194304 ]; then # less than 4megs
d418 5
d500 1
a500 1
$DONTDOIT /usr/mdec/installboot /usr/mdec/sdboot /dev/r${drivename}a
@


1.10.2.2
log
@Pull up file removal (requested by minoura):
  Reorganize installation system by removing the old script based
  installer, provided for 4M systems.  Instead we provide
  ``floppy-root'' 2-floppy installer.
@
text
@d2 1
a2 1
# $NetBSD: install.tmpl,v 1.10.2.1 2000/09/14 14:15:24 minoura Exp $
@


1.9
log
@fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well.  No functional changes.
@
text
@d2 1
a2 1
# $NetBSD: install.tmpl,v 1.8 1999/04/15 15:20:21 minoura Exp $
d4 1
a5 1
# Copyright (c) 1997 Perry E. Metzger
d7 1
a7 1
#
d18 3
a20 3
#	This product includes software developed by Christopher G. Demetriou.
#	This product includes software developed for the NetBSD Project
#	by Perry E. Metzger.
d22 2
a23 2
#    derived from this software without specific prior written permission
#
d34 2
@


1.8
log
@swapon only if physmem <= 4MB.
Other message cosmetics.
@
text
@d2 1
a2 2
#
#	$NetBSD: install.tmpl,v 1.7 1999/04/02 15:46:34 minoura Exp $
a33 1
#
@


1.7
log
@SMALL kernel is not included in kern.tgz.
@
text
@d3 1
a3 1
#	$NetBSD: install.tmpl,v 1.6 1999/03/24 15:54:46 minoura Exp $
d399 1
a399 1
if [ `cat /kern/physmem` -lt 1536 ]; then # less than 6megs
d402 3
a404 3
	echo	"the swap device you have just configured"
	echo	"especially if you are going to retrieve the distribution sets"
	echo	"via network."
d410 1
a410 1
			echo	"OK, swapping is not enabled."
d422 1
@


1.6
log
@Mostly imported from netbsd-1-3 branch (1.3.3 and 1.3.4)
 - Set ${driveunits} correctly.
 - swapon on small memory machines.
@
text
@d3 1
a3 1
#	$NetBSD: install.tmpl,v 1.5 1999/01/31 17:35:49 minoura Exp $
d420 2
a421 4
	echo	"netbsd.SMALL which is included in the kern.tgz"
	echo	"distribution set instead of the standard kernel."
	echo	"After you have extracted the kern.tgz distribution set,"
	echo	"type \`mv /mnt/netbsd.SMALL /mnt/netbsd'."
@


1.6.2.1
log
@SMALL kernel is not included in kern.tgz.
@
text
@d3 1
a3 1
#	$NetBSD: install.tmpl,v 1.6 1999/03/24 15:54:46 minoura Exp $
d420 4
a423 2
	echo	"netbsd.SMALL in x68k/binary/kernel/ directory instead of"
	echo	"the standard kernel which is included the kern.tgz."
@


1.6.2.2
log
@Pullup rev.1.8.
@
text
@d3 1
a3 1
#	$NetBSD: install.tmpl,v 1.6.2.1 1999/04/02 23:56:29 minoura Exp $
d399 1
a399 1
if [ `cat /kern/physmem` -le 1024 ]; then # less than 4megs
d402 3
a404 3
	echo	"the swap device you have just configured especially if"
	echo	"you are going to retrieve the distribution sets via network."
	echo	""
d410 1
a410 1
			echo	"Good, swapping is not enabled."
a421 1
	echo	""
@


1.5
log
@Setup $driveunits properly.
@
text
@d3 1
a3 1
#	$NetBSD: install.tmpl,v 1.4 1999/01/25 23:34:25 garbled Exp $
d398 27
@


1.4
log
@1) Remove all vestiges of tar from src/distrib.  Use pax and appropriate
commandlines for all tar operations.  (work supplied by Matt Green)
2) Update arch/*/md.c to deal with new sysinst/run.c.  Special case
anything that needs to do a redirect or a pipe.
3) #if 0 some unused code in target.c. This code will need to be updated,
or special cased with do_system.

Big thank you to Matt for all his work on this.
@
text
@d3 1
a3 1
#	$NetBSD: install.tmpl,v 1.3 1998/10/18 15:15:46 minoura Exp $
d101 9
@


1.3
log
@We support only SCSI disks.
@
text
@d3 1
a3 1
#	$NetBSD: install.tmpl,v 1.2 1998/10/01 16:49:10 minoura Exp $
d437 1
a437 1
$DONTDOIT tar --one-file-system -cf - . | (cd /mnt ; tar --unlink -xpf - )
@


1.2
log
@They won't work :-p
@
text
@d3 1
a3 1
#	$NetBSD: install.tmpl,v 1.1 1997/10/19 15:29:10 oki Exp $
a94 28
echo	"NetBSD can be installed on ST506, ESDI, IDE, or SCSI disks."
echo -n	"What kind of disk will you be installing on? [SCSI] "
getresp "SCSI"
case "$resp" in
	esdi|ESDI|st506|ST506)
		drivetype=wd
		echo -n "Does it support _automatic_ sector remapping? [y] "
		getresp "y"
		case "$resp" in
			n*|N*)
				sect_fwd="sf:"
				;;
			*)
				sect_fwd=""
				;;
		esac
		;;
	ide|IDE)
		drivetype=wd
		sect_fwd=""
		type=ST506
		;;
	scsi|SCSI)
		drivetype=sd
		sect_fwd=""
		type=SCSI
		;;
esac
d96 4
a99 9
# find out what units are possible for that disk, and query the user.
driveunits=`ls /dev/${drivetype}?a | sed -e 's,/dev/\(...\)a,\1,g'`
if [ "X${driveunits}" = "X" ]; then
	echo	"FATAL ERROR:"
	echo	"No devices for disks of type '${drivetype}'."
	echo	"This is probably a bug in the install disks."
	echo	"Exiting install program."
	exit
fi
d102 1
@


1.1
log
@Initial commit of installer use ramdisk image.
lifted from i386, modified for x68k by me.
@
text
@d3 1
a3 1
#	$NetBSD: install.tmpl,v 1.3 1997/08/22 18:23:09 perry Exp $
d309 1
a309 1
_offset=$(( $root_offset * $sizemult ))
d313 1
a313 1
_offset=$(( $swap_offset * $sizemult ))
a314 3
_size=$(( $partition * $sizemult ))
_offset=$(( $part_offset * $sizemult ))
echo	"	:pc#${_size}:oc#${_offset}:\\" >> $DT
d431 7
d476 3
d480 1
a480 1
	echo /dev/${drivename}e /$ename ffs rw 1 2 | sed -e s,//,/, >> $FSTAB
d483 1
a483 1
	echo /dev/${drivename}f /$fname ffs rw 1 3 | sed -e s,//,/, >> $FSTAB
d486 1
a486 1
	echo /dev/${drivename}g /$gname ffs rw 1 4 | sed -e s,//,/, >> $FSTAB
d489 1
a489 1
	echo /dev/${drivename}h /$hname ffs rw 1 5 | sed -e s,//,/, >> $FSTAB
@


1.1.2.1
log
@pull up revs 1.2-1.3 from trunk (minoura).
@
text
@d3 1
a3 1
#	$NetBSD: install.tmpl,v 1.1 1997/10/19 15:29:10 oki Exp $
d95 28
d124 9
a132 4
# support only SCSI disks.
drivetype=sd
sect_fwd=""
type=SCSI
a134 1
echo	"NetBSD can be SCSI disks."
d309 1
a309 1
_offset=$(( $root_offset * $sizemult + 64 ))
d313 1
a313 1
_offset=$(( $swap_offset * $sizemult + 64 ))
d315 3
a433 7
if [ "$dname" != "" ]; then
	echo	""
	echo	"Initializing $dname filesystem, and mounting..."
	$DONTDOIT newfs /dev/r${drivename}d $name
	$DONTDOIT mkdir -p /mnt/$dname
	$DONTDOIT mount -v $ASYNC /dev/${drivename}d /mnt/$dname
fi
a471 3
if [ "$dname" != "" ]; then
	echo /dev/${drivename}d /$dname ffs rw 1 2 | sed -e s,//,/, >> $FSTAB
fi
d473 1
a473 1
	echo /dev/${drivename}e /$ename ffs rw 1 3 | sed -e s,//,/, >> $FSTAB
d476 1
a476 1
	echo /dev/${drivename}f /$fname ffs rw 1 4 | sed -e s,//,/, >> $FSTAB
d479 1
a479 1
	echo /dev/${drivename}g /$gname ffs rw 1 5 | sed -e s,//,/, >> $FSTAB
d482 1
a482 1
	echo /dev/${drivename}h /$hname ffs rw 1 6 | sed -e s,//,/, >> $FSTAB
@


1.1.2.2
log
@pull up rev 1.5 from trunk (minoura)
@
text
@d3 1
a3 1
#	$NetBSD: install.tmpl,v 1.1.2.1 1998/10/24 01:05:20 cgd Exp $
a100 9

# find out what units are possible for that disk, and query the user.
driveunits=`ls /dev/${drivetype}?a | sed -e 's,/dev/\(...\)a,\1,g'`
if [ "X${driveunits}" = "X" ]; then
	echo	"No devices for disks of type '${drivetype}'."
	echo	"This is probably a bug in the install disks."
	echo	"Exiting install program."
	exit
fi
@

