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