git: f36b5d8a8c30 - main - release: Include an etcupdate tree in -DNO_ROOT release image builds
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 09 Aug 2022 21:59:08 UTC
The branch main has been updated by jrtc27:
URL: https://cgit.FreeBSD.org/src/commit/?id=f36b5d8a8c3090da9121a32131667580ff678a69
commit f36b5d8a8c3090da9121a32131667580ff678a69
Author: Jessica Clarke <jrtc27@FreeBSD.org>
AuthorDate: 2022-08-09 21:58:01 +0000
Commit: Jessica Clarke <jrtc27@FreeBSD.org>
CommitDate: 2022-08-09 21:58:01 +0000
release: Include an etcupdate tree in -DNO_ROOT release image builds
This makes use of the new -N etcupdate flag and merges the resulting
METALOG into base.meta re-rooted to /var/db/etcupdate/current.
Reviewed by: gjb
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D35858
---
release/Makefile | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/release/Makefile b/release/Makefile
index fe932b3d1a76..7aeca8cc0276 100644
--- a/release/Makefile
+++ b/release/Makefile
@@ -117,15 +117,22 @@ clean: beforeclean
base.txz:
mkdir -p ${DISTDIR}
cd ${WORLDDIR} && ${IMAKE} distributeworld DISTDIR=${.OBJDIR}/${DISTDIR}
-# TODO: Add NO_ROOT mode to mm-tree.sh and etcupdate
+# TODO: Add NO_ROOT mode to mm-tree.sh
.if !defined(NO_ROOT)
# Set up mergemaster root database
sh ${.CURDIR}/scripts/mm-mtree.sh -m ${WORLDDIR} -F \
"TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET} ${.MAKE.JOBS:D-j${.MAKE.JOBS}}" \
-D "${.OBJDIR}/${DISTDIR}/base"
+.endif
sh ${WORLDDIR}/usr.sbin/etcupdate/etcupdate.sh extract -B \
-m "${MAKE}" -M "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}" \
- -s ${WORLDDIR} -d "${.OBJDIR}/${DISTDIR}/base/var/db/etcupdate"
+ -s ${WORLDDIR} -d "${.OBJDIR}/${DISTDIR}/base/var/db/etcupdate" \
+ ${NO_ROOT:D-N}
+.if defined(NO_ROOT)
+ echo "./var/db/etcupdate type=dir uname=root gname=wheel mode=0755" >> ${.OBJDIR}/${DISTDIR}/base.meta
+ sed -n 's,^\.,./var/db/etcupdate/current,p' ${.OBJDIR}/${DISTDIR}/base/var/db/etcupdate/current/METALOG \
+ >> ${.OBJDIR}/${DISTDIR}/base.meta
+ rm ${.OBJDIR}/${DISTDIR}/base/var/db/etcupdate/current/METALOG
.endif
# Package all components
cd ${WORLDDIR} && ${IMAKE} packageworld DISTDIR=${.OBJDIR}/${DISTDIR}