Home | History | Annotate | Line # | Download | only in miniroot
install.md revision 1.5
      1 #!/bin/sh
      2 #
      3 #	$NetBSD: install.md,v 1.5 2019/04/10 14:52:53 christos 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=""
     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_installboot() {
     87 	# $1 is the root disk
     88 
     89 	# We don't have boot blocks.  Sigh.
     90 }
     91 
     92 md_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 
    100 md_labeldisk() {
    101 	# $1 is the disk to label
    102 
    103 	# We don't support labels on the mac68k port.  (Yet.)
    104 }
    105 
    106 md_prep_disklabel() {
    107 	# $1 is the root disk
    108 
    109 	# We don't support labels on the mac68k port.  (Yet.)
    110 }
    111 
    112 md_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 
    122 md_welcome_banner() {
    123 (
    124 	echo	""
    125 	echo	"Welcome to the NetBSD/mac68k ${VERSION} installation program."
    126 	cat << \__welcome_banner_1
    127 
    128 This program is designed to help you install NetBSD on your system in a
    129 simple and rational way.  You'll be asked several questions, and it would
    130 probably be useful to have your disk's hardware manual, the installation
    131 notes, and a calculator handy.
    132 
    133 In particular, you will need to know some reasonably detailed
    134 information about your disk's geometry.  This program can determine
    135 some limited information about certain specific types of HP-IB disks.
    136 If you have SCSI disks, however, prior knowledge of disk geometry
    137 is absolutely essential.  The kernel will attempt to display geometry
    138 information for SCSI disks during boot, if possible.  If you did not
    139 make it note of it before, you may wish to reboot and jot down your
    140 disk's geometry before proceeding.
    141 
    142 As with anything which modifies your hard disk's contents, this
    143 program can cause SIGNIFICANT data loss, and you are advised
    144 to make sure your hard drive is backed up before beginning the
    145 installation process.
    146 
    147 Default answers are displyed in brackets after the questions.
    148 You can hit Control-C at any time to quit, but if you do so at a
    149 prompt, you may have to hit return.  Also, quitting in the middle of
    150 installation may leave your system in an inconsistent state.
    151 
    152 __welcome_banner_1
    153 ) | more
    154 }
    155 
    156 md_not_going_to_install() {
    157 		cat << \__not_going_to_install_1
    158 
    159 OK, then.  Enter 'halt' at the prompt to halt the machine.  Once the
    160 machine has halted, power-cycle the system to load new boot code.
    161 
    162 __not_going_to_install_1
    163 }
    164 
    165 md_congrats() {
    166 	cat << \__congratulations_1
    167 
    168 CONGRATULATIONS!  You have successfully installed NetBSD!  To boot the
    169 installed system, enter halt at the command prompt.  Once the system has
    170 halted, power-cycle the machine in order to load new boot code.  Make sure
    171 you boot from the root disk.
    172 
    173 __congratulations_1
    174 }
    175 
    176 md_native_fstype() {
    177 	# Nothing to do.
    178 }
    179 
    180 md_native_fsopts() {
    181 	# Nothing to do.
    182 }
    183