git: 41adc5f29ba6 - main - release: Always use NO_ROOT for distribute* and package*
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 13 Dec 2024 17:09:56 UTC
The branch main has been updated by emaste:
URL: https://cgit.FreeBSD.org/src/commit/?id=41adc5f29ba6955e09f46e4d2c25da6fcd263ba2
commit 41adc5f29ba6955e09f46e4d2c25da6fcd263ba2
Author: Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2024-12-12 01:36:15 +0000
Commit: Ed Maste <emaste@FreeBSD.org>
CommitDate: 2024-12-13 17:08:01 +0000
release: Always use NO_ROOT for distribute* and package*
We used to have two different code paths for generating release media
dist sets, one which expected to run as root, and one which did not.
It was possible that the two different paths could generate different
results.
We can use the path that does not *require* root also when running as
root, so use it always. We'll want to do eventually do the same for all
release targets, but these ones are an easy place to start.
Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48041
---
release/Makefile | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/release/Makefile b/release/Makefile
index ee2f52ad56af..6b05b986318d 100644
--- a/release/Makefile
+++ b/release/Makefile
@@ -132,26 +132,24 @@ clean: beforeclean
base.txz:
mkdir -p ${DISTDIR}
- ( cd ${WORLDDIR} && ${IMAKE} distributeworld DISTDIR=${.OBJDIR}/${DISTDIR} )
+ ( cd ${WORLDDIR} && ${IMAKE} -DNO_ROOT distributeworld DISTDIR=${.OBJDIR}/${DISTDIR} )
# Bootstrap etcupdate(8) database.
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" \
- -L /dev/null ${NO_ROOT:D-N}
-.if defined(NO_ROOT)
+ -L /dev/null -N
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} )
+ ( cd ${WORLDDIR} && ${IMAKE} -DNO_ROOT packageworld DISTDIR=${.OBJDIR}/${DISTDIR} )
mv ${DISTDIR}/*.txz .
kernel.txz:
mkdir -p ${DISTDIR}
- ( cd ${WORLDDIR} && ${IMAKE} distributekernel DISTDIR=${.OBJDIR}/${DISTDIR} )
- ( cd ${WORLDDIR} && ${IMAKE} packagekernel DISTDIR=${.OBJDIR}/${DISTDIR} )
+ ( cd ${WORLDDIR} && ${IMAKE} -DNO_ROOT distributekernel DISTDIR=${.OBJDIR}/${DISTDIR} )
+ ( cd ${WORLDDIR} && ${IMAKE} -DNO_ROOT packagekernel DISTDIR=${.OBJDIR}/${DISTDIR} )
mv ${DISTDIR}/kernel*.txz .
src.txz: