diff options
author | grr <grr@cvs.openbsd.org> | 1997-05-11 22:47:35 +0000 |
---|---|---|
committer | grr <grr@cvs.openbsd.org> | 1997-05-11 22:47:35 +0000 |
commit | 3e2ecb7d9b6ffb66450fb1e5d8823e8b32d70e20 (patch) | |
tree | feac0a181ce5aacb24e6a3a976e29a75b3bff755 /distrib/sparc/floppies/upgr | |
parent | 505bcd88640ee8b91fe7388b219e85453bb64574 (diff) |
sparc install/upgrade wip - it's a lot closer than before
Diffstat (limited to 'distrib/sparc/floppies/upgr')
-rw-r--r-- | distrib/sparc/floppies/upgr/dot.hdprofile | 72 | ||||
-rw-r--r-- | distrib/sparc/floppies/upgr/upgrade.sh | 19 |
2 files changed, 82 insertions, 9 deletions
diff --git a/distrib/sparc/floppies/upgr/dot.hdprofile b/distrib/sparc/floppies/upgr/dot.hdprofile index 14520116ab9..efe3275773a 100644 --- a/distrib/sparc/floppies/upgr/dot.hdprofile +++ b/distrib/sparc/floppies/upgr/dot.hdprofile @@ -1,4 +1,4 @@ -# $OpenBSD: dot.hdprofile,v 1.4 1997/05/01 18:46:59 grr Exp $ +# $OpenBSD: dot.hdprofile,v 1.5 1997/05/11 22:47:34 grr Exp $ # # Copyright (c) 1994 Christopher G. Demetriou # All rights reserved. @@ -28,13 +28,28 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + PATH=/sbin:/bin:/usr/bin:/usr/sbin:/ export PATH -TERM=sun -export TERM umask 022 +# XXX +# the TERM/EDITOR stuff is really well enough parameterized to be moved +# into install.sub where it could use the routines there and be invoked +# from the various (semi) MI install and upgrade scripts + +# terminals believed to be in termcap, default TERM +TERMS="sun vt100 dumb" +TERM=sun + +# editors believed to be in $EDITBIN, smart and dumb defaults +EDITORS="ed" +EDITOR=ed +DUMB=ed +EDITBIN=/bin +EDITUBIN=/usr/bin + if [ "X${DONEPROFILE}" = "X" ]; then DONEPROFILE=YES @@ -49,9 +64,58 @@ if [ "X${DONEPROFILE}" = "X" ]; then stty newcrt werase ^W intr ^C kill ^U erase ^? 9600 echo '' + # get the terminal type + _forceloop="" + while [ "X$_forceloop" = X"" ]; do + echo "Supported terminals are: $TERMS" + eval `tset -s -m ":?$TERM"` + if [ "X$TERM" != X"unknown" ]; then + _forceloop="done" + fi + done + export TERM + + # get the editor preference + if [ "X$TERM" = "Xdumb" -o "X$TERM" = "Xunknown" ]; then + echo -n "$TERM can't handle $EDITOR" + EDITOR="$DUMB" + echo ", using $EDITOR as text editor!" + elif [ "X$EDITOR" = "X$EDITORS" ]; then + echo "Only one editor available, you get to use $EDITOR!" + else + _forceloop="" + while [ "X$_forceloop" = X"" ]; do + echo "Supported editors are: $EDITORS" + echo -n "text editor? [$EDITOR] " + read _choice + if [ "X$_choice" = "X" ]; then + _choice="$EDITOR" + _forceloop="$_choice" + else + for _editor in $EDITORS; do + if [ "X$_choice" = "X$_editor" ]; then + _forceloop="$_choice" + break + fi + done + fi + if [ "X$_forceloop" != "X" -a ! \( -x $EDITBIN/$_choice + -o -x $EDITUBIN/$_choice \) ] + then + _forceloop="" + fi + if [ "X$_forceloop" = "X" ]; then + echo "Sorry, $_choice isn't available." + _forceloop="" + fi + done + EDITOR="$_choice" + fi + export EDITOR + # pull in the functions that people will use from the shell prompt. . /.commonutils - . /.upgrutils + . /.instutils echo "Follow the installation directions to install the OpenBSD" echo "distribution sets." diff --git a/distrib/sparc/floppies/upgr/upgrade.sh b/distrib/sparc/floppies/upgr/upgrade.sh index b54430017bc..6d587a41e30 100644 --- a/distrib/sparc/floppies/upgr/upgrade.sh +++ b/distrib/sparc/floppies/upgr/upgrade.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $OpenBSD: upgrade.sh,v 1.3 1996/06/29 05:54:25 tholo Exp $ +# $OpenBSD: upgrade.sh,v 1.4 1997/05/11 22:47:34 grr Exp $ # # Copyright (c) 1994 Christopher G. Demetriou # All rights reserved. @@ -209,21 +209,30 @@ if [ $upgradefs = YES ]; then fi echo "" -echo "Updating boot blocks on ${drivename}..." -disklabel -r $drivename > /mnt/tmp/${drivename}.label +echo "Updating disk labels on ${drivename}..." +$DONTDOIT disklabel $drivename > /mnt/tmp/${drivename}.label if [ $? != 0 ]; then echo "FATAL ERROR: READ OF DISK LABEL FAILED." echo "It in unclear why this error would occur. It looks" echo "like you may end up having to upgrade by hand." exit 1 fi -disklabel -R -B $drivename /mnt/tmp/${drivename}.label +$DONTDOIT disklabel -R $drivename /mnt/tmp/${drivename}.label + +echo "Updating boot blodk on ${drivename}..." +$DONTDOIT /usr/mdec/binstall -v ffs /mnt if [ $? != 0 ]; then - echo "FATAL ERROR: UPDATE OF DISK LABEL FAILED." + echo "FATAL ERROR: UPDATE OF BOOT BLOCKS FAILED." echo "It in unclear why this error would occur. It looks" echo "like you may end up having to upgrade by hand." exit 1 fi + +if [ -f /mnt/boot ]; then +$DONTDOIT rm -f /mnt/boot.bak +$DONTDOIT mv /mnt/boot /mnt/boot.bak +fi + echo "Done." echo "" |