release: Use unprivileged mode for bootonly and mini-memstick

This in effect always builds these targets in NO_ROOT mode, removing
one more instance where release artifact builds require a privileged
user (root).  These artifacts are now always built the same way.

Reviewed by:	brooks, Pat Maddox <pat@patmaddox.com>
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48121
This commit is contained in:
Ed Maste 2025-03-07 06:46:01 -05:00
parent 136c5e17b6
commit cbba69fb57

View file

@ -225,14 +225,12 @@ bootonly: packagesystem
MK_TOOLCHAIN=no \
MK_RESCUE=no MK_DICT=no \
MK_KERNEL_SYMBOLS=no MK_TESTS=no MK_DEBUG_FILES=no \
-DDB_FROM_SRC )
-DDB_FROM_SRC -DNO_ROOT)
# Copy manifest only (no distfiles) to get checksums
mkdir -p ${.TARGET}/usr/freebsd-dist
cp MANIFEST ${.TARGET}/usr/freebsd-dist
.if defined(NO_ROOT)
echo "./usr/freebsd-dist type=dir uname=root gname=wheel mode=0755" >> ${.TARGET}/METALOG
echo "./usr/freebsd-dist/MANIFEST type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
.endif
# Set up installation environment
ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf
echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf
@ -242,13 +240,11 @@ bootonly: packagesystem
echo kernels_autodetect=\"NO\" >> ${.TARGET}/boot/loader.conf
echo loader_menu_multi_user_prompt=\"Installer\" >> ${.TARGET}/boot/loader.conf
cp ${.CURDIR}/rc.local ${.TARGET}/etc
.if defined(NO_ROOT)
echo "./etc/resolv.conf type=link uname=root gname=wheel mode=0644 link=/tmp/bsdinstall_etc/resolv.conf" >> ${.TARGET}/METALOG
echo "./etc/rc.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
echo "./etc/sysctl.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
echo "./boot/loader.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
echo "./etc/rc.local type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
.endif
dvd: packagesystem
# Install system
@ -307,7 +303,7 @@ dvd1.iso: dvd pkg-stage
cd dvd && sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b ${VOLUME_LABEL}_DVD ../${.TARGET} .${NO_ROOT:D/METALOG} ${XTRADIR}
bootonly.iso: bootonly-bootonly
cd bootonly-bootonly && sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b ${VOLUME_LABEL}_BO ../${.TARGET} .${NO_ROOT:D/METALOG} ${XTRADIR}
cd bootonly-bootonly && sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b ${VOLUME_LABEL}_BO ../${.TARGET} ./METALOG ${XTRADIR}
memstick: memstick.img
memstick.img: disc1-memstick
@ -315,7 +311,7 @@ memstick.img: disc1-memstick
mini-memstick: mini-memstick.img
mini-memstick.img: bootonly-memstick
cd bootonly-memstick && sh ${.CURDIR}/${TARGET}/make-memstick.sh .${NO_ROOT:D/METALOG} ../${.TARGET}
cd bootonly-memstick && sh ${.CURDIR}/${TARGET}/make-memstick.sh ./METALOG ../${.TARGET}
packagesystem: ${DISTRIBUTIONS}
sh ${.CURDIR}/scripts/make-manifest.sh $$(ls *.txz | grep -v container) > MANIFEST