Makefile.inc1: Honour DB_FROM_SRC for NO_ROOT distributeworld

Currently the host's database files are used, but on non-FreeBSD these
are not necessarily sufficient; in particular, Linux does not have a
wheel group. Instead, use -N to use the in-tree database files when
creating the METALOG entries, as is done for the recursive makes via
IMAKE_MTREE.

Reviewed by:	brooks
Obtained from:	CheriBSD
Differential Revision:	https://reviews.freebsd.org/D35810
This commit is contained in:
Jessica Clarke 2022-07-15 23:03:49 +01:00
parent e60f6384f9
commit 445421abc9

View File

@ -964,12 +964,16 @@ WORLDTMP_MTREEFLAGS= -deUW
# that are created by mtree to be owned by root/wheel.
DESTDIR_MTREEFLAGS+= -W
.endif
DISTR_MTREE= ${MTREE_CMD}
.if ${BUILD_WITH_STRICT_TMPPATH} != 0
DISTR_MTREE= ${WORLDTMP}/legacy/usr/sbin/mtree
.if defined(DB_FROM_SRC)
DISTR_MTREEFLAGS= -N ${.CURDIR}/etc
.endif
WORLDTMP_MTREE= ${DISTR_MTREE} ${WORLDTMP_MTREEFLAGS}
DESTDIR_MTREE= ${DISTR_MTREE} ${DESTDIR_MTREEFLAGS}
DISTR_MTREECMD= ${MTREE_CMD}
.if ${BUILD_WITH_STRICT_TMPPATH} != 0
DISTR_MTREECMD= ${WORLDTMP}/legacy/usr/sbin/mtree
.endif
DISTR_MTREE= ${DISTR_MTREECMD} ${DISTR_MTREEFLAGS}
WORLDTMP_MTREE= ${DISTR_MTREECMD} ${WORLDTMP_MTREEFLAGS}
DESTDIR_MTREE= ${DISTR_MTREECMD} ${DESTDIR_MTREEFLAGS}
# kernel stage
KMAKEENV= ${WMAKEENV:NSYSROOT=*}