diff options
author | Caspar Schutijser <caspar@cvs.openbsd.org> | 2023-04-27 17:04:18 +0000 |
---|---|---|
committer | Caspar Schutijser <caspar@cvs.openbsd.org> | 2023-04-27 17:04:18 +0000 |
commit | af8496df8764efe57cc89f96d3c13cc304313df3 (patch) | |
tree | eb2d7defdb05d05f2b245f241f4449742c45fe20 /distrib | |
parent | 34736d3f5f7a63364588e653f04545ab42ba75d9 (diff) |
arm64 install.md: fix softraid crypto installation on Mac
Make sure we don't newfs the EFI Sys partition on systems that have an
"apfsisc" partition in the case we're installing with softraid crypto.
Debugged with help from and came up with a fix with kn@
"go ahead" kettenis@
"no objections" krw@
OK kn@
Diffstat (limited to 'distrib')
-rw-r--r-- | distrib/arm64/ramdisk/install.md | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/distrib/arm64/ramdisk/install.md b/distrib/arm64/ramdisk/install.md index a790c867ac0..d855aabef0e 100644 --- a/distrib/arm64/ramdisk/install.md +++ b/distrib/arm64/ramdisk/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.46 2023/04/27 10:03:49 kn Exp $ +# $OpenBSD: install.md,v 1.47 2023/04/27 17:04:17 caspar Exp $ # # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -36,6 +36,7 @@ MDBOOTSR=y NCPU=$(sysctl -n hw.ncpufound) COMPATIBLE=$(sysctl -n machdep.compatible) MOUNT_ARGS_msdos="-o-l" +KEEP_EFI_SYS=false md_installboot() { local _disk=$1 _chunks _bootdisk _mdec _plat @@ -109,6 +110,11 @@ md_prep_fdisk() { [wW]*) echo -n "Creating a ${bootfstype} partition and an OpenBSD partition for rest of $_disk..." if disk_has $_disk gpt apfsisc; then + # On Apple hardware, the existing EFI Sys + # partition contains boot firmware and MUST NOT + # be recreated. + KEEP_EFI_SYS=true + # Is this a boot disk? if [[ $_disk == @($ROOTDISK|$CRYPTOCHUNK) ]]; then fdisk -Ay -b "${bootsectorsize}" ${_disk} >/dev/null @@ -119,13 +125,22 @@ md_prep_fdisk() { # Is this a boot disk? if [[ $_disk == @($ROOTDISK|$CRYPTOCHUNK) ]]; then fdisk -gy -b "${bootsectorsize}" ${_disk} >/dev/null - installboot -p $_disk + + # With root on softraid, + # 'installboot -p' on the root disk + # nukes the EFI Sys partition on + # the chunks. + $KEEP_EFI_SYS || installboot -p $_disk else fdisk -gy ${_disk} >/dev/null fi else fdisk -iy -b "${bootsectorsize}@${bootsectorstart}:${bootparttype}" ${_disk} >/dev/null - installboot -p $_disk + + # With root on softraid, 'installboot -p' on + # the root disk nukes the EFI Sys partition on + # the chunks. + $KEEP_EFI_SYS || installboot -p $_disk fi echo "done." return ;; |