Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Dec 2025 18:05:56 +0000
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 23aaa07e6da6 - stable/15 - Makefile.inc1: Force NO_ROOT for distribute* and package*
Message-ID:  <6939b684.b952.4b0a1bbc@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help

The branch stable/15 has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=23aaa07e6da6c2125a8f7bfc15966d34c5ed7340

commit 23aaa07e6da6c2125a8f7bfc15966d34c5ed7340
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2024-12-11 13:50:55 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2025-12-10 18:05:09 +0000

    Makefile.inc1: Force NO_ROOT for distribute* and package*
    
    These targets are used to produce legacy dist sets for install media and
    now always use NO_ROOT mode.  Extend existing logic that forces NO_ROOT
    mode to these cases to ensure they do not run in the wrong mode.
    
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D50551
    
    (cherry picked from commit 300aa267efaa08564337797e89590737a7cc6af0)
---
 Makefile.inc1 | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/Makefile.inc1 b/Makefile.inc1
index 6ef7bdf101f7..2c4a73c5c743 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -198,13 +198,18 @@ _GCC_BROKEN=boot code linker script issues.
 .endif
 
 .if ${.MAKE.OS} != "FreeBSD"
-CROSSBUILD_HOST=${.MAKE.OS}
+CROSSBUILD_HOST=${.MAKE.OS} # Unset for native FreeBSD builds
 .if ${.MAKE.OS} != "Linux" && ${.MAKE.OS} != "Darwin"
 .warning Unsupported crossbuild system: ${.MAKE.OS}. Build will probably fail!
 .endif
+.endif
 # We need to force NO_ROOT/DB_FROM_SRC builds when building on other operating
 # systems since the BSD.foo.dist specs contain users and groups that do not
-# exist by default on a Linux/MacOS system.
+# exist by default on a Linux/MacOS system.  The distribute* and package*
+# targets used for install media legacy distribution sets also always use and
+# require NO_ROOT mode.
+.if defined(CROSSBUILD_HOST) || make(distributeworld) || make(packageworld) || \
+    make(distributekernel) || make(packagekernel)
 NO_ROOT:=	1
 DB_FROM_SRC:=	1
 .export NO_ROOT



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6939b684.b952.4b0a1bbc>