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