summaryrefslogtreecommitdiff
path: root/sbin/fdisk/gpt.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2023-05-10 12:59:48 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2023-05-10 12:59:48 +0000
commit7a71023e0dc359b1ca14ed572c7da6924c90bcfc (patch)
tree51399f9053dcc808a6024169811535d1bef15402 /sbin/fdisk/gpt.c
parent7c6a01dee8bd10065fd9282e1680ba19c0a3ecf6 (diff)
Microsoft GPT partition attributes can appear on partitions other
than Basic Data partitions. e.g. Windows Recovery and Windows Reserved partitions. So tweak verbiage to make clear they are MS attributes by prepending 'MS' and always display them. No functional change other than modified fdisk -v output.
Diffstat (limited to 'sbin/fdisk/gpt.c')
-rw-r--r--sbin/fdisk/gpt.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/sbin/fdisk/gpt.c b/sbin/fdisk/gpt.c
index b0fc72fa033..e1f9aef2671 100644
--- a/sbin/fdisk/gpt.c
+++ b/sbin/fdisk/gpt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gpt.c,v 1.89 2023/04/07 16:34:41 krw Exp $ */
+/* $OpenBSD: gpt.c,v 1.90 2023/05/10 12:59:47 krw Exp $ */
/*
* Copyright (c) 2015 Markus Muller <mmu@grummel.net>
* Copyright (c) 2015 Kenneth R Westerback <krw@openbsd.org>
@@ -436,9 +436,7 @@ GPT_print_parthdr(const int verbosity)
void
GPT_print_part(const unsigned int pn, const char *units, const int verbosity)
{
- const uint8_t gpt_uuid_msdos[] = GPT_UUID_MSDOS;
const struct unit_type *ut;
- struct uuid uuid;
char *guidstr = NULL;
double size;
uint64_t attrs, end, start;
@@ -468,17 +466,14 @@ GPT_print_part(const unsigned int pn, const char *units, const int verbosity)
printf("Ignore ");
if (attrs & GPTPARTATTR_BOOTABLE)
printf("Bootable ");
- uuid_dec_be(gpt_uuid_msdos, &uuid);
- if (uuid_compare(&uuid, &gp[pn].gp_type, NULL) == 0) {
- if (attrs & GPTPARTATTR_MS_READONLY)
- printf("ReadOnly " );
- if (attrs & GPTPARTATTR_MS_SHADOW)
- printf("Shadow ");
- if (attrs & GPTPARTATTR_MS_HIDDEN)
- printf("Hidden ");
- if (attrs & GPTPARTATTR_MS_NOAUTOMOUNT)
- printf("NoAutoMount ");
- }
+ if (attrs & GPTPARTATTR_MS_READONLY)
+ printf("MSReadOnly " );
+ if (attrs & GPTPARTATTR_MS_SHADOW)
+ printf("MSShadow ");
+ if (attrs & GPTPARTATTR_MS_HIDDEN)
+ printf("MSHidden ");
+ if (attrs & GPTPARTATTR_MS_NOAUTOMOUNT)
+ printf("MSNoAutoMount ");
printf("\n");
}
}