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