Module Name:    src
Committed By:   riastradh
Date:           Wed Sep 27 09:44:10 UTC 2023

Modified Files:
        src/sbin/gpt: gpt_uuid.c gpt_uuid.h

Log Message:
gpt(8): Make gpt type array and enum match again.

Add cross-referencing comment to reduce the probability of these
getting out of sync again.

Should fix a slew of failing tests since kre's recent change to add
windows-recovery to the array but not to the enum:

sbin/gpt/t_gpt:create_2part
sbin/gpt/t_gpt:migrate_disklabel
sbin/gpt/t_gpt:recover_backup
sbin/gpt/t_gpt:recover_primary
sbin/gpt/t_gpt:remove_2part
sbin/gpt/t_gpt:resize_2part
sbin/gpt/t_gpt:restore_2part

Fail: stdout does not match golden output
--- /usr/tests/sbin/gpt/gpt.2part.show.normal   2023-09-26 15:48:30.000000000 
+0000
+++ /tmp/check.sc6ylB/stdout                    2023-09-26 23:30:42.388157924 
+0000
@@ -3,6 +3,6 @@
       1      1         Pri GPT header
       2     32         Pri GPT table
      34   1024      1  GPT part - EFI System
-   1058   9150      2  GPT part - NetBSD FFSv1/FFSv2
+   1058   9150      2  GPT part - NetBSD Cryptographic Disk
   10208     32         Sec GPT table
   10240      1         Sec GPT header

https://releng.netbsd.org/b5reports/i386/commits-2023.09.html#build-2023.09.26.15.47.11


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sbin/gpt/gpt_uuid.c
cvs rdiff -u -r1.9 -r1.10 src/sbin/gpt/gpt_uuid.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/gpt/gpt_uuid.c
diff -u src/sbin/gpt/gpt_uuid.c:1.20 src/sbin/gpt/gpt_uuid.c:1.21
--- src/sbin/gpt/gpt_uuid.c:1.20	Tue Sep 26 15:48:30 2023
+++ src/sbin/gpt/gpt_uuid.c	Wed Sep 27 09:44:10 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: gpt_uuid.c,v 1.20 2023/09/26 15:48:30 kre Exp $	*/
+/*	$NetBSD: gpt_uuid.c,v 1.21 2023/09/27 09:44:10 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 
 #include <sys/cdefs.h>
 #ifdef __RCSID
-__RCSID("$NetBSD: gpt_uuid.c,v 1.20 2023/09/26 15:48:30 kre Exp $");
+__RCSID("$NetBSD: gpt_uuid.c,v 1.21 2023/09/27 09:44:10 riastradh Exp $");
 #endif
 
 #include <err.h>
@@ -65,6 +65,7 @@ static const struct {
 	const char *n;
 	const char *d;
 } gpt_nv[] = {
+	/* Must match the gpt_type_t enum in gpt_uuid.h */
 	{ GPT_ENT_TYPE_APPLE_HFS, "apple", "Apple HFS" },
 	{ GPT_ENT_TYPE_APPLE_UFS, "apple-ufs", "Apple UFS" },
 	{ GPT_ENT_TYPE_BIOS, "bios", "BIOS Boot" },

Index: src/sbin/gpt/gpt_uuid.h
diff -u src/sbin/gpt/gpt_uuid.h:1.9 src/sbin/gpt/gpt_uuid.h:1.10
--- src/sbin/gpt/gpt_uuid.h:1.9	Sun Jun 30 11:38:16 2019
+++ src/sbin/gpt/gpt_uuid.h	Wed Sep 27 09:44:10 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: gpt_uuid.h,v 1.9 2019/06/30 11:38:16 sevan Exp $	*/
+/*	$NetBSD: gpt_uuid.h,v 1.10 2023/09/27 09:44:10 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -46,7 +46,7 @@
  * support anyway
  */
 
-// Must match the array in gpt_uuid.c
+/* Must match the gpt_nv array in gpt_uuid.c */
 typedef enum {
 	GPT_TYPE_INVALID = -1,
 	GPT_TYPE_APPLE_HFS = 0,
@@ -64,6 +64,7 @@ typedef enum {
 	GPT_TYPE_LINUX_LVM,
 	GPT_TYPE_MS_BASIC_DATA,
 	GPT_TYPE_MS_RESERVED,
+	GPT_TYPE_MS_RECOVERY,
 	GPT_TYPE_NETBSD_CCD,
 	GPT_TYPE_NETBSD_CGD,
 	GPT_TYPE_NETBSD_FFS,

Reply via email to