Home | History | Annotate | Line # | Download | only in inst
dot.instutils revision 1.7
      1  1.7     cgd # $NetBSD: dot.instutils,v 1.7 2000/06/14 06:48:48 cgd 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.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 # Installation configuration utilites (functions), to get NetBSD configured
     32  1.1  chopps # reasonably once it is installed on the hard disk.  These are meant to be
     33  1.1  chopps # invoked from the shell prompt, by people installing NetBSD.
     34  1.1  chopps 
     35  1.1  chopps Configure()
     36  1.1  chopps {
     37  1.1  chopps 	DEV=/mnt/dev
     38  1.1  chopps 	ETC=/mnt/etc
     39  1.1  chopps 
     40  1.1  chopps 	echo	"You will now be prompted for information about this"
     41  1.1  chopps 	echo	"machine.  If you hit return, the default answer (in"
     42  1.1  chopps 	echo	"brackets) will be used."
     43  1.1  chopps 
     44  1.1  chopps 	echo	""
     45  1.1  chopps 	echo -n	"What is this machine's hostname? [unknown.host.domain] "
     46  1.1  chopps 	read hname
     47  1.1  chopps 	if [ "$hname" = "" ]; then
     48  1.1  chopps 		hname=unknown.host.domain
     49  1.1  chopps 	fi
     50  1.1  chopps 	echo $hname > ${ETC}/myname
     51  1.1  chopps 	proto_domain=`echo $hname | sed -e 's/[^.]*\.//'`
     52  1.1  chopps 
     53  1.1  chopps 	echo	""
     54  1.1  chopps 	echo	"What domain is this machine in (this is NOT its YP"
     55  1.1  chopps 	echo -n	"domain name)? [$proto_domain] "
     56  1.1  chopps 	read dname
     57  1.1  chopps 	if [ "$dname" = "" ]; then
     58  1.1  chopps 		dname=$proto_domain
     59  1.1  chopps 	fi
     60  1.1  chopps 
     61  1.1  chopps 	echo	""
     62  1.2  chopps 	if [ -e /mnt/etc/sendmail.cf ]; then
     63  1.1  chopps 		echo	"WARNING: A default sendmail.cf exists, and probably"
     64  1.1  chopps 		echo	"needs to be tuned and/or replaced, to work properly at"
     65  1.1  chopps 		echo	"your site!"
     66  1.1  chopps 	else
     67  1.1  chopps 		echo	"WARNING: No default sendmail.cf installed.  Did you"
     68  1.1  chopps 		echo	"forget to install the 'etc' distribution?"
     69  1.1  chopps 	fi
     70  1.1  chopps 
     71  1.1  chopps 	echo	"127.0.0.1	localhost localhost.$dname" > ${ETC}/hosts
     72  1.1  chopps 
     73  1.1  chopps 	echo	""
     74  1.1  chopps 	echo -n	"Does this machine have an ethernet interface? [y] "
     75  1.1  chopps         read resp
     76  1.1  chopps         case "$resp" in
     77  1.1  chopps 	n*)
     78  1.1  chopps 		;;
     79  1.1  chopps 	*)
     80  1.1  chopps 		intf=
     81  1.1  chopps 		while [ "$intf" = "" ]; do
     82  1.1  chopps 			echo -n "What is the primary interface name "
     83  1.2  chopps 			echo -n "(e.g. ae0, ed0, le0, or es0)? "
     84  1.1  chopps 			read intf
     85  1.1  chopps 		done
     86  1.1  chopps 		echo -n "What is the hostname for this interface? [$hname] "
     87  1.1  chopps 		read ifname
     88  1.1  chopps 		if [ "$ifname" = "" ]; then
     89  1.1  chopps 			ifname=$hname
     90  1.1  chopps 		fi
     91  1.1  chopps 		ifaddr=
     92  1.1  chopps 		while [ "$ifaddr" = "" ]; do
     93  1.1  chopps 			echo -n "What is the IP address associated with "
     94  1.1  chopps 			echo -n "interface ${intf}? "
     95  1.1  chopps 			read ifaddr
     96  1.1  chopps 		done
     97  1.1  chopps 		echo "$ifaddr	$ifname `echo $ifname | sed -e s/\.$dname//`" \
     98  1.1  chopps 		    >> ${ETC}/hosts
     99  1.1  chopps 
    100  1.1  chopps 		echo -n "Does this interface have a special netmask? [n] "
    101  1.1  chopps 		read resp
    102  1.1  chopps 		case "$resp" in
    103  1.1  chopps 			y*)
    104  1.1  chopps 				echo -n "What is the netmask? [0xffffff00] "
    105  1.1  chopps 				read ifnetmask
    106  1.1  chopps 				if [ "$ifnetmask" = "" ]; then
    107  1.1  chopps 					ifnetmask=0xffffff00
    108  1.1  chopps 				fi
    109  1.1  chopps 				;;
    110  1.1  chopps 			*)
    111  1.1  chopps 				ifnetmask=
    112  1.1  chopps 				;;
    113  1.1  chopps 		esac
    114  1.1  chopps 
    115  1.1  chopps 		echo -n "Does this interface need additional flags? [n] "
    116  1.1  chopps 		read resp
    117  1.1  chopps 		case "$resp" in
    118  1.1  chopps 			y*)
    119  1.1  chopps 				echo -n "What flags? [link0] "
    120  1.1  chopps 				read ifflags
    121  1.1  chopps 				if [ "$ifflags" = "" ]; then
    122  1.1  chopps 					ifflags=link0
    123  1.1  chopps 				fi
    124  1.1  chopps 				;;
    125  1.1  chopps 			*)
    126  1.1  chopps 				ifflags=
    127  1.1  chopps 				;;
    128  1.1  chopps 		esac
    129  1.1  chopps 		echo "inet $ifname $ifnetmask $ifflags" > ${ETC}/hostname.$intf
    130  1.1  chopps 
    131  1.1  chopps 		echo    ""
    132  1.1  chopps 		echo -n	"WARNING: if you have any more ethernet interfaces, "
    133  1.1  chopps 		echo	"you will have to configure"
    134  1.6   lukem 		echo -n "them by hand.  Read the comments in /etc/rc.d/network "
    135  1.6   lukem 		echo	"to learn how to do this."
    136  1.1  chopps 		;;
    137  1.1  chopps 	esac
    138  1.1  chopps 	
    139  1.1  chopps 	echo	""
    140  1.2  chopps 	echo -n	"Making device nodes (may take a while)..."
    141  1.1  chopps 	cd ${DEV}
    142  1.1  chopps 	sh MAKEDEV all
    143  1.1  chopps 	echo	" done."
    144  1.1  chopps 
    145  1.3      is         echo    ""
    146  1.3      is         echo -n "Copying the kernel..."
    147  1.3      is         cp /netbsd /mnt/netbsd
    148  1.3      is         echo    "Done."
    149  1.3      is 	echo -n "Installing boot block..."
    150  1.3      is 	read rdev rest < /mnt/etc/fstab
    151  1.4      is 	/mnt/usr/mdec/installboot /mnt/usr/mdec/xxboot `echo $rdev | sed -e 's^/dev/^/dev/r^'`
    152  1.3      is 	echo	" done."
    153  1.3      is 
    154  1.1  chopps 	sync
    155  1.1  chopps 
    156  1.1  chopps 	echo	""
    157  1.3      is 	echo	"You should now halt your machine using the 'halt' command."
    158  1.3      is 	echo	"Once the machine is halted, reboot it."
    159  1.1  chopps }
    160