From e3d51c11b03dc4a2b6fcaaf9962a7ef898d4a5d8 Mon Sep 17 00:00:00 2001 From: kn Date: Wed, 26 Apr 2023 23:12:31 +0000 Subject: [PATCH] Treat crypto disk like the root disk, both are boot disks Chosing [W]hole on a GPT disk means it needs non-default `-b' fdisk(8) to boot and preserve any existing BIOS boot partition. With 'Encrypt the root disk?' answered postively, the crypto disk instead of the root disk becomes the boot disk. Extend the sanity check to both crypto and root disk, really asking "is this a boot disk?". This preserves existing boot partitions when using guided disk encryption. --- distrib/riscv64/ramdisk/install.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/distrib/riscv64/ramdisk/install.md b/distrib/riscv64/ramdisk/install.md index fbd8516a253..cd7266cc5ae 100644 --- a/distrib/riscv64/ramdisk/install.md +++ b/distrib/riscv64/ramdisk/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.8 2023/03/07 17:29:42 kn Exp $ +# $OpenBSD: install.md,v 1.9 2023/04/26 23:12:31 kn Exp $ # # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -55,7 +55,8 @@ md_prep_fdisk() { while :; do _d=whole if disk_has $_disk gpt; then - [[ $_disk == $ROOTDISK ]] && bootpart="-b ${bootsectorsize}" + # Is this a boot disk? + [[ $_disk == @($ROOTDISK|$CRYPTOCHUNK) ]] && bootpart="-b ${bootsectorsize}" _type=GPT fdisk $_disk elif disk_has $_disk mbr; then -- 2.20.1