summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpirofti <pirofti@openbsd.org>2016-09-02 12:22:09 +0000
committerpirofti <pirofti@openbsd.org>2016-09-02 12:22:09 +0000
commita653a82bc1154a403b058895b39c91ae63e1ccd4 (patch)
treef095bc2e4929e2e95673592becd711ef911ce8ee
parentmove links from http to https://www.openbsd.org/ (diff)
downloadwireguard-openbsd-a653a82bc1154a403b058895b39c91ae63e1ccd4.tar.xz
wireguard-openbsd-a653a82bc1154a403b058895b39c91ae63e1ccd4.zip
Fix misleading 'No valid MBR or GPT' message when no OpenBSD area is found.
The current code is too strict and checks for an OpenBSD area inside an MBR or GPT and if it fails to find one reports that there's no valid MBR or GPT (which is misleading because the MBR/GPT is valid). Instead, do two checks (similar to i386): first see if there's an MBR or GPT present on the disk and if there is then check for the OpenBSD area. OK krw@, halex@.
-rw-r--r--distrib/amd64/common/install.md11
1 files changed, 7 insertions, 4 deletions
diff --git a/distrib/amd64/common/install.md b/distrib/amd64/common/install.md
index 2a1174e8952..5a1d626a302 100644
--- a/distrib/amd64/common/install.md
+++ b/distrib/amd64/common/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.51 2016/02/08 17:28:08 krw Exp $
+# $OpenBSD: install.md,v 1.52 2016/09/02 12:22:09 pirofti Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -59,10 +59,13 @@ md_prep_fdisk() {
[[ $MDEFI == y ]] && _d=gpt
- if disk_has $_disk mbr openbsd || disk_has $_disk gpt openbsd; then
- _q="$_q, (O)penBSD area"
- _d=OpenBSD
+ if disk_has $_disk mbr || disk_has $_disk gpt; then
fdisk $_disk
+ if disk_has $_disk mbr openbsd ||
+ disk_has $_disk gpt openbsd; then
+ _q="$_q, (O)penBSD area"
+ _d=OpenBSD
+ fi
else
echo "No valid MBR or GPT."
fi