diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2003-10-12 13:18:38 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2003-10-12 13:18:38 +0000 |
commit | 5c96a7243a206f4cb127c4ec3f5e80431943c89c (patch) | |
tree | 57717743f67a9b80a7c1087a2ad7c2960e6a0b6d /distrib/mac68k/ramdisk/install.md | |
parent | 1dbfe36e75a16bd934b3554b328f7468327e442f (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/mac68k/ramdisk/install.md')
-rw-r--r-- | distrib/mac68k/ramdisk/install.md | 32 |
1 files changed, 13 insertions, 19 deletions
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() { |