summaryrefslogtreecommitdiff
path: root/distrib/landisk
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2009-04-30 00:03:09 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2009-04-30 00:03:09 +0000
commit0102b044b84b25f5038d355c6342fd54803bd645 (patch)
tree22d691644fa68aa093aa7a5986063e7dd051ab76 /distrib/landisk
parentb8ace5142f6f2623be105ea7b03e07bd85b6ae89 (diff)
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
Diffstat (limited to 'distrib/landisk')
-rw-r--r--distrib/landisk/ramdisk/install.md53
1 files changed, 30 insertions, 23 deletions
diff --git a/distrib/landisk/ramdisk/install.md b/distrib/landisk/ramdisk/install.md
index 66541c9e7a1..1baba0e73d2 100644
--- a/distrib/landisk/ramdisk/install.md
+++ b/distrib/landisk/ramdisk/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.18 2009/04/12 12:56:02 krw Exp $
+# $OpenBSD: install.md,v 1.19 2009/04/30 00:03:08 deraadt Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -51,39 +51,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() {