git: 842942be28b2 - main - packages: Remove the /boot hack from mtree-to-plist.awk

From: Lexi Winter <ivy_at_FreeBSD.org>
Date: Sun, 26 Oct 2025 02:28:03 UTC
The branch main has been updated by ivy:

URL: https://cgit.FreeBSD.org/src/commit/?id=842942be28b21354e3f547e39fc75bf18ee5b6f7

commit 842942be28b21354e3f547e39fc75bf18ee5b6f7
Author:     Lexi Winter <ivy@FreeBSD.org>
AuthorDate: 2025-10-25 17:18:46 +0000
Commit:     Lexi Winter <ivy@FreeBSD.org>
CommitDate: 2025-10-26 02:22:47 +0000

    packages: Remove the /boot hack from mtree-to-plist.awk
    
    Currently, files in /boot (other than /boot/kernel) are assigned to the
    bootloader package using a filename match in mtree-to-plist.awk.  This
    causes some problems, most notably that debug info for userboot ends up
    in the utilities-dbg package instead of bootloader-dbg.
    
    Remove the path handling from mtree-to-plist and instead set PACKAGE
    in the appropriate Makefiles to put these in the correct package.
    
    While here, move userboot*.so from bootloader-dev to bootloader.
    
    MFC after:      3 days
    Reviewed by:    cperciva
    Sponsored by:   https://www.patreon.com/bsdivy
    Differential Revision:  https://reviews.freebsd.org/D53179
---
 release/scripts/mtree-to-plist.awk | 6 ------
 stand/Makefile.inc                 | 2 ++
 stand/userboot/Makefile.inc        | 4 ++++
 sys/conf/dtb.mk                    | 2 ++
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/release/scripts/mtree-to-plist.awk b/release/scripts/mtree-to-plist.awk
index a9f1e194389a..38c9963680ee 100644
--- a/release/scripts/mtree-to-plist.awk
+++ b/release/scripts/mtree-to-plist.awk
@@ -40,12 +40,6 @@
 		for (i in a) {
 			if (a[i] ~ /^package=/) {
 				pkgname=a[i]
-				if ($1 ~ /^\/boot\//) {
-					if (kernel != "" && $1 ~ /^\/boot\/dtb\//)
-						pkgname="dtb"
-					else if ($1 !~ /^\/boot\/firmware\//)
-						pkgname="bootloader"
-				}
 				gsub(/package=/, "", pkgname)
 			} else if (a[i] == "config") {
 				type="config"
diff --git a/stand/Makefile.inc b/stand/Makefile.inc
index 5d55c4e4a16f..2866ebd20af3 100644
--- a/stand/Makefile.inc
+++ b/stand/Makefile.inc
@@ -1,5 +1,7 @@
 SUBDIR_PARALLEL=	yes
 
+PACKAGE=		bootloader
+
 # Firmware may not be able to handle branch protection failures
 MK_BRANCH_PROTECTION=	no
 
diff --git a/stand/userboot/Makefile.inc b/stand/userboot/Makefile.inc
index 01b5f23410c8..392fd59a115f 100644
--- a/stand/userboot/Makefile.inc
+++ b/stand/userboot/Makefile.inc
@@ -1 +1,5 @@
 .include "../Makefile.inc"
+
+# userboot.so should be installed in the base bootloader package,
+# not bootloader-dev.
+NO_DEV_PACKAGE=
diff --git a/sys/conf/dtb.mk b/sys/conf/dtb.mk
index ec3df525d1e7..2050be7560a4 100644
--- a/sys/conf/dtb.mk
+++ b/sys/conf/dtb.mk
@@ -31,6 +31,8 @@
 
 .include "dtb.build.mk"
 
+PACKAGE?=	dtb
+
 .if !target(install) && !target(realinstall)
 all: ${DTB} ${DTBO}
 realinstall: _dtbinstall