From 4078ca97a229399fe2c928dc57d9bb66a07231de Mon Sep 17 00:00:00 2001 From: grr Date: Wed, 30 Apr 1997 23:56:05 +0000 Subject: [PATCH] clean up sparc mini-root stuff and eliminate some mysteries and surprises therein --- distrib/miniroot/install.sh | 47 ++++++++++++++++++++-------- distrib/miniroot/install.sub | 49 +++++++++++++++++++++++++----- distrib/sparc/install.md | 32 +++++++++++++------ distrib/sparc/miniroot/dot.profile | 37 +++++++++++++++------- 4 files changed, 126 insertions(+), 39 deletions(-) diff --git a/distrib/miniroot/install.sh b/distrib/miniroot/install.sh index bcb3b9279ea..9362c6e681a 100644 --- a/distrib/miniroot/install.sh +++ b/distrib/miniroot/install.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $OpenBSD: install.sh,v 1.4 1997/04/30 18:52:43 niklas Exp $ +# $OpenBSD: install.sh,v 1.5 1997/04/30 23:56:05 grr Exp $ # $NetBSD: install.sh,v 1.5.2.8 1996/08/27 18:15:05 gwr Exp $ # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -134,7 +134,7 @@ __get_filesystems_1 echo "The following will be used for the root filesystem:" echo " ${ROOTDISK}a /" -echo "${ROOTDISK}a /" > ${FILESYSTEMS} +echo "${ROOTDISK}a /" > ${FILESYSTEMS} resp="X" # force at least one iteration while [ "X$resp" != X"done" ]; do @@ -154,14 +154,16 @@ while [ "X$resp" != X"done" ]; do echo -n "Mount point? " getresp "" _mount_point=$resp - if [ "X${_mount_point}" = X"/" ]; then - # Invalid response; no multiple roots - _first_char="X" - else - _first_char=`firstchar ${_mount_point}` + _first_char=`firstchar ${_mount_point}` + if [ "X${_first_char}" != X"/" ]; then + echo "mount point must be an absolute path!" fi done - echo "${_device_name} ${_mount_point}" >> ${FILESYSTEMS} + if [ "X${_mount_point}" = X"/" ]; then + echo "root mount point is already taken care of!" + else + echo "${_device_name} ${_mount_point}" >> ${FILESYSTEMS} + fi resp="X" # force loop to repeat ;; esac @@ -182,6 +184,25 @@ case "$resp" in *) ;; esac +echo "" +echo "The next step *WILL* overwrite any existing data on:" +( + while read _device_name _junk; do + echo ${_device_name} + done +) < ${FILESYSTEMS} +echo "" + +echo -n "Are you *SURE* that you're ready to proceed? [n] " +getresp "n" +case "$resp" in + y*|Y*) + ;; + *) + echo "ok, try again later..." + exit + ;; +esac # Loop though the file, place filesystems on each device. echo "Creating filesystems..." @@ -212,17 +233,17 @@ case "$resp" in if [ -f /etc/myname ]; then resp=`cat /etc/myname` fi - echo -n "Enter system hostname: [$resp] " while [ "X${resp}" = X"" ]; do + echo -n "Enter system hostname: [$resp] " getresp "$resp" done hostname $resp echo $resp > /tmp/myname - echo -n "Enter DNS domain name: " resp="" # force at least one iteration while [ "X${resp}" = X"" ]; do - getresp "" + echo -n "Enter DNS domain name: [$FQDN]" + getresp "$FQDN" done FQDN=$resp @@ -263,7 +284,9 @@ case "$resp" in cat /tmp/hosts echo "" echo "You may want to edit the host table in the event that" - echo "you need to mount an NFS server." + echo "you are doing an NFS installation or an FTP installation" + echo "without a name server and want to refer to the server by" + echo "name rather than by its numeric ip address." echo -n "Would you like to edit the host table? [n] " getresp "n" case "$resp" in diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index 20e77a90c0a..dd0055fd33c 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,5 +1,5 @@ #!/bin/sh -# $OpenBSD: install.sub,v 1.6 1997/04/30 20:25:36 deraadt Exp $ +# $OpenBSD: install.sub,v 1.7 1997/04/30 23:56:06 grr Exp $ # $NetBSD: install.sub,v 1.5.2.8 1996/09/02 23:25:02 pk Exp $ # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -59,11 +59,27 @@ if [ X$EDITOR = X ]; then fi fi +# get a reponse with default[s] getresp() { - read resp - if [ "X$resp" = "X" ]; then - resp=$1 - fi + valid="false" + while [ "X$valid" = "Xfalse" ]; do + read resp + if [ "X$resp" = "X" ]; then + resp=$1 + fi + if [ $# -gt 1 ]; then + for i in $@; do + if [ "X$resp" = "X$i" ]; then + valid="true" + fi + done + else + valid="true" + fi + if [ "X$valid" = "Xfalse" ]; then + echo "Try again: Enter one of [$@]" + fi + done } isin() { @@ -356,6 +372,7 @@ configure_ifs() { local _interface_mask local _interface_symname local _interface_extra + local _hostname _interface_name=$1 @@ -381,10 +398,11 @@ configure_ifs() { done # Get symbolic name + _hostname=`hostname` resp="" # force one iteration while [ "X${resp}" = X"" ]; do - echo -n "Symbolic (host) name? " - getresp "" + echo -n "Symbolic (host) name? [$_hostname] " + getresp "$_hostname" _interface_symname=$resp done @@ -590,6 +608,23 @@ __install_ftp_2 echo "quit" >> /tmp/ftp-script.sh echo "__end_commands" >> /tmp/ftp-script.sh + cat << \__install_ftp_3 + +Fetching the files via ftp may take a long time, especially over a slow +network connection. You may want to review/edit the fetch script to make +sure that you haven't made any errors in the file names. +__install_ftp_3 + echo -n "edit ftp fetch script? [n] " + getresp "n" + case "$resp" in + y*|Y*) + $EDITOR /tmp/ftp-script.sh + ;; + *) + ;; + esac + + sh /tmp/ftp-script.sh rm -f /tmp/ftp-script.sh echo "Extraction complete." diff --git a/distrib/sparc/install.md b/distrib/sparc/install.md index 16308876ee3..6dfc6bd4f9e 100644 --- a/distrib/sparc/install.md +++ b/distrib/sparc/install.md @@ -151,22 +151,36 @@ md_prep_disklabel() Here is an example of what the partition information will look like once you have entered the disklabel editor. Disk partition sizes and offsets -are in sector (most likely 512 bytes) units. Make sure these size/offset -pairs are on cylinder boundaries (the number of sector per cylinder is -given in the `sectors/cylinder' entry, which is not shown here). +are in sector (most likely 512 bytes) units. + +Make sure these size/offset pairs are on cylinder boundaries (the number +of sector per cylinder is given in the `sectors/cylinder' entry. + +If this disk is previously un-labeled, only the "c" partition will show up +in the editor and you will have to enter lines similar to those shown in the +example for the other paritions. If you are uncertain about the syntax or +space requirements, this is a good time to review the installation notes. Do not change any parameters except the partition layout and the label name. It's probably also wisest not to touch the `16 partitions:' line, even in case you have defined less than sixteen partitions. -[Example] +[** EXAMPLE **] +disk: p4200s +bytes/sector: 512 +sectors/track: 40 +tracks/cylinder: 8 +sectors/cylinder: 320 +cylinders: 1280 +total sectors: 409600 + 16 partitions: # size offset fstype [fsize bsize cpg] - a: 50176 0 4.2BSD 1024 8192 16 # (Cyl. 0 - 111) - b: 64512 50176 swap # (Cyl. 112 - 255) - c: 640192 0 unknown # (Cyl. 0 - 1428) - d: 525504 114688 4.2BSD 1024 8192 16 # (Cyl. 256 - 1428) -[End of example] + a: 51200 0 4.2BSD 1024 8192 16 # (Cyl. 0 - 159) + b: 51200 51200 swap # (Cyl. 160 - 319) + c: 409600 0 unused 0 0 # (Cyl. 0 - 1279) + d: 307200 102400 4.2BSD 1024 8192 16 # (Cyl. 320 - 1279) +[End of **EXAMPLE**] __md_prep_disklabel_1 echo -n "Press [Enter] to continue " diff --git a/distrib/sparc/miniroot/dot.profile b/distrib/sparc/miniroot/dot.profile index 9e5c6c4d948..8bf10b79a62 100644 --- a/distrib/sparc/miniroot/dot.profile +++ b/distrib/sparc/miniroot/dot.profile @@ -1,4 +1,4 @@ -# $OpenBSD: dot.profile,v 1.3 1997/04/30 18:56:02 niklas Exp $ +# $OpenBSD: dot.profile,v 1.4 1997/04/30 23:56:07 grr Exp $ # $NetBSD: dot.profile,v 1.1 1995/12/18 22:54:43 pk Exp $ # # Copyright (c) 1995 Jason R. Thorpe @@ -37,13 +37,6 @@ export PATH TERM=sun export TERM -if [ -e /usr/bin/vim ]; then - EDITOR=vim -else - EDITOR=ed -fi -export EDITOR - umask 022 if [ "X${DONEPROFILE}" = "X" ]; then @@ -53,9 +46,6 @@ if [ "X${DONEPROFILE}" = "X" ]; then echo 'erase ^H, werase ^W, kill ^U, intr ^C' stty newcrt werase ^W intr ^C kill ^U erase ^H 9600 - # run update, so that installed software is written as it goes. - update - # get the terminal type _forceloop="" while [ "X${_forceloop}" = X"" ]; do @@ -64,6 +54,31 @@ if [ "X${DONEPROFILE}" = "X" ]; then _forceloop="done" fi done + export TERM + + # get the editor preference + EDITOR=vi + _forceloop="" + while [ "X${_forceloop}" = X"" ]; do + echo -n "text editor - vi or ed? [$EDITOR] " + read _forceloop + case "$_forceloop" in + vi|"") + EDITOR=vi + _forceloop=$EDITOR + ;; + + ed) + EDITOR=ed + ;; + + *) + echo "sorry, no $_forceloop available" + _forceloop="" + ;; + esac + done + export EDITOR # Installing or upgrading? _forceloop="" -- 2.20.1