Source-Changes-HG archive

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

[src/trunk]: src/distrib Instead of abusing the function md_prep_label(), cre...



details:   https://anonhg.NetBSD.org/src/rev/e45a4c40867d
branches:  trunk
changeset: 587286:e45a4c40867d
user:      is <is%NetBSD.org@localhost>
date:      Wed Jan 18 13:39:05 2006 +0000

description:
Instead of abusing the function md_prep_label(), create a new (optional)
md_view_labels() and a variable to mark its availability, so checking of
the available disklabels can be done before the root device is chosen.
Suggested by Martin Bertelsmann.

diffstat:

 distrib/amiga/miniroot/install.md |   8 ++++++--
 distrib/miniroot/install.sh       |  11 +++++++++--
 distrib/miniroot/upgrade.sh       |   9 +++++++--
 3 files changed, 22 insertions(+), 6 deletions(-)

diffs (90 lines):

diff -r 7ff0a9709bbb -r e45a4c40867d distrib/amiga/miniroot/install.md
--- a/distrib/amiga/miniroot/install.md Wed Jan 18 13:19:01 2006 +0000
+++ b/distrib/amiga/miniroot/install.md Wed Jan 18 13:39:05 2006 +0000
@@ -1,7 +1,7 @@
-#      $NetBSD: install.md,v 1.24 2005/12/07 18:25:43 mhitch Exp $
+#      $NetBSD: install.md,v 1.25 2006/01/18 13:39:05 is Exp $
 #
 #
-# Copyright (c) 1996 The NetBSD Foundation, Inc.
+# Copyright (c) 1996,2006 The NetBSD Foundation, Inc.
 # All rights reserved.
 #
 # This code is derived from software contributed to The NetBSD Foundation
@@ -127,6 +127,10 @@
 }
 
 md_prep_disklabel() {
+}
+
+md_view_labels_possible=1
+md_view_labels() {
        _DKDEVS=`md_get_diskdevs`
        echo "If you like, you can now examine the labels of your disks."
        echo ""
diff -r 7ff0a9709bbb -r e45a4c40867d distrib/miniroot/install.sh
--- a/distrib/miniroot/install.sh       Wed Jan 18 13:19:01 2006 +0000
+++ b/distrib/miniroot/install.sh       Wed Jan 18 13:39:05 2006 +0000
@@ -1,7 +1,7 @@
 #!/bin/sh
-#      $NetBSD: install.sh,v 1.22 2000/04/11 08:26:34 pk Exp $
+#      $NetBSD: install.sh,v 1.23 2006/01/18 13:39:05 is Exp $
 #
-# Copyright (c) 1996 The NetBSD Foundation, Inc.
+# Copyright (c) 1996,1997,1999,2000,2006 The NetBSD Foundation, Inc.
 # All rights reserved.
 #
 # This code is derived from software contributed to The NetBSD Foundation
@@ -64,6 +64,11 @@
 #      md_native_fsopts()      - native filesystem options for disk installs
 #      md_makerootwritable()   - make root writable (at least /tmp)
 
+# The following are optional:
+#      md_view_labels_possible - variable: md_view_labels defined
+#      md_view_labels          - peek at preexisting disk labels, to 
+#                                better identify disks
+
 # we need to make sure .'s below work if this directory is not in $PATH
 # dirname may not be available but expr is
 Mydir=`expr $0 : '^\(.*\)/[^/]*$'`
@@ -114,6 +119,8 @@
 # purposes without mounting the miniroot read-write.
 cp /etc/disktab.shadow /tmp/disktab.shadow
 
+test "$md_view_labels_possible" && md_view_labels
+
 while [ "X${ROOTDISK}" = "X" ]; do
        getrootdisk
 done
diff -r 7ff0a9709bbb -r e45a4c40867d distrib/miniroot/upgrade.sh
--- a/distrib/miniroot/upgrade.sh       Wed Jan 18 13:19:01 2006 +0000
+++ b/distrib/miniroot/upgrade.sh       Wed Jan 18 13:39:05 2006 +0000
@@ -1,7 +1,7 @@
 #!/bin/sh
-#      $NetBSD: upgrade.sh,v 1.20 2000/11/17 17:36:39 pk Exp $
+#      $NetBSD: upgrade.sh,v 1.21 2006/01/18 13:39:05 is Exp $
 #
-# Copyright (c) 1996 The NetBSD Foundation, Inc.
+# Copyright (c) 1996-2000,2006 The NetBSD Foundation, Inc.
 # All rights reserved.
 #
 # This code is derived from software contributed to The NetBSD Foundation
@@ -63,6 +63,9 @@
 # optional:
 #      md_upgrade_prep_needed  - variable: set if you md_prepare_upgrade()
 #      md_prepare_upgrade      - any machine dependent preparations
+#      md_view_labels_possible - variable: md_view_labels defined
+#      md_view_labels          - peek at preexisting disk labels, to 
+#                                better identify disks
 
 # we need to make sure .'s below work if this directory is not in $PATH
 # dirname may not be available but expr is
@@ -151,6 +154,8 @@
 # just re-mount the root with read-write enabled.
 md_makerootwritable
 
+test "$md_view_labels_possible" && md_view_labels
+
 while [ "X${ROOTDISK}" = "X" ]; do
        getrootdisk
 done



Home | Main Index | Thread Index | Old Index