diff options
Diffstat (limited to 'distrib/miniroot')
-rw-r--r-- | distrib/miniroot/install.sh | 148 | ||||
-rw-r--r-- | distrib/miniroot/install.sub | 48 |
2 files changed, 125 insertions, 71 deletions
diff --git a/distrib/miniroot/install.sh b/distrib/miniroot/install.sh index 9e27a0c7d2a..79b723f7b45 100644 --- a/distrib/miniroot/install.sh +++ b/distrib/miniroot/install.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $OpenBSD: install.sh,v 1.18 1997/11/10 20:56:32 deraadt Exp $ +# $OpenBSD: install.sh,v 1.19 1998/01/10 02:22:56 deraadt Exp $ # $NetBSD: install.sh,v 1.5.2.8 1996/08/27 18:15:05 gwr Exp $ # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -124,82 +124,96 @@ if [ "`df /`" = "`df /mnt`" ]; then cp /etc/disktab.shadow /tmp/disktab.shadow fi - while [ "X${ROOTDISK}" = "X" ]; do - getrootdisk - done + while : ; do + if [ "X${ROOTDISK}" = "X" ]; then + while [ "X${ROOTDISK}" = "X" ]; do + getrootdisk + done + DISK=$ROOTDISK + else + DISK="" + while [ "X${DISK}" = "X" ]; do + getanotherdisk + done + if [ "${DISK}" = "done" ]; then + break + fi + fi - # Deal with disklabels, including editing the root disklabel - # and labeling additional disks. This is machine-dependent since - # some platforms may not be able to provide this functionality. - md_prep_disklabel ${ROOTDISK} + # Deal with disklabels, including editing the root disklabel + # and labeling additional disks. This is machine-dependent since + # some platforms may not be able to provide this functionality. + md_prep_disklabel ${DISK} - # Assume partition 'a' of $ROOTDISK is for the root filesystem. - # Loop and get the rest. - # XXX ASSUMES THAT THE USER DOESN'T PROVIDE BOGUS INPUT. - cat << __get_filesystems_1 + # Assume partition 'a' of $ROOTDISK is for the root filesystem. + # Loop and get the rest. + # XXX ASSUMES THAT THE USER DOESN'T PROVIDE BOGUS INPUT. + cat << __get_filesystems_1 -You will now have the opportunity to enter filesystem information. You will be -prompted for the mount point (full path, including the prepending '/' character) -for each BSD partition on ${ROOTDISK}. Enter "none" to skip a partition or -"done" when you are finished. +You will now have the opportunity to enter filesystem information for ${DISK}. +You will be prompted for the mount point (full path, including the prepending +'/' character) for each BSD partition on ${DISK}. Enter "none" to skip a +partition or "done" when you are finished. __get_filesystems_1 - echo "The following will be used for the root filesystem and swap:" - echo " ${ROOTDISK}a /" - echo " ${ROOTDISK}b swap" + if [ "${DISK}" = "${ROOTDISK}" ]; then + echo "The following will be used for the root filesystem and swap:" + echo " ${ROOTDISK}a /" + echo " ${ROOTDISK}b swap" - echo "${ROOTDISK}a /" > ${FILESYSTEMS} + echo "${ROOTDISK}a /" > ${FILESYSTEMS} + fi - # XXX - allow the user to name mount points on disks other than ROOTDISK - # also allow a way to enter non-BSD partitions (but don't newfs!) - # Get the list of BSD partitions and store sizes - _npartitions=0 - for _p in `disklabel ${ROOTDISK} 2>&1 | grep '^ *[a-p]:.*BSD' | sed 's/^ *\([a-p]\): *\([0-9][0-9]*\) .*/\1\2/'`; do - case $_p in - a*) # We already have an 'a' - ;; - *) _pp=`firstchar ${_p}` - _ps=`echo ${_p} | sed 's/^.//'` - _partitions[${_npartitions}]=${_pp} - _psizes[${_npartitions}]=${_ps} - _npartitions=$(( ${_npartitions} + 1 )) - ;; - esac - done + # XXX - allow the user to name mount points on disks other than ROOTDISK + # also allow a way to enter non-BSD partitions (but don't newfs!) + # Get the list of BSD partitions and store sizes + _npartitions=0 + for _p in `disklabel ${DISK} 2>&1 | grep '^ *[a-p]:.*BSD' | sed 's/^ *\([a-p]\): *\([0-9][0-9]*\) .*/\1\2/'`; do + _pp=`firstchar ${_p}` + if [ "${DISK}" = "${ROOTDISK}" -a "$_pp" = "a" ]; then + continue + fi + _ps=`echo ${_p} | sed 's/^.//'` + _partitions[${_npartitions}]=${_pp} + _psizes[${_npartitions}]=${_ps} + _npartitions=$(( ${_npartitions} + 1 )) + done - # Now prompt the user for the mount points. Loop until "done" - echo "" - _i=0 - resp="X" - while [ $_npartitions -gt 0 -a X${resp} != X"done" ]; do - _pp=${_partitions[${_i}]} - _ps=$(( ${_psizes[${_i}]} / 2 )) - _mp=${_mount_points[${_i}]} - - # Get the mount point from the user - while : ; do - echo -n "Mount point for ${ROOTDISK}${_pp} (size=${_ps}k) [$_mp]? " - getresp "$_mp" - case "X${resp}" in - X/*) _mount_points[${_i}]=$resp - break ;; - Xdone|Xnone|X) break ;; - *) echo "mount point must be an absolute path!";; - esac + # Now prompt the user for the mount points. Loop until "done" + echo "" + _i=0 + resp="X" + while [ $_npartitions -gt 0 -a X${resp} != X"done" ]; do + _pp=${_partitions[${_i}]} + _ps=$(( ${_psizes[${_i}]} / 2 )) + _mp=${_mount_points[${_i}]} + + # Get the mount point from the user + while : ; do + echo -n "Mount point for ${DISK}${_pp} (size=${_ps}k) [$_mp]? " + getresp "$_mp" + case "X${resp}" in + X/*) _mount_points[${_i}]=$resp + break ;; + Xdone|Xnone|X) break ;; + *) echo "mount point must be an absolute path!";; + esac + done + _i=$(( ${_i} + 1 )) + if [ $_i -ge $_npartitions ]; then + _i=0 + fi done - _i=$(( ${_i} + 1 )) - if [ $_i -ge $_npartitions ]; then - _i=0 - fi - done - # Now write it out - _i=0 - while test $_i -lt $_npartitions; do - if [ -n "${_mount_points[${_i}]}" ]; then - echo "${ROOTDISK}${_partitions[${_i}]} ${_mount_points[${_i}]}" >> ${FILESYSTEMS} - fi - _i=$(( ${_i} + 1 )) + # Now write it out + _i=0 + while test $_i -lt $_npartitions; do + if [ -n "${_mount_points[${_i}]}" ]; then + echo "${DISK}${_partitions[${_i}]} ${_mount_points[${_i}]}" >> ${FILESYSTEMS} + _mount_points[${_i}]="" + fi + _i=$(( ${_i} + 1 )) + done done echo "" diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index 2a16f604ae2..372029ec0ff 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,5 +1,5 @@ #!/bin/sh -# $OpenBSD: install.sub,v 1.49 1997/10/29 21:38:17 deraadt Exp $ +# $OpenBSD: install.sub,v 1.50 1998/01/10 02:22:57 deraadt Exp $ # $NetBSD: install.sub,v 1.5.2.8 1996/09/02 23:25:02 pk Exp $ # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -298,6 +298,29 @@ __get_reldir_1 done } +getanotherdisk() { + cat << \__getanotherdisk_1 + +Now you can select another disk to initialize. +Available disks are: + +__getanotherdisk_1 + _DKDEVS=`md_get_diskdevs` + echo "$_DKDEVS" + echo "" + echo -n "Which one? [done] " + getresp "" + if [ "X${resp}" = "X" ]; then + DISK=done + elif isin $resp $_DKDEVS ; then + DISK="$resp" + else + echo "" + echo "The disk $resp does not exist." + DISK="" + fi +} + getrootdisk() { cat << \__getrootdisk_1 @@ -777,9 +800,9 @@ install_url() { "'all' to install all the standard sets, or 'list' to list the\\\\n"\ "files avilable at \$_${_url_type}_server_ip:\$_${_url_type}_server_dir.\\\\n"\ "When you are done selecting files, enter 'done'.\\\\n"\ -"Some of these sets are required for your ${MODE} and some are optional.\\\\n"\ -"Consult the intallation notes if you are not sure which sets are required!\\\\n" - +"Some of these sets are required for your ${MODE} and some are optional --\\\\n"\ +"You will want at least the base and bsd sets.\\\\n" +"Consult the intallation notes if you are not sure which sets are required!\\\\n"\ _osetsdone="$_setsdone" while : ; do echo "" @@ -1544,6 +1567,23 @@ __install_sets_1 _yup="FALSE" # So we'll ask next time fi + if [ ! -f /mnt/bsd ]; then + cat << \__install_sets_2 +You still do not have a /bsd in your filesystem (ie. the kernel), which +seems to indicate that you are still missing important distribution files. +So please continue installing.. +__install_sets_2 + resp="" + fi + if [ ! -f /mnt/bin/cat ]; then + cat << \__install_sets_3 +You still do not have a /bin/cat in your filesystem (ie. a sample random file +which you probably want). This seems to indicate that you are still missing +important distribution files. So please continue installing.. +__install_sets_3 + resp="" + fi + # Give the user the opportunity to extract more sets. They # don't necessarily have to come from the same media. echo "" |