xref: /netbsd-src/distrib/mac68k/miniroot/install.md (revision 1b9578b8c2c1f848eeb16dabbfd7d1f0d9fdefbd)
1#!/bin/sh
2#
3#	$NetBSD: install.md,v 1.4 2008/04/30 13:10:48 martin 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
38MDSETS=""
39
40md_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
51md_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
60FATAL 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
70md_get_diskdevs() {
71	# return available disk devices
72	dmesg | awk -F : '/^sd[0-9]*:.*cylinders/ { print $1; }' | sort -u
73}
74
75md_get_cddevs() {
76	# return available CD-ROM devices
77	dmesg | awk -F : '/cd[0-9]*:.*CD-ROM/ { print $1; }' | sort -u
78}
79
80md_get_ifdevs() {
81	# return available network interfaces
82	dmesg | awk -F : '/^ae[0-9]*:/ { print $1; }' | sort -u
83	dmesg | awk -F : '/^sn[0-9]*:/ { print $1; }' | sort -u
84}
85
86md_installboot() {
87	# $1 is the root disk
88
89	# We don't have boot blocks.  Sigh.
90}
91
92md_checkfordisklabel() {
93	# $1 is the disk to check
94
95	# We don't support labels on the mac68k port.  (Yet.)
96
97	rval="0"
98}
99
100md_labeldisk() {
101	# $1 is the disk to label
102
103	# We don't support labels on the mac68k port.  (Yet.)
104}
105
106md_prep_disklabel() {
107	# $1 is the root disk
108
109	# We don't support labels on the mac68k port.  (Yet.)
110}
111
112md_copy_kernel() {
113	echo -n "Copying kernel..."
114	cp -p /netbsd /mnt/netbsd
115	echo "done."
116}
117
118	# Note, while they might not seem machine-dependent, the
119	# welcome banner and the punt message may contain information
120	# and/or instructions specific to the type of machine.
121
122md_welcome_banner() {
123(
124	echo	""
125	echo	"Welcome to the NetBSD/mac68k ${VERSION} installation program."
126	cat << \__welcome_banner_1
127
128This program is designed to help you install NetBSD on your system in a
129simple and rational way.  You'll be asked several questions, and it would
130probably be useful to have your disk's hardware manual, the installation
131notes, and a calculator handy.
132
133In particular, you will need to know some reasonably detailed
134information about your disk's geometry.  This program can determine
135some limited information about certain specific types of HP-IB disks.
136If you have SCSI disks, however, prior knowledge of disk geometry
137is absolutely essential.  The kernel will attempt to display geometry
138information for SCSI disks during boot, if possible.  If you did not
139make it note of it before, you may wish to reboot and jot down your
140disk's geometry before proceeding.
141
142As with anything which modifies your hard disk's contents, this
143program can cause SIGNIFICANT data loss, and you are advised
144to make sure your hard drive is backed up before beginning the
145installation process.
146
147Default answers are displyed in brackets after the questions.
148You can hit Control-C at any time to quit, but if you do so at a
149prompt, you may have to hit return.  Also, quitting in the middle of
150installation may leave your system in an inconsistent state.
151
152__welcome_banner_1
153) | more
154}
155
156md_not_going_to_install() {
157		cat << \__not_going_to_install_1
158
159OK, then.  Enter 'halt' at the prompt to halt the machine.  Once the
160machine has halted, power-cycle the system to load new boot code.
161
162__not_going_to_install_1
163}
164
165md_congrats() {
166	cat << \__congratulations_1
167
168CONGRATULATIONS!  You have successfully installed NetBSD!  To boot the
169installed system, enter halt at the command prompt.  Once the system has
170halted, power-cycle the machine in order to load new boot code.  Make sure
171you boot from the root disk.
172
173__congratulations_1
174}
175
176md_native_fstype() {
177	# Nothing to do.
178}
179
180md_native_fsopts() {
181	# Nothing to do.
182}
183