summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2003-10-12 13:18:38 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2003-10-12 13:18:38 +0000
commit5c96a7243a206f4cb127c4ec3f5e80431943c89c (patch)
tree57717743f67a9b80a7c1087a2ad7c2960e6a0b6d
parent1dbfe36e75a16bd934b3554b328f7468327e442f (diff)
Cleanup and shrinkage:
1) Eliminate 'WARNING: Disk xxx has no label.' message. When installing OpenBSD this is a normal condition not worth commenting on. From some discussion on hackers/icb. 2) Use consistant verbiage and case statement when checking the disklabel. 3) Consistantly suppress output of 'disklabel -W', reducing duplicate messages like '# using MBR partition ...' which are issued again when the 'disklabel -f ...' command is executed. 4) Usual code rectifications - eliminate extra {}'s, multiple echos elimination, etc.
-rw-r--r--distrib/alpha/common/install.md20
-rw-r--r--distrib/hp300/ramdisk/install.md23
-rw-r--r--distrib/hppa/install.md20
-rw-r--r--distrib/i386/common/install.md16
-rw-r--r--distrib/mac68k/ramdisk/install.md32
-rw-r--r--distrib/mvme68k/ramdisk/install.md13
-rw-r--r--distrib/mvme88k/ramdisk/install.md13
-rw-r--r--distrib/sparc/install.md20
-rw-r--r--distrib/sparc64/common/install.md20
-rw-r--r--distrib/vax/install.md20
10 files changed, 63 insertions, 134 deletions
diff --git a/distrib/alpha/common/install.md b/distrib/alpha/common/install.md
index e14c782009a..e9574d74dfb 100644
--- a/distrib/alpha/common/install.md
+++ b/distrib/alpha/common/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.17 2003/09/21 02:11:42 krw Exp $
+# $OpenBSD: install.md,v 1.18 2003/10/12 13:18:37 krw Exp $
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -65,9 +65,7 @@ md_checkfordisklabel() {
disklabel $1 >/dev/null 2>/tmp/checkfordisklabel
- if grep "no disk label" /tmp/checkfordisklabel; then
- rval=1
- elif grep "disk label corrupted" /tmp/checkfordisklabel; then
+ if grep "disk label corrupted" /tmp/checkfordisklabel; then
rval=2
fi >/dev/null 2>&1
@@ -75,23 +73,17 @@ md_checkfordisklabel() {
return $rval
}
-md_prep_disklabel()
-{
+md_prep_disklabel() {
local _disk=$1
md_checkfordisklabel $_disk
case $? in
- 0) ;;
- 1) echo WARNING: Disk $_disk has no label. You will be creating a new one.
- echo
- ;;
- 2) echo WARNING: Label on disk $_disk is corrupted. You will be repairing.
- echo
+ 2) echo "WARNING: Label on disk $_disk is corrupted. You will be repairing it.\n"
;;
esac
- disklabel -W ${_disk}
- disklabel -f /tmp/fstab.${_disk} -E ${_disk}
+ disklabel -W $_disk >/dev/null 2>&1
+ disklabel -f /tmp/fstab.$_disk -E $_disk
}
md_congrats() {
diff --git a/distrib/hp300/ramdisk/install.md b/distrib/hp300/ramdisk/install.md
index ad4b051c8d6..b5e6c412235 100644
--- a/distrib/hp300/ramdisk/install.md
+++ b/distrib/hp300/ramdisk/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.36 2003/09/21 02:11:42 krw Exp $
+# $OpenBSD: install.md,v 1.37 2003/10/12 13:18:37 krw Exp $
# $NetBSD: install.md,v 1.1.2.4 1996/08/26 15:45:14 gwr Exp $
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -62,9 +62,7 @@ md_checkfordisklabel() {
disklabel -r $1 >/dev/null 2>/tmp/checkfordisklabel
- if grep "no disk label" /tmp/checkfordisklabel; then
- rval=1
- elif grep "disk label corrupted" /tmp/checkfordisklabel; then
+ if grep "disk label corrupted" /tmp/checkfordisklabel; then
rval=2
fi >/dev/null 2>&1
@@ -72,24 +70,17 @@ md_checkfordisklabel() {
return $rval
}
-md_prep_disklabel()
-{
- local _disk
+md_prep_disklabel() {
+ local _disk=$1
- _disk=$1
md_checkfordisklabel $_disk
case $? in
- 0) ;;
- 1) echo "WARNING: Disk $_disk has no label. You will be creating a new one."
- echo
- ;;
- 2) echo "WARNING: Label on disk $_disk is corrupted. You will be repairing."
- echo
+ 2) echo "WARNING: Label on disk $_disk is corrupted. You will be repairing it.\n"
;;
esac
- disklabel -W ${_disk}
- disklabel -f /tmp/fstab.${_disk} -E ${_disk}
+ disklabel -W $_disk >/dev/null 2>&1
+ disklabel -f /tmp/fstab.$_disk -E $_disk
}
md_congrats() {
diff --git a/distrib/hppa/install.md b/distrib/hppa/install.md
index 2df4953be27..86a43d0b0b7 100644
--- a/distrib/hppa/install.md
+++ b/distrib/hppa/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.3 2003/09/21 02:11:42 krw Exp $
+# $OpenBSD: install.md,v 1.4 2003/10/12 13:18:37 krw Exp $
#
# machine dependent section of installation/upgrade script.
#
@@ -23,9 +23,7 @@ md_checkfordisklabel() {
disklabel $1 >/dev/null 2>/tmp/checkfordisklabel
- if grep "no disk label" /tmp/checkfordisklabel; then
- rval=1
- elif grep "disk label corrupted" /tmp/checkfordisklabel; then
+ if grep "disk label corrupted" /tmp/checkfordisklabel; then
rval=2
fi >/dev/null 2>&1
@@ -33,23 +31,17 @@ md_checkfordisklabel() {
return $rval
}
-md_prep_disklabel()
-{
+md_prep_disklabel() {
local _disk=$1
md_checkfordisklabel $_disk
case $? in
- 0) ;;
- 1) echo WARNING: Disk $_disk has no label. You will be creating a new one.
- echo
- ;;
- 2) echo WARNING: Label on disk $_disk is corrupted. You will be repairing.
- echo
+ 2) echo "WARNING: Label on disk $_disk is corrupted. You will be repairing it.\n"
;;
esac
- disklabel -W ${_disk}
- disklabel -f /tmp/fstab.${_disk} -E ${_disk}
+ disklabel -W $_disk >/dev/null 2>&1
+ disklabel -f /tmp/fstab.$_disk -E $_disk
}
md_congrats() {
diff --git a/distrib/i386/common/install.md b/distrib/i386/common/install.md
index 11c87848dfc..672c22f6a4e 100644
--- a/distrib/i386/common/install.md
+++ b/distrib/i386/common/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.20 2003/09/22 01:31:39 krw Exp $
+# $OpenBSD: install.md,v 1.21 2003/10/12 13:18:37 krw Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -103,9 +103,7 @@ md_checkfordisklabel() {
disklabel -r $1 >/dev/null 2>/tmp/checkfordisklabel
- if grep "no disk label" /tmp/checkfordisklabel; then
- rval=1
- elif grep "disk label corrupted" /tmp/checkfordisklabel; then
+ if grep "disk label corrupted" /tmp/checkfordisklabel; then
rval=2
fi >/dev/null 2>&1
@@ -167,16 +165,12 @@ __EOT
md_checkfordisklabel $_disk
case $? in
- 0) ;;
- 1) echo WARNING: Disk $_disk has no label. You will be creating a new one.
- echo
- ;;
- 2) echo WARNING: Label on disk $_disk is corrupted. You will be repairing.
- echo
+ 2) echo "WARNING: Label on disk $_disk is corrupted. You will be repairing it.\n"
;;
esac
- disklabel -f /tmp/fstab.${_disk} -E ${_disk}
+ disklabel -W $_disk >/dev/null 2>&1
+ disklabel -f /tmp/fstab.$_disk -E $_disk
}
md_congrats() {
diff --git a/distrib/mac68k/ramdisk/install.md b/distrib/mac68k/ramdisk/install.md
index a1bc567d3b3..8cb7f4c1c8c 100644
--- a/distrib/mac68k/ramdisk/install.md
+++ b/distrib/mac68k/ramdisk/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.20 2003/09/21 02:11:42 krw Exp $
+# $OpenBSD: install.md,v 1.21 2003/10/12 13:18:37 krw Exp $
#
# Copyright (c) 2002, Miodrag Vallat.
# All rights reserved.
@@ -81,9 +81,7 @@ md_checkfordisklabel() {
disklabel $1 >/dev/null 2>/tmp/checkfordisklabel
- if grep "no OpenBSD or MacOS disk label" /tmp/checkfordisklabel; then
- rval=1
- elif grep "disk label corrupted" /tmp/checkfordisklabel; then
+ if grep "disk label corrupted" /tmp/checkfordisklabel; then
rval=2
elif grep " HFS " /tmp/checkfordisklabel; then
rval=3
@@ -94,27 +92,23 @@ md_checkfordisklabel() {
}
md_prep_disklabel() {
- local _disk=$1
- local _wflag="-W"
+ local _disk=$1 _wflag="-W"
md_checkfordisklabel $_disk
case $? in
- 0) ;;
- 1) echo WARNING: Disk $_disk has no label. You will be creating a new one.
- echo
- ;;
- 2) echo WARNING: Label on disk $_disk is corrupted. You will be repairing.
- echo
- ;;
- 3) echo WARNING: This disk has been set up under Mac OS. For safety reasons, you
- echo will not be allowed to save any disklabel changes from OpenBSD.
- echo
+ 2) echo "WARNING: Label on disk $_disk is corrupted. You will be repairing it.\n"
+ ;;
+ 3) cat <<__EOT
+WARNING: This disk has been set up under Mac OS. For safety reasons, you
+ will not be allowed to save any disklabel changes from OpenBSD.
+
+__EOT
_wflag="-N"
- ;;
+ ;;
esac
- disklabel ${_wflag} ${_disk}
- disklabel -f /tmp/fstab.${_disk} -E ${_disk}
+ disklabel $_wflag $_disk >/dev/null 2>&1
+ disklabel -f /tmp/fstab.$_disk -E $_disk
}
md_congrats() {
diff --git a/distrib/mvme68k/ramdisk/install.md b/distrib/mvme68k/ramdisk/install.md
index aa3637e07ff..07ad69baa72 100644
--- a/distrib/mvme68k/ramdisk/install.md
+++ b/distrib/mvme68k/ramdisk/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.25 2003/09/21 02:11:42 krw Exp $
+# $OpenBSD: install.md,v 1.26 2003/10/12 13:18:37 krw Exp $
# Copyright (c) 1996 The NetBSD Foundation, Inc.
# All rights reserved.
#
@@ -56,9 +56,7 @@ md_checkfordisklabel() {
disklabel $1 >/dev/null 2>/tmp/checkfordisklabel
- if grep "no disk label" /tmp/checkfordisklabel; then
- rval=1
- elif grep "disk label corrupted" /tmp/checkfordisklabel; then
+ if grep "disk label corrupted" /tmp/checkfordisklabel; then
rval=2
fi >/dev/null 2>&1
@@ -66,19 +64,16 @@ md_checkfordisklabel() {
return $rval
}
-md_prep_disklabel()
-{
+md_prep_disklabel() {
local _disk=$1
md_checkfordisklabel $_disk
case $? in
- 1) echo "WARNING: Disk $_disk has no label. You will be creating a new one.\n"
- ;;
2) echo "WARNING: Label on disk $_disk is corrupted. You will be repairing it.\n"
;;
esac
- disklabel -W $_disk
+ disklabel -W $_disk >/dev/null 2>&1
disklabel -f /tmp/fstab.$_disk -E $_disk
}
diff --git a/distrib/mvme88k/ramdisk/install.md b/distrib/mvme88k/ramdisk/install.md
index f3a7df0f223..8c274a4b9b1 100644
--- a/distrib/mvme88k/ramdisk/install.md
+++ b/distrib/mvme88k/ramdisk/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.21 2003/09/21 02:11:42 krw Exp $
+# $OpenBSD: install.md,v 1.22 2003/10/12 13:18:37 krw Exp $
# Copyright (c) 1996 The NetBSD Foundation, Inc.
# All rights reserved.
#
@@ -56,9 +56,7 @@ md_checkfordisklabel() {
disklabel $1 >/dev/null 2>/tmp/checkfordisklabel
- if grep "no disk label" /tmp/checkfordisklabel; then
- rval=1
- elif grep "disk label corrupted" /tmp/checkfordisklabel; then
+ if grep "disk label corrupted" /tmp/checkfordisklabel; then
rval=2
fi >/dev/null 2>&1
@@ -66,19 +64,16 @@ md_checkfordisklabel() {
return $rval
}
-md_prep_disklabel()
-{
+md_prep_disklabel() {
local _disk=$1
md_checkfordisklabel $_disk
case $? in
- 1) echo "WARNING: Disk $_disk has no label. You will be creating a new one.\n"
- ;;
2) echo "WARNING: Label on disk $_disk is corrupted. You will be repairing it.\n"
;;
esac
- disklabel -W $_disk
+ disklabel -W $_disk >/dev/null 2>&1
disklabel -f /tmp/fstab.$_disk -E $_disk
}
diff --git a/distrib/sparc/install.md b/distrib/sparc/install.md
index e45b9bc5b23..c7b022c0547 100644
--- a/distrib/sparc/install.md
+++ b/distrib/sparc/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.49 2003/09/21 02:11:42 krw Exp $
+# $OpenBSD: install.md,v 1.50 2003/10/12 13:18:37 krw Exp $
# $NetBSD: install.md,v 1.3.2.5 1996/08/26 15:45:28 gwr Exp $
#
#
@@ -72,9 +72,7 @@ md_checkfordisklabel() {
disklabel $1 >/dev/null 2>/tmp/checkfordisklabel
- if grep "no disk label" /tmp/checkfordisklabel; then
- rval=1
- elif grep "disk label corrupted" /tmp/checkfordisklabel; then
+ if grep "disk label corrupted" /tmp/checkfordisklabel; then
rval=2
fi >/dev/null 2>&1
@@ -82,23 +80,17 @@ md_checkfordisklabel() {
return $rval
}
-md_prep_disklabel()
-{
+md_prep_disklabel() {
local _disk=$1
md_checkfordisklabel $_disk
case $? in
- 0) ;;
- 1) echo WARNING: Disk $_disk has no label. You will be creating a new one.
- echo
- ;;
- 2) echo WARNING: Label on disk $_disk is corrupted. You will be repairing.
- echo
+ 2) echo "WARNING: Label on disk $_disk is corrupted. You will be repairing it.\n"
;;
esac
- disklabel -W ${_disk}
- disklabel -f /tmp/fstab.${_disk} -E ${_disk}
+ disklabel -W $_disk >/dev/null 2>&1
+ disklabel -f /tmp/fstab.$_disk -E $_disk
}
md_congrats() {
diff --git a/distrib/sparc64/common/install.md b/distrib/sparc64/common/install.md
index 75832fac486..465dcdf8642 100644
--- a/distrib/sparc64/common/install.md
+++ b/distrib/sparc64/common/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.17 2003/09/21 02:11:42 krw Exp $
+# $OpenBSD: install.md,v 1.18 2003/10/12 13:18:37 krw Exp $
# $NetBSD: install.md,v 1.3.2.5 1996/08/26 15:45:28 gwr Exp $
#
#
@@ -82,9 +82,7 @@ md_checkfordisklabel() {
disklabel $1 >/dev/null 2>/tmp/checkfordisklabel
- if grep "no disk label" /tmp/checkfordisklabel; then
- rval=1
- elif grep "disk label corrupted" /tmp/checkfordisklabel; then
+ if grep "disk label corrupted" /tmp/checkfordisklabel; then
rval=2
fi >/dev/null 2>&1
@@ -92,23 +90,17 @@ md_checkfordisklabel() {
return $rval
}
-md_prep_disklabel()
-{
+md_prep_disklabel() {
local _disk=$1
md_checkfordisklabel $_disk
case $? in
- 0) ;;
- 1) echo WARNING: Disk $_disk has no label. You will be creating a new one.
- echo
- ;;
- 2) echo WARNING: Label on disk $_disk is corrupted. You will be repairing.
- echo
+ 2) echo "WARNING: Label on disk $_disk is corrupted. You will be repairing it.\n"
;;
esac
- disklabel -W ${_disk}
- disklabel -f /tmp/fstab.${_disk} -E ${_disk}
+ disklabel -W $_disk >/dev/null 2>&1
+ disklabel -f /tmp/fstab.$_disk -E $_disk
}
md_congrats() {
diff --git a/distrib/vax/install.md b/distrib/vax/install.md
index 261cafc3073..bae8d9d8ded 100644
--- a/distrib/vax/install.md
+++ b/distrib/vax/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.21 2003/09/21 02:11:42 krw Exp $
+# $OpenBSD: install.md,v 1.22 2003/10/12 13:18:37 krw Exp $
# $NetBSD: install.md,v 1.3.2.5 1996/08/26 15:45:28 gwr Exp $
#
#
@@ -60,9 +60,7 @@ md_checkfordisklabel() {
disklabel $1 >/dev/null 2>/tmp/checkfordisklabel
- if grep "no disk label" /tmp/checkfordisklabel; then
- rval=1
- elif grep "disk label corrupted" /tmp/checkfordisklabel; then
+ if grep "disk label corrupted" /tmp/checkfordisklabel; then
rval=2
fi >/dev/null 2>&1
@@ -70,23 +68,17 @@ md_checkfordisklabel() {
return $rval
}
-md_prep_disklabel()
-{
+md_prep_disklabel() {
local _disk=$1
md_checkfordisklabel $_disk
case $? in
- 0) ;;
- 1) echo WARNING: Disk $_disk has no label. You will be creating a new one.
- echo
- ;;
- 2) echo WARNING: Label on disk $_disk is corrupted. You will be repairing.
- echo
+ 2) echo "WARNING: Label on disk $_disk is corrupted. You will be repairing it.\n"
;;
esac
- disklabel -W ${_disk}
- disklabel -f /tmp/fstab.${_disk} -E ${_disk}
+ disklabel -W $_disk >/dev/null 2>&1
+ disklabel -f /tmp/fstab.$_disk -E $_disk
}
md_congrats() {