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