diff options
author | Robert Peichaer <rpe@cvs.openbsd.org> | 2015-12-18 16:20:59 +0000 |
---|---|---|
committer | Robert Peichaer <rpe@cvs.openbsd.org> | 2015-12-18 16:20:59 +0000 |
commit | 642f1af21cef923dc40111bdf8d73ad9bf24eaa3 (patch) | |
tree | 115756bd1386c56da34a6fcd6b2f4dd9f71127c9 /distrib/octeon/ramdisk/install.md | |
parent | 7bb8951844f201096a47f7d392b76def613a1f3f (diff) |
Introduce a new function disk_has() to inspect a disk if it has a
partition-table of a certain type and optionally if it has a partition
of a certain type.
Use disk_has() in the install.md script to replace all the various
"fdisk <disk> | grep <pattern>" commands greatly simplifying things.
positive feedback from sthen@
"time to get it really tested" deraadt@
OK krw@
Diffstat (limited to 'distrib/octeon/ramdisk/install.md')
-rw-r--r-- | distrib/octeon/ramdisk/install.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/distrib/octeon/ramdisk/install.md b/distrib/octeon/ramdisk/install.md index 32d51279e82..01cd350a421 100644 --- a/distrib/octeon/ramdisk/install.md +++ b/distrib/octeon/ramdisk/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.12 2015/12/02 21:17:17 krw Exp $ +# $OpenBSD: install.md,v 1.13 2015/12/18 16:20:58 rpe Exp $ # # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -53,9 +53,9 @@ md_prep_fdisk() { while :; do _d=whole - if fdisk $_disk | grep -q 'Signature: 0xAA55'; then + if disk_has $_disk mbr; then fdisk $_disk - if fdisk $_disk | grep -q '^..: A6 '; then + if disk_has $_disk mbr openbsd; then _q=", use the (O)penBSD area" _d=OpenBSD fi @@ -101,7 +101,7 @@ at least 16MB and be the first 'MSDOS' partition on the disk. $(fdisk ${_disk}) __EOT fdisk -e ${_disk} - fdisk $_disk | grep -q ' A6 ' && return + disk_has $_disk mbr openbsd && return echo No OpenBSD partition in MBR, try again. ;; o*|O*) [[ $_d == OpenBSD ]] || continue |