install.md revision 1.1 1 1.1 pk # $NetBSD: install.md,v 1.1 1996/01/06 22:42:13 pk Exp $
2 1.1 pk #
3 1.1 pk # Copyright (c) 1995 Jason R. Thorpe.
4 1.1 pk # All rights reserved.
5 1.1 pk #
6 1.1 pk # Redistribution and use in source and binary forms, with or without
7 1.1 pk # modification, are permitted provided that the following conditions
8 1.1 pk # are met:
9 1.1 pk # 1. Redistributions of source code must retain the above copyright
10 1.1 pk # notice, this list of conditions and the following disclaimer.
11 1.1 pk # 2. Redistributions in binary form must reproduce the above copyright
12 1.1 pk # notice, this list of conditions and the following disclaimer in the
13 1.1 pk # documentation and/or other materials provided with the distribution.
14 1.1 pk # 3. All advertising materials mentioning features or use of this software
15 1.1 pk # must display the following acknowledgement:
16 1.1 pk # This product includes software developed for the NetBSD Project
17 1.1 pk # by Jason R. Thorpe.
18 1.1 pk # 4. The name of the author may not be used to endorse or promote products
19 1.1 pk # derived from this software without specific prior written permission
20 1.1 pk #
21 1.1 pk # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 1.1 pk # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 1.1 pk # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 1.1 pk # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 1.1 pk # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 1.1 pk # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 1.1 pk # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 1.1 pk # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 1.1 pk # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 1.1 pk # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 1.1 pk #
32 1.1 pk
33 1.1 pk #
34 1.1 pk # machine dependent section of installation/upgrade script.
35 1.1 pk #
36 1.1 pk
37 1.1 pk md_set_term() {
38 1.1 pk if [ ! -z "$TERM" ]; then
39 1.1 pk return
40 1.1 pk fi
41 1.1 pk echo -n "Specify terminal type [sun]: "
42 1.1 pk getresp "sun"
43 1.1 pk TERM="$resp"
44 1.1 pk export TERM
45 1.1 pk }
46 1.1 pk
47 1.1 pk md_get_diskdevs() {
48 1.1 pk # return available disk devices
49 1.1 pk dmesg | egrep "(^sd[0-9] |^x[dy][0-9] )" | cut -d" " -f1 | sort -u
50 1.1 pk }
51 1.1 pk
52 1.1 pk md_get_cddevs() {
53 1.1 pk # return available CDROM devices
54 1.1 pk dmesg | grep "^cd[0-9] " | cut -d" " -f1 | sort -u
55 1.1 pk }
56 1.1 pk
57 1.1 pk md_get_ifdevs() {
58 1.1 pk # return available network devices
59 1.1 pk dmesg | egrep "(^le[0-9] |^ie[0-9] )" | cut -d" " -f1 | sort -u
60 1.1 pk }
61 1.1 pk
62 1.1 pk md_installboot() {
63 1.1 pk echo "Installing boot block..."
64 1.1 pk /usr/mdec/binstall -v ffs /mnt
65 1.1 pk }
66 1.1 pk
67 1.1 pk md_checkfordisklabel() {
68 1.1 pk # $1 is the disk to check
69 1.1 pk
70 1.1 pk disklabel $1 > /dev/null 2> /tmp/checkfordisklabel
71 1.1 pk if grep "no disk label" /tmp/checkfordisklabel; then
72 1.1 pk rval="1"
73 1.1 pk elif grep "disk label corrupted" /tmp/checkfordisklabel; then
74 1.1 pk rval="2"
75 1.1 pk else
76 1.1 pk rval="0"
77 1.1 pk fi
78 1.1 pk
79 1.1 pk rm -f /tmp/checkfordisklabel
80 1.1 pk }
81 1.1 pk
82 1.1 pk md_prep_disklabel()
83 1.1 pk {
84 1.1 pk # display example
85 1.1 pk cat << \__md_prep_disklabel_1
86 1.1 pk Here is an example of what the partition information will look like once
87 1.1 pk you have entered the disklabel editor. Disk partition sizes and offsets
88 1.1 pk are in sector (most likely 512 bytes) units. Make sure these size/offset
89 1.1 pk pairs are on cylinder boundaries (the number of sector per cylinder is
90 1.1 pk given in the `sectors/cylinder' entry, which is not shown here).
91 1.1 pk
92 1.1 pk Do not change any parameters except the partition layout and the label name.
93 1.1 pk It's probably also wisest not to touch the `8 partitions:' line, even
94 1.1 pk in case you have defined less than eight partitions.
95 1.1 pk
96 1.1 pk [Example]
97 1.1 pk 8 partitions:
98 1.1 pk # size offset fstype [fsize bsize cpg]
99 1.1 pk a: 50176 0 4.2BSD 1024 8192 16 # (Cyl. 0 - 111)
100 1.1 pk b: 64512 50176 swap # (Cyl. 112 - 255)
101 1.1 pk c: 640192 0 unknown # (Cyl. 0 - 1428)
102 1.1 pk d: 525504 114688 4.2BSD 1024 8192 16 # (Cyl. 256 - 1428)
103 1.1 pk [End of example]
104 1.1 pk
105 1.1 pk __md_prep_disklabel_1
106 1.1 pk }
107 1.1 pk
108 1.1 pk md_welcome_banner() {
109 1.1 pk {
110 1.1 pk if [ "$MODE" = "install" ]; then
111 1.1 pk echo ""
112 1.1 pk echo "Welcome to the NetBSD/sparc ${VERSION} installation program."
113 1.1 pk cat << \__welcome_banner_1
114 1.1 pk
115 1.1 pk This program is designed to help you put NetBSD on your disk,
116 1.1 pk in a simple and rational way. You'll be asked several questions,
117 1.1 pk and it would probably be useful to have your disk's hardware
118 1.1 pk manual, the installation notes, and a calculator handy.
119 1.1 pk __welcome_banner_1
120 1.1 pk
121 1.1 pk else
122 1.1 pk echo ""
123 1.1 pk echo "Welcome to the NetBSD/sparc ${VERSION} upgrade program."
124 1.1 pk cat << \__welcome_banner_2
125 1.1 pk
126 1.1 pk This program is designed to help you upgrade your NetBSD system in a
127 1.1 pk simple and rational way.
128 1.1 pk
129 1.1 pk As a reminder, installing the `etc' binary set is NOT recommended.
130 1.1 pk Once the rest of your system has been upgraded, you should manually
131 1.1 pk merge any changes to files in the `etc' set into those files which
132 1.1 pk already exist on your system.
133 1.1 pk __welcome_banner_2
134 1.1 pk fi
135 1.1 pk
136 1.1 pk cat << \__welcome_banner_3
137 1.1 pk
138 1.1 pk As with anything which modifies your disk's contents, this
139 1.1 pk program can cause SIGNIFICANT data loss, and you are advised
140 1.1 pk to make sure your data is backed up before beginning the
141 1.1 pk installation process.
142 1.1 pk
143 1.1 pk Default answers are displyed in brackets after the questions.
144 1.1 pk You can hit Control-C at any time to quit, but if you do so at a
145 1.1 pk prompt, you may have to hit return. Also, quitting in the middle of
146 1.1 pk installation may leave your system in an inconsistent state.
147 1.1 pk
148 1.1 pk __welcome_banner_3
149 1.1 pk } | more
150 1.1 pk }
151 1.1 pk
152 1.1 pk md_not_going_to_install() {
153 1.1 pk cat << \__not_going_to_install_1
154 1.1 pk
155 1.1 pk OK, then. Enter `halt' at the prompt to halt the machine. Once the
156 1.1 pk machine has halted, power-cycle the system to load new boot code.
157 1.1 pk
158 1.1 pk __not_going_to_install_1
159 1.1 pk }
160 1.1 pk
161 1.1 pk md_congrats() {
162 1.1 pk local what;
163 1.1 pk if [ "$MODE" = "install" ]; then
164 1.1 pk what="installed";
165 1.1 pk else
166 1.1 pk what="upgraded";
167 1.1 pk fi
168 1.1 pk cat << __congratulations_1
169 1.1 pk
170 1.1 pk CONGRATULATIONS! You have successfully $what NetBSD!
171 1.1 pk To boot the installed system, enter halt at the command prompt. Once the
172 1.1 pk system has halted, reset the machine and boot from the disk.
173 1.1 pk
174 1.1 pk __congratulations_1
175 1.1 pk }
176