1 # $NetBSD: install.md,v 1.2 2008/04/30 13:10:48 martin 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.
33 # machine dependent section of installation/upgrade script.
36 VERSION= # filled in automatically (see list)
40 if [ ! -z "$TERM" ]; then
43 echo -n "Specify terminal type [vt220]: "
49 md_makerootwritable() {
50 # Mount root rw for convenience of the tester ;-)
51 if [ ! -e /tmp/.root_writable ]; then
52 rootdev=/dev/$(sysctl -n kern.root_device)$(sysctl -n kern.root_partition | sed y/0123456789/abcdefghij/)
53 mount -t ffs -u $rootdev / > /dev/null 2>&1
54 cp /dev/null /tmp/.root_writable
59 # return available disk devices
60 sysctl -n hw.disknames | sed 'y/ /\n/' | sed -n '/^[sw]d[0-9]/p' \
67 # Note that the first part of this function is just a *very* verbose
68 # version of md_label_disk().
70 cat << \__md_prep_disklabel_1
71 You now have to prepare your root disk for the installation of NetBSD. This
72 is further referred to as 'labeling' a disk.
74 First you get the chance to edit or create an AHDI compatible partitioning on
75 the installation disk. Note that NetBSD can do without AHDI partitions,
76 check the documentation.
77 If you want to use an AHDI compatible partitioning, you have to assign some
78 partitions to NetBSD before NetBSD is able to use the disk. Change the 'id'
79 of all partitions you want to use for NetBSD filesystems to 'NBD'. Change
80 the 'id' of the partition you wish to use for swap to 'SWP'.
82 Hit the <return> key when you have read this...
88 cat << \__md_prep_disklabel_3
89 Here is an example of what the partition information will look like once
90 you have entered the disklabel editor. Disk partition sizes and offsets
91 are in sector (most likely 512 bytes) units.
94 partition start (c/t/s) nblks (c/t/s) type
96 a (root) 0 (0/00/00) 31392 (109/00/00) 4.2BSD
97 b (swap) 31392 (109/00/00) 73440 (255/00/00) swap
98 c (disk) 0 (0/00/00) 1070496 (3717/00/00) unused
99 d (user) 104832 (364/00/00) 30528 (106/00/00) 4.2BSD
100 e (user) 135360 (470/00/00) 40896 (142/00/00) 4.2BSD
101 f (user) 176256 (612/00/00) 92160 (320/00/00) 4.2BSD
102 g (user) 268416 (932/00/00) 802080 (2785/00/00) 4.2BSD
106 Hit the <return> key when you have read this...
108 __md_prep_disklabel_3
112 cat << \__md_prep_disklabel_4
114 You will now be given the opportunity to place disklabels on any additional
115 disks on your system.
116 __md_prep_disklabel_4
118 _DKDEVS=`rmel ${1} ${_DKDEVS}`
119 resp="X" # force at least one iteration
120 while [ "X$resp" != X"done" ]; do
126 edahdi /dev/r${1}c < /dev/null > /dev/null 2>&1
127 [ $? -eq 0 ] && edahdi /dev/r${1}c
131 md_welcome_banner() {
133 echo "Welcome to the NetBSD/atari ${VERSION} preparation program."
134 cat << \__welcome_banner_1
136 This program is designed to partition your disk in preparation of the
137 NetBSD installation. At this stage, the only thing you _must_ setup
138 is a swap partition. If you wish, the remaining partitioning work might
139 be delayed until the actual installation.
141 As with anything which modifies your disk's contents, this
142 program can cause SIGNIFICANT data loss, and you are advised
143 to make sure your data is backed up before beginning the
146 Default answers are displayed in brackets after the questions.
147 You can hit Control-C at any time to quit, but if you do so at a
148 prompt, you may have to hit return.
152 md_not_going_to_install() {
153 cat << \__not_going_to_install_1
155 OK, then. Enter `halt' at the prompt to halt the machine. Once the
156 machine has halted, power-cycle the system to load new boot code.
158 Note: If you wish to have another try. Just type '^D' at the prompt. After
159 a moment, the program will restart itself.
161 __not_going_to_install_1
165 cat << __congratulations_1
167 CONGRATULATIONS! You have successfully partitioned your disks!
168 Now you can use file2swap.ttp to transfer the install.fs to your
169 swap partition and continue the installation.
170 Enter halt at the command prompt. Once the system has halted, reset the
171 machine and re-boot it.
173 Note: If you wish to have another try. Just type '^D' at the prompt. After
174 a moment, the installer will restart itself.