summaryrefslogtreecommitdiff
path: root/distrib
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2021-06-25 17:27:08 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2021-06-25 17:27:08 +0000
commit8ae46050b7612e67afb7a16fc8733a0f21804d2a (patch)
treeee18dbc6531b6a92dd20ed7ea670779bfe11f367 /distrib
parentbd187db27f151800a388dd6739c7066d76b9f8b4 (diff)
Allow (w)hole disk allocation for GPT disks. Use fdisk -A when Apple APFS ISC
partition is detected. Otherwise the normal big hammer fdisk -ig. Only create EFI SYS boot partition on GPT disks that are the ROOTDISK. ok kettenis@ deraadt@
Diffstat (limited to 'distrib')
-rw-r--r--distrib/arm64/ramdisk/install.md32
1 files changed, 16 insertions, 16 deletions
diff --git a/distrib/arm64/ramdisk/install.md b/distrib/arm64/ramdisk/install.md
index 8fb671b4bb1..ffa603cafaf 100644
--- a/distrib/arm64/ramdisk/install.md
+++ b/distrib/arm64/ramdisk/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.19 2021/06/07 07:38:55 kettenis Exp $
+# $OpenBSD: install.md,v 1.20 2021/06/25 17:27:07 krw Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -77,12 +77,9 @@ md_installboot() {
}
md_prep_fdisk() {
- local _disk=$1 _d _plat
-
- case $(sysctl -n machdep.compatible) in
- apple,*) _plat=apple;;
- esac
+ local _disk=$1 _d _type=MBR
+ local bootpart=
local bootparttype="C"
local bootsectorstart="32768"
local bootsectorsize="32768"
@@ -92,23 +89,25 @@ md_prep_fdisk() {
while :; do
_d=whole
- if disk_has $_disk mbr; then
+ if disk_has $_disk gpt; then
+ [[ $_disk == $ROOTDISK ]] && bootpart="-b ${bootsectorsize}"
+ _type=GPT
+ fdisk $_disk
+ elif disk_has $_disk mbr; then
fdisk $_disk
- elif disk_has $_disk gpt; then
- fdisk $_disk
- [[ $_plat == apple ]] && _d=edit
else
echo "MBR has invalid signature; not showing it."
fi
- ask "Use (W)hole disk or (E)dit the MBR?" "$_d"
+ ask "Use (W)hole disk or (E)dit the ${_type}?" $_d
case $resp in
[wW]*)
- if disk_has $_disk gpt apfsisc; then
- echo "(W)hole disk can not be used on Apple NVMe storage!"
- continue
- fi
echo -n "Creating a ${bootfstype} partition and an OpenBSD partition for rest of $_disk..."
- fdisk -e ${_disk} <<__EOT >/dev/null
+ if disk_has $_disk gpt apfsisc; then
+ fdisk -Ay ${bootpart} ${_disk} >/dev/null
+ elif disk_has $_disk gpt; then
+ fdisk -iy -g ${bootpart} ${_disk} >/dev/null
+ else
+ fdisk -e ${_disk} <<__EOT >/dev/null
reinit
e 0
${bootparttype}
@@ -124,6 +123,7 @@ ${bootsectorend}
write
quit
__EOT
+ fi
echo "done."
disklabel $_disk 2>/dev/null | grep -q "^ i:" || disklabel -w -d $_disk
newfs -t ${bootfstype} ${newfs_args} ${_disk}i