summaryrefslogtreecommitdiff
path: root/distrib/hp300/ramdisk
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 /distrib/hp300/ramdisk
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.
Diffstat (limited to 'distrib/hp300/ramdisk')
-rw-r--r--distrib/hp300/ramdisk/install.md23
1 files changed, 7 insertions, 16 deletions
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() {