From 0102b044b84b25f5038d355c6342fd54803bd645 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Thu, 30 Apr 2009 00:03:09 +0000 Subject: Redo the fdisk handling for MBR-only architectures (macppc has to get caught up one day, but that is not my battle). Hope people like this tested by oga, ok krw --- distrib/i386/common/install.md | 53 ++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 23 deletions(-) (limited to 'distrib/i386') diff --git a/distrib/i386/common/install.md b/distrib/i386/common/install.md index 2b2598290b8..cfe9f4ff82e 100644 --- a/distrib/i386/common/install.md +++ b/distrib/i386/common/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.39 2009/04/25 03:21:51 deraadt Exp $ +# $OpenBSD: install.md,v 1.40 2009/04/30 00:03:08 deraadt Exp $ # # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -56,39 +56,46 @@ md_installboot() { } md_prep_fdisk() { - local _disk=$1 - - ask_yn "Do you want to use *all* of $_disk for OpenBSD?" - if [[ $resp == y ]]; then - echo -n "Putting all of $_disk into an active OpenBSD MBR partition (type 'A6')..." - fdisk -e ${_disk} <<__EOT >/dev/null + local _disk=$1 _q _d + + while :; do + fdisk $_disk + if [[ -n $(fdisk $_disk | grep ' A6 ') ]]; then + _q=" use the (O)penBSD area," + _d=OpenBSD + else + _q= + _d=whole + fi + 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..." + fdisk -e ${_disk} <<__EOT >/dev/null reinit update write quit __EOT - echo "done." - return - fi - - # Manually configure the MBR. - cat <<__EOT + echo "done." + return ;; + e*|E*) + # Manually configure the MBR. + cat <<__EOT You will now create a single MBR partition to contain your OpenBSD data. This partition must have an id of 'A6'; must *NOT* overlap other partitions; and -must be marked as the only active partition. - -The 'manual' command describes all the fdisk commands in detail. - -$(fdisk ${_disk}) -__EOT - fdisk -e ${_disk} - - cat <<__EOT -Here is the partition information you chose: +must be marked as the only active partition. Inside the fdisk command, the +'manual' command describes all the fdisk commands in detail. $(fdisk ${_disk}) __EOT + fdisk -e ${_disk} + [[ -n $(fdisk $_disk | grep ' A6 ') ]] && return + echo No OpenBSD partition in MBR, try again. ;; + o*|O*) return ;; + esac + done } md_prep_disklabel() { -- cgit v1.2.3