Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/sys/arch/sparc/stand/binstall Pull up revision 1.8 (req...



details:   https://anonhg.NetBSD.org/src/rev/c2009e1cac63
branches:  netbsd-1-5
changeset: 492959:c2009e1cac63
user:      he <he%NetBSD.org@localhost>
date:      Wed Mar 20 22:21:23 2002 +0000

description:
Pull up revision 1.8 (requested by he):
  Add ``-f'' option to binstall.sh and use it.  This is allows boot
  media construction when securelevel > 0.

diffstat:

 sys/arch/sparc/stand/binstall/binstall.sh |  20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diffs (70 lines):

diff -r 4ad5698fa246 -r c2009e1cac63 sys/arch/sparc/stand/binstall/binstall.sh
--- a/sys/arch/sparc/stand/binstall/binstall.sh Wed Mar 20 22:06:18 2002 +0000
+++ b/sys/arch/sparc/stand/binstall/binstall.sh Wed Mar 20 22:21:23 2002 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-#      $NetBSD: binstall.sh,v 1.4.4.1 2000/08/26 00:08:45 mrg Exp $
+#      $NetBSD: binstall.sh,v 1.4.4.2 2002/03/20 22:21:23 he Exp $
 #
 
 vecho () {
@@ -27,6 +27,7 @@
        echo "  -u              - install sparc64 (UltraSPARC) boot block"
        echo "  -U              - install sparc boot block"
        echo "  -b<bootprog>    - second-stage boot program to install"
+       echo "  -f<path name>   - path to device/file image for filesystem"
        echo "  -m<path>        - Look for boot programs in <path> (default: /usr/mdec)"
        echo "  -v              - verbose mode"
        echo "  -t              - test mode (implies -v)"
@@ -34,7 +35,8 @@
 }
 
 Secure () {
-       echo "This script has to be run when the kernel is in 'insecure' mode."
+       echo "This script has to be run when the kernel is in 'insecure' mode,"
+       echo "or when applying bootblocks to a file image (ala vnd)."
        echo "The best way is to run this script in single-user mode."
        exit 1
 }
@@ -49,11 +51,7 @@
        ULTRASPARC=0
 fi
 
-if [ "`sysctl -n kern.securelevel`" -gt 0 ]; then
-       Secure
-fi
-
-set -- `getopt "b:hm:tvuU" "$@"`
+set -- `getopt "b:hm:f:tvuU" "$@"`
 if [ $? -gt 0 ]; then
        Usage
 fi
@@ -65,6 +63,7 @@
        -u) ULTRASPARC=1; shift ;;
        -U) ULTRASPARC=0; shift ;;
        -b) BOOTPROG=$2; OFWBOOT=$2; shift 2 ;;
+       -f) FILENAME=$2; shift 2 ;;
        -m) MDEC=$2; shift 2 ;;
        -t) TEST=1; VERBOSE=1; shift ;;
        -v) VERBOSE=1; shift ;;
@@ -72,6 +71,10 @@
        esac
 done
 
+if [ "`sysctl -n kern.securelevel`" -gt 0 ] && [ ! -f "$FILENAME" ]; then
+       Secure
+fi
+
 DOIT=${TEST:+echo "=>"}
 
 if [ $# != 2 ]; then
@@ -116,6 +119,9 @@
                        break;
                fi
        done`
+       if [ "$FILENAME" != "" ]; then
+               DEV=$FILENAME
+       fi
        if [ "$DEV" = "" ]; then
                echo "Cannot find \"$DEST\" in mount table"
                exit 1



Home | Main Index | Thread Index | Old Index