diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1995-11-13 04:03:13 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1995-11-13 04:03:13 +0000 |
commit | 664fdd78880ff6a8e1d4acc23af1b230afb7a7c8 (patch) | |
tree | ca4877c97ef0c09fcf69a3f296be3be3223da53f /distrib/hp300 | |
parent | 65e88d87997d4f7d40c47ef1e43b3bade12d6a12 (diff) |
from netbsd
Diffstat (limited to 'distrib/hp300')
-rw-r--r-- | distrib/hp300/miniroot/Makefile.inc | 6 | ||||
-rw-r--r-- | distrib/hp300/miniroot/inst-common/instbin.conf | 6 | ||||
-rw-r--r-- | distrib/hp300/miniroot/inst-common/list | 6 | ||||
-rw-r--r-- | distrib/hp300/miniroot/inst-common/mtree.conf | 7 | ||||
-rw-r--r-- | distrib/hp300/miniroot/inst/dot.profile | 23 | ||||
-rw-r--r-- | distrib/hp300/miniroot/inst/install.sh | 196 |
6 files changed, 188 insertions, 56 deletions
diff --git a/distrib/hp300/miniroot/Makefile.inc b/distrib/hp300/miniroot/Makefile.inc index e5d8ce7abe4..e13ecd89723 100644 --- a/distrib/hp300/miniroot/Makefile.inc +++ b/distrib/hp300/miniroot/Makefile.inc @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.1 1995/10/03 22:47:55 thorpej Exp $ +# $NetBSD: Makefile.inc,v 1.1.2.1 1995/11/07 07:31:09 thorpej Exp $ -# Revision is 1.0A -REV= 10A +# Revision is 1.1 +REV= 11 diff --git a/distrib/hp300/miniroot/inst-common/instbin.conf b/distrib/hp300/miniroot/inst-common/instbin.conf index c3a608e8fc6..dfb412f4846 100644 --- a/distrib/hp300/miniroot/inst-common/instbin.conf +++ b/distrib/hp300/miniroot/inst-common/instbin.conf @@ -1,4 +1,4 @@ -# $NetBSD: instbin.conf,v 1.1 1995/10/03 22:48:03 thorpej Exp $ +# $NetBSD: instbin.conf,v 1.1.2.1 1995/11/07 07:22:03 thorpej Exp $ # # instbin.conf - configuration for hp300 miniroot @@ -7,8 +7,8 @@ srcdirs bin sbin usr.bin usr.sbin gnu/usr.bin usr.bin/vi progs bad144 basename cat cut chflags chmod chown chroot cp dd df disklabel progs dmesg ed expr fsck ftp gawk grep gzip hostname ifconfig init ln ls progs mkdir mknod more mount mount_cd9660 mount_ffs mount_nfs mt mv newfs ping -progs pwd reboot rm route sed sh shutdown slattach sleep strings stty sync tar -progs test tip tset umount update +progs pwd reboot rm route sed sh shutdown slattach sleep sort strings stty +progs sync tar test tip tset umount update # XXX catch vi; see above progs common diff --git a/distrib/hp300/miniroot/inst-common/list b/distrib/hp300/miniroot/inst-common/list index d184032b24e..57dfea5d4af 100644 --- a/distrib/hp300/miniroot/inst-common/list +++ b/distrib/hp300/miniroot/inst-common/list @@ -1,4 +1,4 @@ -# $NetBSD: list,v 1.1 1995/10/03 22:48:04 thorpej Exp $ +# $NetBSD: list,v 1.1.2.1 1995/11/07 07:22:05 thorpej Exp $ # copy the crunched binary, link to it, and kill it COPY ${OBJDIR}/instbin instbin @@ -54,6 +54,7 @@ SYMLINK /instbin usr/bin/gzip SYMLINK /instbin usr/bin/more SYMLINK /instbin usr/bin/sed SYMLINK /instbin usr/bin/strings +SYMLINK /instbin usr/bin/sort SYMLINK /instbin usr/bin/tar SYMLINK /instbin usr/bin/tip SYMLINK /instbin usr/bin/tset @@ -92,5 +93,8 @@ SYMLINK /tmp/disktab.shadow etc/disktab SYMLINK /tmp/fstab.shadow etc/fstab SYMLINK /tmp/hosts etc/hosts +# the zoneinfo +COPYDIR ${DESTDIR}/usr/share/zoneinfo usr/share/zoneinfo + # and the termcap file COPY ${TOPDIR}/../../../share/termcap/termcap.src usr/share/misc/termcap diff --git a/distrib/hp300/miniroot/inst-common/mtree.conf b/distrib/hp300/miniroot/inst-common/mtree.conf index 3b90b20cbec..9a294056ed0 100644 --- a/distrib/hp300/miniroot/inst-common/mtree.conf +++ b/distrib/hp300/miniroot/inst-common/mtree.conf @@ -1,4 +1,4 @@ -# $NetBSD: mtree.conf,v 1.1 1995/10/03 22:48:05 thorpej Exp $ +# $NetBSD: mtree.conf,v 1.1.2.1 1995/11/07 07:22:07 thorpej Exp $ /set type=dir uname=root gname=wheel mode=0755 # . @@ -65,6 +65,11 @@ misc # ./usr/share/misc .. +# ./usr/share/zoneinfo +zoneinfo +# ./usr/share/zoneinfo +.. + # ./usr/share .. diff --git a/distrib/hp300/miniroot/inst/dot.profile b/distrib/hp300/miniroot/inst/dot.profile index 34ca6d39592..bc810c7bae7 100644 --- a/distrib/hp300/miniroot/inst/dot.profile +++ b/distrib/hp300/miniroot/inst/dot.profile @@ -1,4 +1,4 @@ -# $NetBSD: dot.profile,v 1.1 1995/10/03 22:47:59 thorpej Exp $ +# $NetBSD: dot.profile,v 1.1.2.1 1995/11/11 06:16:44 thorpej Exp $ # # Copyright (c) 1995 Jason R. Thorpe # Copyright (c) 1994 Christopher G. Demetriou @@ -56,6 +56,23 @@ if [ "X${DONEPROFILE}" = "X" ]; then fi done - # run the installation script. - /install + # Installing or upgrading? + _forceloop="" + while [ "X${_forceloop}" = X"" ]; do + echo -n '(I)nstall or (U)pgrade? ' + read _forceloop + case "$_forceloop" in + i*|I*) + /install + ;; + + u*|U*) + /upgrade + ;; + + *) + _forceloop="" + ;; + esac + done fi diff --git a/distrib/hp300/miniroot/inst/install.sh b/distrib/hp300/miniroot/inst/install.sh index b4dc105adb8..2f172d90f50 100644 --- a/distrib/hp300/miniroot/inst/install.sh +++ b/distrib/hp300/miniroot/inst/install.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $NetBSD: install.sh,v 1.1 1995/10/03 22:48:00 thorpej Exp $ +# $NetBSD: install.sh,v 1.1.2.3 1995/11/07 10:33:25 thorpej Exp $ # # Copyright (c) 1995 Jason R. Thorpe. # All rights reserved. @@ -35,7 +35,7 @@ # In a perfect world, this would be a nice C program, with a reasonable # user interface. -VERSION=1.0A +VERSION=1.1 ROOTDISK="" # filled in below FILESYSTEMS="/tmp/filesystems" # used thoughout FQDN="" # domain name @@ -49,6 +49,46 @@ getresp() { fi } +isin() { +# test the first argument against the remaining ones, return succes on a match + _a=$1; shift + while [ $# != 0 ]; do + if [ "$_a" = "$1" ]; then return 0; fi + shift + done + return 1 +} + +# +# machine dependent section +# +md_get_diskdevs() { + # return available disk devices + dmesg | grep "^rd.*:" | awk -F: '{print $1}' | sort -u + dmesg | grep "^sd.*:*cylinders" | awk -F: '{print $1}' | sort -u +} + +md_get_cddevs() { + # return available CD-ROM devices + dmesg | grep "sd.*:*CD-ROM" | awk -F: '{print $1}' | sort -u +} + +md_get_ifdevs() { + # return available network interfaces + dmesg | grep "^le.*:" | awk -F: '{print $1}' | sort -u +} + +md_installboot() { + # $1 is the root disk + + echo -n "Installing boot block..." + disklabel -W ${1} + disklabel -B ${1} + echo "done." +} + +# end of machine dependent section + do_mfs_mount() { umount $1 > /dev/null 2>&1 if ! mount_mfs -s 2048 swap $1 ; then @@ -75,12 +115,12 @@ program. Available disks are: __getrootdisk_1 - dmesg | grep "^rd" | grep "slave" - dmesg | grep "^sd" | grep "slave" + _DKDEVS=`md_get_diskdevs` + echo "$_DKDEVS" echo "" echo -n "Which disk is the root disk? " getresp "" - if dmesg | grep "^$resp " | grep "slave" > /dev/null ; then + if isin $resp $_DKDEVS ; then ROOTDISK="$resp" else echo "" @@ -108,8 +148,7 @@ labelmoredisks() { You may label the following disks: __labelmoredisks_1 - dmesg | grep "^rd" | grep "slave" | grep -v "${ROOTDISK} " - dmesg | grep "^sd" | grep "slave" | grep -v "${ROOTDISK} " + echo "$_DKDEVS" | grep -v "${ROOTDISK}" echo "" echo -n "Label which disk? [done] " getresp "done" @@ -118,8 +157,8 @@ __labelmoredisks_1 ;; *) - if dmesg | grep "^$resp " | grep "slave" \ - > /dev/null ; then + if echo "$_DKDEVS" | grep -v "${ROOTDISK}" | \ + grep "^$resp" > /dev/null ; then # XXX CODE ME echo "Yup, it exists." else @@ -168,7 +207,8 @@ You may configure the following network interfaces: __configurenetwork_1 - dmesg | grep "^le" | grep "ipl" + _IFS=`md_get_ifdevs` + echo $_IFS echo "" echo -n "Configure which interface? [done] " getresp "done" @@ -177,8 +217,7 @@ __configurenetwork_1 ;; *) - if dmesg | grep "^$resp " | grep "^le" | grep "ipl" \ - > /dev/null ; then + if isin $resp $_IFS ; then _interface_name=$resp # Get IP address @@ -333,11 +372,12 @@ install_cdrom() { # Get the cdrom device info cat << \__install_cdrom_1 -The following SCSI disk or disk-like devices are installed on your system; -please select the CD-ROM device containing the installation media: +The following CD-ROM devices are installed on your system; please select +the CD-ROM device containing the installation media: __install_cdrom_1 - dmesg | grep "^sd" | grep "rev" + _CDDEVS=`md_get_cddevs` + echo "$_CDDEVS" echo "" echo -n "Which is the CD-ROM with the installation media? [abort] " getresp "abort" @@ -348,8 +388,7 @@ __install_cdrom_1 ;; *) - if dmesg | grep "^$resp " | grep "slave" \ - > /dev/null ; then + if isin $resp $_CDDEVS ; then _cdrom_drive=$resp else echo "" @@ -552,7 +591,7 @@ __install_tape_2 2) ( cd /mnt - tar -zxvpf $TAPE + dd if=$TAPE | tar -xvpf - ) ;; @@ -565,6 +604,31 @@ __install_tape_2 echo "Extraction complete." } +get_timezone() { +cat << \__get_timezone_1 + +Select a time zone: + +__get_timezone_1 + ls /usr/share/zoneinfo # XXX + echo "" + if [ X"$TZ" = "X" ]; then + TZ=`ls -l /etc/timezone 2>/dev/null | awk -F/ '{print $NF}'` + fi + echo -n "What timezone are you in [$TZ]? " + getresp "$TZ" + case "$resp" in + "") + echo "Timezone defaults to GMT" + TZ="GMT" + ;; + *) + TZ="$resp" + ;; + esac + export TZ +} + echo "" echo "Welcome to the NetBSD ${VERSION} installation program." cat << \__welcome_banner_1 @@ -941,32 +1005,66 @@ Make sure The sets are either on a local device (i.e. tape, CD-ROM) or on a network server. __install_sets_1 -resp="" # force at least one iteration -while [ "X${resp}" = X"" ]; do - echo -n "Install from (f)tp, (t)ape, (C)D-ROM, or (N)FS? [f] " - getresp "f" +if [ -f /base.tar.gz ]; then + echo -n "Install from sets in the current root filesystem? [y] " + getresp "y" case "$resp" in - f*|F*) - install_ftp + y*|Y*) + for _f in /*.tar.gz; do + echo -n "Install $_f ? [y]" + getresp "y" + case "$resp" in + y*|Y*) + cat $_f | (cd /mnt; tar -zxvpf -) + _yup="TRUE" + ;; + *) + ;; + esac + echo "Extraction complete." + done ;; - - t*|T*) - install_tape + *) + _yup="FALSE" ;; + esac +else + _yup="FALSE" +fi - c*|C*) - install_cdrom - ;; +# Go on prodding for alternate locations +resp="" # force at least one iteration +while [ "X${resp}" = X"" ]; do + # If _yup is not FALSE, it means that we extracted sets above. + # If that's the case, bypass the menu the first time. + if [ X"$_yup" = X"FALSE" ]; then + echo -n "Install from (f)tp, (t)ape, (C)D-ROM, or (N)FS? [f] " + getresp "f" + case "$resp" in + f*|F*) + install_ftp + ;; - n*|N*) - install_nfs - ;; + t*|T*) + install_tape + ;; - *) - echo "Invalid response: $resp" - resp="" - ;; - esac + c*|C*) + install_cdrom + ;; + + n*|N*) + install_nfs + ;; + + *) + echo "Invalid response: $resp" + resp="" + ;; + esac + else + _yup="FALSE" # So we'll ask next time + fi # Give the user the opportunity to extract more sets. They don't # necessarily have to come from the same media. @@ -984,35 +1082,43 @@ while [ "X${resp}" = X"" ]; do esac done +# Get timezone info +get_timezone + # Copy in configuration information and make devices in target root. ( cd /tmp for file in fstab hostname.* hosts myname mygate; do if [ -f $file ]; then - echo "Copying $file..." + echo -n "Copying $file..." cp $file /mnt/etc/$file + echo "done." fi done + echo -n "Installing timezone link..." + rm -f /mnt/etc/localtime + ln -s /usr/share/zoneinfo/$TZ /mnt/etc/localtime + echo "done." + echo -n "Making devices..." cd /mnt/dev sh MAKEDEV all echo "done." - echo "Copying kernel..." + echo -n "Copying kernel..." cp /netbsd /mnt/netbsd + echo "done." + + md_installboot ${ROOTDISK} ) # Unmount all filesystems and check their integrity. +sync; sleep 2 umount -a echo "Checking filesystem integrity..." fsck -pf -# Install boot code on target disk. -echo "Installing boot block..." -disklabel -W ${ROOTDISK} -disklabel -B ${ROOTDISK} - cat << \__congratulations_1 CONGRATULATIONS! You have successfully installed NetBSD on your hard disk! |