From 3e2ecb7d9b6ffb66450fb1e5d8823e8b32d70e20 Mon Sep 17 00:00:00 2001 From: grr Date: Sun, 11 May 1997 22:47:35 +0000 Subject: sparc install/upgrade wip - it's a lot closer than before --- .../sparc/floppies/inst-common/instbin-krb.conf | 10 +-- distrib/sparc/floppies/inst-common/instbin.conf | 10 +-- distrib/sparc/floppies/inst-common/list | 5 +- distrib/sparc/floppies/inst/dot.hdprofile | 69 ++++++++++++++++++++- distrib/sparc/floppies/inst/install.sh | 18 +++--- distrib/sparc/floppies/inst/list | 4 +- distrib/sparc/floppies/upgr/dot.hdprofile | 72 ++++++++++++++++++++-- distrib/sparc/floppies/upgr/upgrade.sh | 19 ++++-- 8 files changed, 171 insertions(+), 36 deletions(-) (limited to 'distrib/sparc/floppies') diff --git a/distrib/sparc/floppies/inst-common/instbin-krb.conf b/distrib/sparc/floppies/inst-common/instbin-krb.conf index e605e1bfec4..3f3862c3cfe 100644 --- a/distrib/sparc/floppies/inst-common/instbin-krb.conf +++ b/distrib/sparc/floppies/inst-common/instbin-krb.conf @@ -1,16 +1,16 @@ -# $OpenBSD: instbin-krb.conf,v 1.4 1997/05/01 11:30:51 niklas Exp $ +# $OpenBSD: instbin-krb.conf,v 1.5 1997/05/11 22:47:32 grr Exp $ # # kcbin.conf - unified binary for the kc floppy # -srcdirs bin sbin usr.bin/less usr.bin usr.sbin gnu/usr.bin +srcdirs bin sbin usr.bin/less usr.bin usr.sbin gnu/usr.bin sys/arch/sparc/stand progs cat chmod chown cp dd df disklabel ed expr fsck_ffs -progs ftp -progs ifconfig init less ln ls mkdir mknod mount mount_cd9660 +progs ftp getopt +progs ifconfig init installboot less ln ls mkdir mknod mount mount_cd9660 progs mount_ffs mount_nfs mount_kernfs progs mv newfs pax pdksh ping pwd reboot rm route -progs sed stty sync test umount +progs sed stty sync test tset umount progs gzip ln chown chgrp diff --git a/distrib/sparc/floppies/inst-common/instbin.conf b/distrib/sparc/floppies/inst-common/instbin.conf index e614ee45293..9d37727dd94 100644 --- a/distrib/sparc/floppies/inst-common/instbin.conf +++ b/distrib/sparc/floppies/inst-common/instbin.conf @@ -1,16 +1,16 @@ -# $OpenBSD: instbin.conf,v 1.12 1997/05/01 11:30:52 niklas Exp $ +# $OpenBSD: instbin.conf,v 1.13 1997/05/11 22:47:32 grr Exp $ # # kcbin.conf - unified binary for the kc floppy # -srcdirs bin sbin usr.bin/less usr.bin usr.sbin gnu/usr.bin +srcdirs bin sbin usr.bin/less usr.bin usr.sbin gnu/usr.bin sys/arch/sparc/stand progs cat chmod chown cp dd df disklabel ed expr fsck_ffs -progs ftp -progs ifconfig init less ln ls mkdir mknod mount mount_cd9660 +progs ftp getopt +progs ifconfig init installboot less ln ls mkdir mknod mount mount_cd9660 progs mount_ffs mount_nfs mount_kernfs progs mv newfs pax pdksh ping pwd reboot rm route -progs sed stty sync test umount +progs sed stty sync test tset umount progs rsh gzip ln chown chgrp diff --git a/distrib/sparc/floppies/inst-common/list b/distrib/sparc/floppies/inst-common/list index 7be99db6a49..ca0040613ce 100644 --- a/distrib/sparc/floppies/inst-common/list +++ b/distrib/sparc/floppies/inst-common/list @@ -1,4 +1,4 @@ -# $OpenBSD: list,v 1.12 1997/05/06 14:54:20 grr Exp $ +# $OpenBSD: list,v 1.13 1997/05/11 22:47:33 grr Exp $ # copy the crunched binary, link to it, and kill it COPY ${OBJDIR}/instbin instbin @@ -44,13 +44,16 @@ LINK instbin sbin/umount SYMLINK /bin/cat usr/bin/chgrp SYMLINK /bin/cat usr/bin/ftp SYMLINK /bin/cat usr/bin/less +SYMLINK /bin/cat usr/bin/getopt SYMLINK /bin/cat usr/bin/gzip SYMLINK /bin/cat usr/bin/more SYMLINK /bin/cat usr/bin/sed +SYMLINK /bin/cat usr/bin/tset #SYMLINK /bin/cat usr/bin/tip #SYMLINK /bin/cat usr/sbin/bad144 SYMLINK /bin/cat usr/sbin/chown SYMLINK /bin/cat usr/sbin/chroot +SYMLINK /bin/cat usr/sbin/installboot # it's less confusing to leave instbin there and takes essentially no room. # SPECIAL /bin/rm instbin SPECIAL sync diff --git a/distrib/sparc/floppies/inst/dot.hdprofile b/distrib/sparc/floppies/inst/dot.hdprofile index 6c2d4debaf0..cb84333776f 100644 --- a/distrib/sparc/floppies/inst/dot.hdprofile +++ b/distrib/sparc/floppies/inst/dot.hdprofile @@ -1,4 +1,4 @@ -# $OpenBSD: dot.hdprofile,v 1.4 1997/05/01 18:46:52 grr Exp $ +# $OpenBSD: dot.hdprofile,v 1.5 1997/05/11 22:47:29 grr Exp $ # # Copyright (c) 1994 Christopher G. Demetriou # All rights reserved. @@ -30,11 +30,25 @@ 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,6 +63,55 @@ 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 . /.instutils diff --git a/distrib/sparc/floppies/inst/install.sh b/distrib/sparc/floppies/inst/install.sh index 04490191c7b..86e6958febb 100644 --- a/distrib/sparc/floppies/inst/install.sh +++ b/distrib/sparc/floppies/inst/install.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $OpenBSD: install.sh,v 1.9 1997/05/01 18:46:56 grr Exp $ +# $OpenBSD: install.sh,v 1.10 1997/05/11 22:47:30 grr Exp $ # # Copyright (c) 1994 Christopher G. Demetriou # All rights reserved. @@ -150,15 +150,10 @@ echo "" # 1st arg is 1 more than arg needed args () { - eval echo \$$1 + eval echo \$\{$1\} } -bytes_pser_sect=`cat $MSGBUF | sed -n -e /^${drivename}:/p -e /^${drivename}:/q` -bytes_pser_sect=`args 10 $bytes_pser_sect ` - -echo here bytes_per_sect=`cat $MSGBUF | sed -n -e /^${drivename}:/p -e /^${drivename}:/q` -echo no here bytes_per_sect=`args 10 $bytes_per_sect` echo -n "Number of bytes per disk sector? [$bytes_per_sect] " @@ -286,8 +281,6 @@ echo "" fragsize=1024 blocksize=8192 -$DONTDOIT fsck -t ffs /dev/rfd0a -$DONTDOIT mount -u /dev/fd0a / cat /etc/disktab.preinstall > $DT echo "" >> $DT echo "$labelname|OpenBSD installation generated:\\" >> $DT @@ -456,7 +449,7 @@ done echo "" echo -n "Labeling disk $drivename..." -$DONTDOIT disklabel -w -B $drivename $labelname +$DONTDOIT disklabel -w $drivename $labelname echo " done." if [ "$sect_fwd" = "sf:" ]; then @@ -468,7 +461,6 @@ fi echo "Initializing root filesystem, and mounting..." $DONTDOIT newfs /dev/r${drivename}a $name $DONTDOIT mount -v /dev/${drivename}a /mnt -$DONTDOIT /usr/mdec/binstall -v ffs /mnt if [ "$ename" != "" ]; then echo "" echo "Initializing $ename filesystem, and mounting..." @@ -476,6 +468,10 @@ if [ "$ename" != "" ]; then $DONTDOIT mkdir -p /mnt/$ename $DONTDOIT mount -v /dev/${drivename}e /mnt/$ename fi + +echo "Installing boot block in root filesystem..." +$DONTDOIT /usr/mdec/binstall -v ffs /mnt + if [ "$fname" != "" ]; then echo "" echo "Initializing $fname filesystem, and mounting..." diff --git a/distrib/sparc/floppies/inst/list b/distrib/sparc/floppies/inst/list index 4b45271ed7e..692cbdb8ce5 100644 --- a/distrib/sparc/floppies/inst/list +++ b/distrib/sparc/floppies/inst/list @@ -1,4 +1,4 @@ -# $OpenBSD: list,v 1.5 1997/05/05 16:31:38 grr Exp $ +# $OpenBSD: list,v 1.6 1997/05/11 22:47:31 grr Exp $ # the disktab explanation file COPY disktab.preinstall etc/disktab.preinstall @@ -7,7 +7,7 @@ COPY disktab.preinstall etc/disktab.preinstall COPY dot.profile .profile COPY dot.instutils .instutils COPY install.sh install -#COPY dot.hdprofile tmp/.hdprofile +COPY dot.hdprofile tmp/.hdprofile # we need the contents of /usr/mdec COPYDIR ${DESTDIR}/usr/mdec usr/mdec 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 "" -- cgit v1.2.3