install.md revision 1.1 1 #!/bin/sh
2 #
3 # $NetBSD: install.md,v 1.1 1997/09/22 23:37:20 scottr Exp $
4 #
5 # Copyright (c) 1996 The NetBSD Foundation, Inc.
6 # All rights reserved.
7 #
8 # This code is derived from software contributed to The NetBSD Foundation
9 # by Jason R. Thorpe.
10 #
11 # Redistribution and use in source and binary forms, with or without
12 # modification, are permitted provided that the following conditions
13 # are met:
14 # 1. Redistributions of source code must retain the above copyright
15 # notice, this list of conditions and the following disclaimer.
16 # 2. Redistributions in binary form must reproduce the above copyright
17 # notice, this list of conditions and the following disclaimer in the
18 # documentation and/or other materials provided with the distribution.
19 # 3. All advertising materials mentioning features or use of this software
20 # must display the following acknowledgement:
21 # This product includes software developed by the NetBSD
22 # Foundation, Inc. and its contributors.
23 # 4. Neither the name of The NetBSD Foundation nor the names of its
24 # contributors may be used to endorse or promote products derived
25 # from this software without specific prior written permission.
26 #
27 # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
28 # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
29 # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
31 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 # POSSIBILITY OF SUCH DAMAGE.
38 #
39
40 #
41 # machine dependent section of installation/upgrade script
42 #
43
44 # Machine-dependent install sets
45 MDSETS=""
46
47 md_set_term() {
48 if [ ! -z "$TERM" ]; then
49 return
50 fi
51 echo -n "Specify terminal type [vt220]: "
52 getresp "vt220"
53 TERM="$resp"
54 export TERM
55 # XXX call tset?
56 }
57
58 md_makerootwritable() {
59 # Was: do_mfs_mount "/tmp" "2048"
60 # /tmp is the mount point
61 # 2048 is the size in DEV_BIZE blocks
62
63 umount /tmp > /dev/null 2>&1
64 if ! mount_mfs -s 2048 swap /tmp ; then
65 cat << \__mfs_failed_1
66
67 FATAL ERROR: Can't mount the memory filesystem.
68
69 __mfs_failed_1
70 exit
71 fi
72
73 # Bleh. Give mount_mfs a chance to DTRT.
74 sleep 2
75 }
76
77 md_get_diskdevs() {
78 # return available disk devices
79 dmesg | grep "^sd[0-9]*:.*cylinders" | cut -d":" -f1 | sort -u
80 }
81
82 md_get_cddevs() {
83 # return available CD-ROM devices
84 dmesg | grep "cd[0-9]*:.*CD-ROM" | cut -d":" -f1 | sort -u
85 }
86
87 md_get_ifdevs() {
88 # return available network interfaces
89 dmesg | grep "^ae[0-9]*:" | cut -d":" -f1 | sort -u
90 dmesg | grep "^sn[0-9]*:" | cut -d":" -f1 | sort -u
91 }
92
93 md_installboot() {
94 # $1 is the root disk
95
96 # We don't have boot blocks. Sigh.
97 }
98
99 md_checkfordisklabel() {
100 # $1 is the disk to check
101
102 # We don't support labels on the mac68k port. (Yet.)
103
104 rval="0"
105 }
106
107 md_labeldisk() {
108 # $1 is the disk to label
109
110 # We don't support labels on the mac68k port. (Yet.)
111 }
112
113 md_prep_disklabel() {
114 # $1 is the root disk
115
116 # We don't support labels on the mac68k port. (Yet.)
117 }
118
119 md_copy_kernel() {
120 echo -n "Copying kernel..."
121 cp -p /netbsd /mnt/netbsd
122 echo "done."
123 }
124
125 # Note, while they might not seem machine-dependent, the
126 # welcome banner and the punt message may contain information
127 # and/or instructions specific to the type of machine.
128
129 md_welcome_banner() {
130 (
131 echo ""
132 echo "Welcome to the NetBSD/mac68k ${VERSION} installation program."
133 cat << \__welcome_banner_1
134
135 This program is designed to help you install NetBSD on your system in a
136 simple and rational way. You'll be asked several questions, and it would
137 probably be useful to have your disk's hardware manual, the installation
138 notes, and a calculator handy.
139
140 In particular, you will need to know some reasonably detailed
141 information about your disk's geometry. This program can determine
142 some limited information about certain specific types of HP-IB disks.
143 If you have SCSI disks, however, prior knowledge of disk geometry
144 is absolutely essential. The kernel will attempt to display geometry
145 information for SCSI disks during boot, if possible. If you did not
146 make it note of it before, you may wish to reboot and jot down your
147 disk's geometry before proceeding.
148
149 As with anything which modifies your hard disk's contents, this
150 program can cause SIGNIFICANT data loss, and you are advised
151 to make sure your hard drive is backed up before beginning the
152 installation process.
153
154 Default answers are displyed in brackets after the questions.
155 You can hit Control-C at any time to quit, but if you do so at a
156 prompt, you may have to hit return. Also, quitting in the middle of
157 installation may leave your system in an inconsistent state.
158
159 __welcome_banner_1
160 ) | more
161 }
162
163 md_not_going_to_install() {
164 cat << \__not_going_to_install_1
165
166 OK, then. Enter 'halt' at the prompt to halt the machine. Once the
167 machine has halted, power-cycle the system to load new boot code.
168
169 __not_going_to_install_1
170 }
171
172 md_congrats() {
173 cat << \__congratulations_1
174
175 CONGRATULATIONS! You have successfully installed NetBSD! To boot the
176 installed system, enter halt at the command prompt. Once the system has
177 halted, power-cycle the machine in order to load new boot code. Make sure
178 you boot from the root disk.
179
180 __congratulations_1
181 }
182
183 md_native_fstype() {
184 # Nothing to do.
185 }
186
187 md_native_fsopts() {
188 # Nothing to do.
189 }
190