Module Name:    src
Committed By:   kre
Date:           Mon Jun 10 08:04:44 UTC 2024

Modified Files:
        src: UPDATING
        src/sbin/gpt: gpt.8 gpt.c

Log Message:
Note need to deal with old libarchive.so files in cdrom images when doing
an update build.


To generate a diff of this commit:
cvs rdiff -u -r1.351 -r1.352 src/UPDATING
cvs rdiff -u -r1.80 -r1.81 src/sbin/gpt/gpt.8
cvs rdiff -u -r1.87 -r1.88 src/sbin/gpt/gpt.c

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

Modified files:

Index: src/UPDATING
diff -u src/UPDATING:1.351 src/UPDATING:1.352
--- src/UPDATING:1.351	Mon Jun 10 01:53:35 2024
+++ src/UPDATING	Mon Jun 10 08:04:44 2024
@@ -1,4 +1,4 @@
-$NetBSD: UPDATING,v 1.351 2024/06/10 01:53:35 gutteridge Exp $
+$NetBSD: UPDATING,v 1.352 2024/06/10 08:04:44 kre Exp $
 
 This file (UPDATING) is intended to be a brief reference to recent
 changes that might cause problems in the build process, and a guide for
@@ -19,6 +19,11 @@ See also: BUILDING, build.sh, Makefile.
 Recent changes:
 ^^^^^^^^^^^^^^^
 
+20240610:
+	Update builds are likely to require removing the objdir for
+	distrib/<arch>/cdroms - or at least references to libarchive
+	from within there after the recent libarchive update.
+
 20240504:
 	Update builds on x86 require making the `cleandir' target in
 	lib/libm, or deleting the objdir for lib/libm.

Index: src/sbin/gpt/gpt.8
diff -u src/sbin/gpt/gpt.8:1.80 src/sbin/gpt/gpt.8:1.81
--- src/sbin/gpt/gpt.8:1.80	Tue Nov  7 00:53:39 2023
+++ src/sbin/gpt/gpt.8	Mon Jun 10 08:04:44 2024
@@ -1,4 +1,4 @@
-.\" $NetBSD: gpt.8,v 1.80 2023/11/07 00:53:39 gutteridge Exp $
+.\" $NetBSD: gpt.8,v 1.81 2024/06/10 08:04:44 kre Exp $
 .\"
 .\" Copyright (c) 2002 Marcel Moolenaar
 .\" All rights reserved.
@@ -629,6 +629,15 @@ and are not currently used by
 They may be used by
 .Nx
 in the future.
+In addition, the notation
+.Ar bit Ns NN ,
+where NN is an integer in the range 48..63 (inclusive)
+allows any of the file-system type specific attribute bits
+to be set.
+This is a hack, and is likely to be changed in a later
+revision, when the ability to set (and decode) attributes
+that are specific to a specific owning partition type is
+added.
 .\" ==== show ====
 .It Nm Ic show Oo Fl aglu Oc Oo Fl i Ar index Oc Oo Fl b Ar startsec Oc
 The

Index: src/sbin/gpt/gpt.c
diff -u src/sbin/gpt/gpt.c:1.87 src/sbin/gpt/gpt.c:1.88
--- src/sbin/gpt/gpt.c:1.87	Wed Dec 13 06:51:57 2023
+++ src/sbin/gpt/gpt.c	Mon Jun 10 08:04:44 2024
@@ -35,7 +35,7 @@
 __FBSDID("$FreeBSD: src/sbin/gpt/gpt.c,v 1.16 2006/07/07 02:44:23 marcel Exp $");
 #endif
 #ifdef __RCSID
-__RCSID("$NetBSD: gpt.c,v 1.87 2023/12/13 06:51:57 mrg Exp $");
+__RCSID("$NetBSD: gpt.c,v 1.88 2024/06/10 08:04:44 kre Exp $");
 #endif
 
 #include <sys/param.h>
@@ -1221,8 +1221,30 @@ gpt_attr_get(gpt_t gpt, uint64_t *attrib
 			if (strcmp(gpt_attr[i].name, ptr) == 0)
 				break;
 		if (i == __arraycount(gpt_attr)) {
-			gpt_warnx(gpt, "Unrecognized attribute `%s'", ptr);
-			rv = -1;
+			long bit;
+			char *ep;
+
+			/*
+			 * XXX
+			 * Allow bitNN for 48 <= NN <= 63
+			 * so the partition type specific bits
+			 * can be accessed (set/cleared) 
+			 *
+			 * This should be fixed so the partition type
+			 * specific bits can be given names, which apply
+			 * only for the appropriate partition type.
+			 */
+			if (strncasecmp(ptr, "bit", 3) == 0 &&
+			    isdigit((int)(unsigned char)ptr[3]) &&
+			    (bit = strtol(ptr + 3, &ep, 10)) >= 48 &&
+			    bit <= 63 &&
+			    *ep == '\0') {
+				*attributes |= 1ULL << (unsigned)bit;
+			} else {
+				gpt_warnx(gpt,
+				    "Unrecognized attribute `%s'", ptr);
+				rv = -1;
+			}
 		} else
 			*attributes |= gpt_attr[i].mask;
 	}
@@ -1274,7 +1296,7 @@ gpt_attr_list(char *buf, size_t len, uin
 	 * (it does build however).
 	 */
 			if (gpt_attr[i].mask & (gpt_attr[i].mask - 1)) {
-				/* This only happens in bits 46..63 */
+				/* This only happens in bits 48..63 */
 
 				/*
 				 * xbuf is big enough for "=65535\0"

Reply via email to