Home | History | Annotate | Line # | Download | only in inst
      1  1.9    salo # $NetBSD: dot.instutils,v 1.9 2003/07/26 17:06:28 salo Exp $
      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.8     cgd #          This product includes software developed for the
     17  1.9    salo #          NetBSD Project.  See http://www.NetBSD.org/ for
     18  1.8     cgd #          information about NetBSD.
     19  1.1  chopps # 4. The name of the author may not be used to endorse or promote products
     20  1.8     cgd #    derived from this software without specific prior written permission.
     21  1.8     cgd # 
     22  1.1  chopps # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     23  1.1  chopps # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     24  1.1  chopps # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     25  1.1  chopps # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     26  1.1  chopps # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     27  1.1  chopps # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     28  1.1  chopps # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     29  1.1  chopps # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     30  1.1  chopps # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     31  1.1  chopps # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     32  1.8     cgd # 
     33  1.8     cgd # <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>
     34  1.1  chopps 
     35  1.1  chopps # Installation configuration utilites (functions), to get NetBSD configured
     36  1.1  chopps # reasonably once it is installed on the hard disk.  These are meant to be
     37  1.1  chopps # invoked from the shell prompt, by people installing NetBSD.
     38  1.1  chopps 
     39  1.1  chopps Configure()
     40  1.1  chopps {
     41  1.1  chopps 	DEV=/mnt/dev
     42  1.1  chopps 	ETC=/mnt/etc
     43  1.1  chopps 
     44  1.1  chopps 	echo	"You will now be prompted for information about this"
     45  1.1  chopps 	echo	"machine.  If you hit return, the default answer (in"
     46  1.1  chopps 	echo	"brackets) will be used."
     47  1.1  chopps 
     48  1.1  chopps 	echo	""
     49  1.1  chopps 	echo -n	"What is this machine's hostname? [unknown.host.domain] "
     50  1.1  chopps 	read hname
     51  1.1  chopps 	if [ "$hname" = "" ]; then
     52  1.1  chopps 		hname=unknown.host.domain
     53  1.1  chopps 	fi
     54  1.1  chopps 	echo $hname > ${ETC}/myname
     55  1.1  chopps 	proto_domain=`echo $hname | sed -e 's/[^.]*\.//'`
     56  1.1  chopps 
     57  1.1  chopps 	echo	""
     58  1.1  chopps 	echo	"What domain is this machine in (this is NOT its YP"
     59  1.1  chopps 	echo -n	"domain name)? [$proto_domain] "
     60  1.1  chopps 	read dname
     61  1.1  chopps 	if [ "$dname" = "" ]; then
     62  1.1  chopps 		dname=$proto_domain
     63  1.1  chopps 	fi
     64  1.1  chopps 
     65  1.1  chopps 	echo	""
     66  1.2  chopps 	if [ -e /mnt/etc/sendmail.cf ]; then
     67  1.1  chopps 		echo	"WARNING: A default sendmail.cf exists, and probably"
     68  1.1  chopps 		echo	"needs to be tuned and/or replaced, to work properly at"
     69  1.1  chopps 		echo	"your site!"
     70  1.1  chopps 	else
     71  1.1  chopps 		echo	"WARNING: No default sendmail.cf installed.  Did you"
     72  1.1  chopps 		echo	"forget to install the 'etc' distribution?"
     73  1.1  chopps 	fi
     74  1.1  chopps 
     75  1.1  chopps 	echo	"127.0.0.1	localhost localhost.$dname" > ${ETC}/hosts
     76  1.1  chopps 
     77  1.1  chopps 	echo	""
     78  1.1  chopps 	echo -n	"Does this machine have an ethernet interface? [y] "
     79  1.1  chopps         read resp
     80  1.1  chopps         case "$resp" in
     81  1.1  chopps 	n*)
     82  1.1  chopps 		;;
     83  1.1  chopps 	*)
     84  1.1  chopps 		intf=
     85  1.1  chopps 		while [ "$intf" = "" ]; do
     86  1.1  chopps 			echo -n "What is the primary interface name "
     87  1.2  chopps 			echo -n "(e.g. ae0, ed0, le0, or es0)? "
     88  1.1  chopps 			read intf
     89  1.1  chopps 		done
     90  1.1  chopps 		echo -n "What is the hostname for this interface? [$hname] "
     91  1.1  chopps 		read ifname
     92  1.1  chopps 		if [ "$ifname" = "" ]; then
     93  1.1  chopps 			ifname=$hname
     94  1.1  chopps 		fi
     95  1.1  chopps 		ifaddr=
     96  1.1  chopps 		while [ "$ifaddr" = "" ]; do
     97  1.1  chopps 			echo -n "What is the IP address associated with "
     98  1.1  chopps 			echo -n "interface ${intf}? "
     99  1.1  chopps 			read ifaddr
    100  1.1  chopps 		done
    101  1.1  chopps 		echo "$ifaddr	$ifname `echo $ifname | sed -e s/\.$dname//`" \
    102  1.1  chopps 		    >> ${ETC}/hosts
    103  1.1  chopps 
    104  1.1  chopps 		echo -n "Does this interface have a special netmask? [n] "
    105  1.1  chopps 		read resp
    106  1.1  chopps 		case "$resp" in
    107  1.1  chopps 			y*)
    108  1.1  chopps 				echo -n "What is the netmask? [0xffffff00] "
    109  1.1  chopps 				read ifnetmask
    110  1.1  chopps 				if [ "$ifnetmask" = "" ]; then
    111  1.1  chopps 					ifnetmask=0xffffff00
    112  1.1  chopps 				fi
    113  1.1  chopps 				;;
    114  1.1  chopps 			*)
    115  1.1  chopps 				ifnetmask=
    116  1.1  chopps 				;;
    117  1.1  chopps 		esac
    118  1.1  chopps 
    119  1.1  chopps 		echo -n "Does this interface need additional flags? [n] "
    120  1.1  chopps 		read resp
    121  1.1  chopps 		case "$resp" in
    122  1.1  chopps 			y*)
    123  1.1  chopps 				echo -n "What flags? [link0] "
    124  1.1  chopps 				read ifflags
    125  1.1  chopps 				if [ "$ifflags" = "" ]; then
    126  1.1  chopps 					ifflags=link0
    127  1.1  chopps 				fi
    128  1.1  chopps 				;;
    129  1.1  chopps 			*)
    130  1.1  chopps 				ifflags=
    131  1.1  chopps 				;;
    132  1.1  chopps 		esac
    133  1.1  chopps 		echo "inet $ifname $ifnetmask $ifflags" > ${ETC}/hostname.$intf
    134  1.1  chopps 
    135  1.1  chopps 		echo    ""
    136  1.1  chopps 		echo -n	"WARNING: if you have any more ethernet interfaces, "
    137  1.1  chopps 		echo	"you will have to configure"
    138  1.6   lukem 		echo -n "them by hand.  Read the comments in /etc/rc.d/network "
    139  1.6   lukem 		echo	"to learn how to do this."
    140  1.1  chopps 		;;
    141  1.1  chopps 	esac
    142  1.1  chopps 	
    143  1.1  chopps 	echo	""
    144  1.2  chopps 	echo -n	"Making device nodes (may take a while)..."
    145  1.1  chopps 	cd ${DEV}
    146  1.1  chopps 	sh MAKEDEV all
    147  1.1  chopps 	echo	" done."
    148  1.1  chopps 
    149  1.3      is         echo    ""
    150  1.3      is         echo -n "Copying the kernel..."
    151  1.3      is         cp /netbsd /mnt/netbsd
    152  1.3      is         echo    "Done."
    153  1.3      is 	echo -n "Installing boot block..."
    154  1.3      is 	read rdev rest < /mnt/etc/fstab
    155  1.4      is 	/mnt/usr/mdec/installboot /mnt/usr/mdec/xxboot `echo $rdev | sed -e 's^/dev/^/dev/r^'`
    156  1.3      is 	echo	" done."
    157  1.3      is 
    158  1.1  chopps 	sync
    159  1.1  chopps 
    160  1.1  chopps 	echo	""
    161  1.3      is 	echo	"You should now halt your machine using the 'halt' command."
    162  1.3      is 	echo	"Once the machine is halted, reboot it."
    163  1.1  chopps }
    164