From 221414d5b97aacd40f08eeda664b11fdcf1b9f4e Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Fri, 10 Nov 2023 16:20:53 +0000 Subject: 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++) { -- cgit v1.2.3