diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-06-11 04:28:52 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-06-11 04:28:52 +0000 |
commit | a61ea7305e003810ae54bf1066bc073a054c02a7 (patch) | |
tree | b93dcf1c1df7f79e12d990e92207304157035d13 | |
parent | 7a1f7ce0c39fcad6bf32847efcc53c5c36c8c99b (diff) |
Do not show MBRs without the correct signature, instead say they are
bogus and provide less options to the user
ok krw
-rw-r--r-- | distrib/amd64/common/install.md | 18 | ||||
-rw-r--r-- | distrib/armish/ramdisk/install.md | 18 | ||||
-rw-r--r-- | distrib/i386/common/install.md | 18 | ||||
-rw-r--r-- | distrib/landisk/ramdisk/install.md | 18 | ||||
-rw-r--r-- | distrib/socppc/ramdisk/install.md | 18 |
5 files changed, 50 insertions, 40 deletions
diff --git a/distrib/amd64/common/install.md b/distrib/amd64/common/install.md index 7b00769c99f..1966ef404cb 100644 --- a/distrib/amd64/common/install.md +++ b/distrib/amd64/common/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.22 2009/06/04 00:44:46 krw Exp $ +# $OpenBSD: install.md,v 1.23 2009/06/11 04:28:49 deraadt Exp $ # # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -54,15 +54,17 @@ md_prep_fdisk() { local _disk=$1 _q _d while :; do - fdisk $_disk - if [[ -n $(fdisk $_disk | grep ' A6 ') ]]; then - _q=" use the (O)penBSD area," - _d=OpenBSD + _d=whole + if [[ -n $(fdisk $_disk | grep 'Signature: 0xAA55') ]]; then + fdisk $_disk + if [[ -n $(fdisk $_disk | grep '^..: A6 ') ]]; then + _q=", use the (O)penBSD area," + _d=OpenBSD + fi else - _q= - _d=whole + echo "MBR has invalid signature; not showing it." fi - ask "Use (W)hole disk,$_q or (E)dit the MBR?" "$_d" + ask "Use (W)hole disk$_q or (E)dit the MBR?" "$_d" case $resp in w*|W*) echo -n "Setting OpenBSD MBR partition to whole $_disk..." diff --git a/distrib/armish/ramdisk/install.md b/distrib/armish/ramdisk/install.md index 8b74cbc4ccd..fa66940efa6 100644 --- a/distrib/armish/ramdisk/install.md +++ b/distrib/armish/ramdisk/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.12 2009/06/04 00:44:46 krw Exp $ +# $OpenBSD: install.md,v 1.13 2009/06/11 04:28:50 deraadt Exp $ # # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -39,15 +39,17 @@ md_prep_fdisk() { local _disk=$1 _q _d while :; do - fdisk $_disk - if [[ -n $(fdisk $_disk | grep ' A6 ') ]]; then - _q=" use the (O)penBSD area," - _d=OpenBSD + _d=whole + if [[ -n $(fdisk $_disk | grep 'Signature: 0xAA55') ]]; then + fdisk $_disk + if [[ -n $(fdisk $_disk | grep '^..: A6 ') ]]; then + _q=", use the (O)penBSD area," + _d=OpenBSD + fi else - _q= - _d=whole + echo "MBR has invalid signature; not showing it." fi - ask "Use (W)hole disk,$_q or (E)dit the MBR?" "$_d" + ask "Use (W)hole disk$_q or (E)dit the MBR?" "$_d" case $resp in w*|W*) echo -n "Setting OpenBSD MBR partition to whole $_disk..." diff --git a/distrib/i386/common/install.md b/distrib/i386/common/install.md index 7aaf3a3f63a..1ef30336269 100644 --- a/distrib/i386/common/install.md +++ b/distrib/i386/common/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.45 2009/06/04 00:44:46 krw Exp $ +# $OpenBSD: install.md,v 1.46 2009/06/11 04:28:50 deraadt Exp $ # # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -56,15 +56,17 @@ md_prep_fdisk() { local _disk=$1 _q _d while :; do - fdisk $_disk - if [[ -n $(fdisk $_disk | grep ' A6 ') ]]; then - _q=" use the (O)penBSD area," - _d=OpenBSD + _d=whole + if [[ -n $(fdisk $_disk | grep 'Signature: 0xAA55') ]]; then + fdisk $_disk + if [[ -n $(fdisk $_disk | grep '^..: A6 ') ]]; then + _q=", use the (O)penBSD area," + _d=OpenBSD + fi else - _q= - _d=whole + echo "MBR has invalid signature; not showing it." fi - ask "Use (W)hole disk,$_q or (E)dit the MBR?" "$_d" + ask "Use (W)hole disk$_q or (E)dit the MBR?" "$_d" case $resp in w*|W*) echo -n "Setting OpenBSD MBR partition to whole $_disk..." diff --git a/distrib/landisk/ramdisk/install.md b/distrib/landisk/ramdisk/install.md index 58be58d90bb..e97b402b3e5 100644 --- a/distrib/landisk/ramdisk/install.md +++ b/distrib/landisk/ramdisk/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.24 2009/06/04 00:44:47 krw Exp $ +# $OpenBSD: install.md,v 1.25 2009/06/11 04:28:50 deraadt Exp $ # # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -47,15 +47,17 @@ md_prep_fdisk() { local _disk=$1 _q _d while :; do - fdisk $_disk - if [[ -n $(fdisk $_disk | grep ' A6 ') ]]; then - _q=" use the (O)penBSD area," - _d=OpenBSD + _d=whole + if [[ -n $(fdisk $_disk | grep 'Signature: 0xAA55') ]]; then + fdisk $_disk + if [[ -n $(fdisk $_disk | grep '^..: A6 ') ]]; then + _q=", use the (O)penBSD area," + _d=OpenBSD + fi else - _q= - _d=whole + echo "MBR has invalid signature; not showing it." fi - ask "Use (W)hole disk,$_q or (E)dit the MBR?" "$_d" + ask "Use (W)hole disk$_q or (E)dit the MBR?" "$_d" case $resp in w*|W*) echo -n "Setting OpenBSD MBR partition to whole $_disk..." diff --git a/distrib/socppc/ramdisk/install.md b/distrib/socppc/ramdisk/install.md index da2f00b5d42..a629b2dca62 100644 --- a/distrib/socppc/ramdisk/install.md +++ b/distrib/socppc/ramdisk/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.10 2009/06/04 00:44:47 krw Exp $ +# $OpenBSD: install.md,v 1.11 2009/06/11 04:28:51 deraadt Exp $ # # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -39,15 +39,17 @@ md_prep_fdisk() { local _disk=$1 _q _d while :; do - fdisk $_disk - if [[ -n $(fdisk $_disk | grep ' A6 ') ]]; then - _q=" use the (O)penBSD area," - _d=OpenBSD + _d=whole + if [[ -n $(fdisk $_disk | grep 'Signature: 0xAA55') ]]; then + fdisk $_disk + if [[ -n $(fdisk $_disk | grep '^..: A6 ') ]]; then + _q=", use the (O)penBSD area," + _d=OpenBSD + fi else - _q= - _d=whole + echo "MBR has invalid signature; not showing it." fi - ask "Use (W)hole disk,$_q or (E)dit the MBR?" "$_d" + ask "Use (W)hole disk$_q or (E)dit the MBR?" "$_d" case $resp in w*|W*) echo -n "Setting OpenBSD MBR partition to whole $_disk..." |