2 # $NetBSD: install.sh,v 1.1.1.1 2002/04/12 21:11:46 leo Exp $
4 # Copyright (c) 1996 The NetBSD Foundation, Inc.
7 # This code is derived from software contributed to The NetBSD Foundation
10 # Redistribution and use in source and binary forms, with or without
11 # modification, are permitted provided that the following conditions
13 # 1. Redistributions of source code must retain the above copyright
14 # notice, this list of conditions and the following disclaimer.
15 # 2. Redistributions in binary form must reproduce the above copyright
16 # notice, this list of conditions and the following disclaimer in the
17 # documentation and/or other materials provided with the distribution.
19 # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 # POSSIBILITY OF SUCH DAMAGE.
32 # NetBSD installation script.
33 # In a perfect world, this would be a nice C program, with a reasonable
36 FILESYSTEMS
="/tmp/filesystems" # used thoughout
39 # include machine-dependent functions
40 # The following functions must be provided:
41 # md_prep_disklabel() - label the root disk
42 # md_welcome_banner() - display friendly message
43 # md_congrats() - display friendly message
44 # md_makerootwritable() - make root writable (at least /tmp)
46 # we need to make sure .'s below work if this directory is not in $PATH
47 # dirname may not be available but expr is
48 Mydir
=`expr $0 : '^\(.*\)/[^/]*$'`
49 Mydir
=`cd ${Mydir:-.}; pwd`
56 if [ "X$resp" = "X" ]; then
62 # test the first argument against the remaining ones, return succes on a match
65 if [ "$_a" = "$1" ]; then return 0; fi
72 cat << \__getrootdisk_1
74 The installation program needs to know
which disk to consider
75 the root disk. Note the unit number may be different than
76 the unit number you used
in the standalone installation
82 _DKDEVS
=`md_get_diskdevs`
85 echo -n "Which disk is the root disk? "
87 if isin
$resp $_DKDEVS ; then
91 echo "The disk $resp does not exist."
97 cat << \__labelmoredisks_1
99 You may label the following disks
:
104 echo -n "Label which disk? [done] "
111 if isin
$resp $_DKDEVS ; then
115 echo "The disk $resp does not exist."
122 # include machine dependent subroutines
125 # Good {morning,afternoon,evening,night}.
127 echo -n "Proceed? [n] "
131 echo "Cool! Let's get to it..."
134 md_not_going_to_install
139 # XXX Work around vnode aliasing bug (thanks for the tip, Chris...)
140 ls -l /dev
> /dev
/null
2>&1
142 # Deal with terminal issues
145 # Make sure we can write files (at least in /tmp)
146 # This might make an MFS mount on /tmp, or it may
147 # just re-mount the root with read-write enabled.
150 while [ "X${ROOTDISK}" = "X" ]; do
154 # Deal with disklabels, including editing the root disklabel
155 # and labeling additional disks. This is machine-dependent since
156 # some platforms may not be able to provide this functionality.
157 md_prep_disklabel
${ROOTDISK}