From 54ee4acdb694f8d0f7a0a388d40a2044c02c1191 Mon Sep 17 00:00:00 2001 From: krw Date: Fri, 10 Nov 2023 16:20:52 +0000 Subject: [PATCH] GPT partitions have many attributes. Don't stomp on them all when using 'flag ' to make a partition the only bootable partition. Just turn off the bootable bit in the other partitions. ok dlg@ --- sbin/fdisk/cmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/fdisk/cmd.c b/sbin/fdisk/cmd.c index 895a1781d71..fa0399ec74f 100644 --- a/sbin/fdisk/cmd.c +++ b/sbin/fdisk/cmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd.c,v 1.177 2023/11/10 15:41:11 krw Exp $ */ +/* $OpenBSD: cmd.c,v 1.178 2023/11/10 16:20:52 krw Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -517,7 +517,7 @@ Xflag(const char *args, struct mbr *mbr) if (i == pn) gp[i].gp_attrs = GPTPARTATTR_BOOTABLE; else - gp[i].gp_attrs = 0; + gp[i].gp_attrs &= ~GPTPARTATTR_BOOTABLE; } } else { for (i = 0; i < nitems(mbr->mbr_prt); i++) { -- 2.20.1