# HG changeset patch # Parent 6347303add28f7d4b7bd3b0a95f4d8a51527679c Migrate NO_ROOT to WITH/WITHOUT_ROOT, and provide backwards compatibility. diff -r 6347303add28 Makefile.inc1 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -13,7 +13,6 @@ # -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel # -DNO_KERNELOBJ do not run ${MAKE} obj in ${MAKE} buildkernel # -DNO_PORTSUPDATE do not update ports in ${MAKE} update -# -DNO_ROOT install without using root privilege # -DNO_DOCUPDATE do not update doc in ${MAKE} update # -DWITHOUT_CTF do not run the DTrace CTF conversion tools on built objects # LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list @@ -24,7 +23,7 @@ # LOCAL_TOOL_DIRS="list of dirs" to add additional dirs to the build-tools # list # METALOG="path to metadata log" to write permission and ownership -# when NO_ROOT is set. (default: ${DESTDIR}/METALOG) +# when MK_ROOT=no. (default: ${DESTDIR}/METALOG) # TARGET="machine" to crossbuild world for a different machine type # TARGET_ARCH= may be required when a TARGET supports multiple endians # BUILDENV_SHELL= shell to launch for the buildenv target (def:/bin/sh) @@ -307,8 +306,8 @@ WMAKEENV= ${CROSSENV} \ # make hierarchy HMAKE= PATH=${TMPPATH} ${MAKE} LOCAL_MTREE=${LOCAL_MTREE:Q} -.if defined(NO_ROOT) -HMAKE+= PATH=${TMPPATH} METALOG=${METALOG} -DNO_ROOT +.if MK_ROOT == "no" +HMAKE+= PATH=${TMPPATH} METALOG=${METALOG} MK_ROOT=no .endif .if ${MK_CDDL} == "no" @@ -460,13 +459,13 @@ MTREEFLAGS+= -N ${.CURDIR}/etc .endif _INSTALL_DDIR= ${DESTDIR}/${DISTDIR} INSTALL_DDIR= ${_INSTALL_DDIR:S://:/:g:C:/$::} -.if defined(NO_ROOT) +.if MK_ROOT == "no" METALOG?= ${DESTDIR}/${DISTDIR}/METALOG -IMAKE+= -DNO_ROOT METALOG=${METALOG} +IMAKE+= MK_ROOT=no METALOG=${METALOG} INSTALLFLAGS+= -U -M ${METALOG} -D ${INSTALL_DDIR} MTREEFLAGS+= -W .endif -.if defined(DB_FROM_SRC) || defined(NO_ROOT) +.if defined(DB_FROM_SRC) || MK_ROOT == "no" IMAKE_INSTALL= INSTALL="install ${INSTALLFLAGS}" IMAKE_MTREE= MTREE_CMD="mtree ${MTREEFLAGS}" .endif @@ -850,7 +849,7 @@ distributeworld installworld: _installch done); \ cp $$libs $$progs ${INSTALLTMP} cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale -.if defined(NO_ROOT) +.if MK_ROOT == "no" echo "#${MTREE_MAGIC}" > ${METALOG} .endif .if make(distributeworld) @@ -871,7 +870,7 @@ distributeworld installworld: _installch mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \ -p ${DESTDIR}/${DISTDIR}/${dist}${TESTSBASE} >/dev/null .endif -.if defined(NO_ROOT) +.if MK_ROOT == "no" ${IMAKEENV} mtree -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \ sed -e 's#^\./#./${dist}/#' >> ${METALOG} ${IMAKEENV} mtree -C -f ${.CURDIR}/etc/mtree/BSD.usr.dist | \ @@ -892,7 +891,7 @@ distributeworld installworld: _installch .for dist in ${EXTRA_DISTRIBUTIONS} find ${DESTDIR}/${DISTDIR}/${dist} -mindepth 1 -empty -delete .endfor -.if defined(NO_ROOT) +.if MK_ROOT == "no" .for dist in base ${EXTRA_DISTRIBUTIONS} @# For each file that exists in this dist, print the corresponding @# line from the METALOG. This relies on the fact that @@ -918,7 +917,7 @@ distributeworld installworld: _installch packageworld: .for dist in base ${EXTRA_DISTRIBUTIONS} -.if defined(NO_ROOT) +.if MK_ROOT == "no" ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz \ --exclude usr/lib/debug \ @@ -931,7 +930,7 @@ packageworld: .endfor .for dist in ${DEBUG_DISTRIBUTIONS} -. if defined(NO_ROOT) +. if MK_ROOT == "no" ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ tar cvJf ${DESTDIR}/${DISTDIR}/${dist}-dbg.txz \ @${DESTDIR}/${DISTDIR}/${dist}.debug.meta @@ -1114,7 +1113,7 @@ distributekernel distributekernel.debug: false .endif mkdir -p ${DESTDIR}/${DISTDIR} -.if defined(NO_ROOT) +.if MK_ROOT == "no" echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.premeta .endif cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ @@ -1122,12 +1121,12 @@ distributekernel distributekernel.debug: ${IMAKE_MTREE} PATH=${TMPPATH} ${MAKE} KERNEL=${INSTKERNNAME} \ DESTDIR=${INSTALL_DDIR}/kernel \ ${.TARGET:S/distributekernel/install/} -.if defined(NO_ROOT) +.if MK_ROOT == "no" sed -e 's|^./kernel|.|' ${DESTDIR}/${DISTDIR}/kernel.premeta > \ ${DESTDIR}/${DISTDIR}/kernel.meta .endif .for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} -.if defined(NO_ROOT) +.if MK_ROOT == "no" echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta .endif cd ${KRNLOBJDIR}/${_kernel}; \ @@ -1136,7 +1135,7 @@ distributekernel distributekernel.debug: KERNEL=${INSTKERNNAME}.${_kernel} \ DESTDIR=${INSTALL_DDIR}/kernel.${_kernel} \ ${.TARGET:S/distributekernel/install/} -.if defined(NO_ROOT) +.if MK_ROOT == "no" sed -e 's|^./kernel|.|' \ ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta > \ ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta @@ -1144,7 +1143,7 @@ distributekernel distributekernel.debug: .endfor packagekernel: -.if defined(NO_ROOT) +.if MK_ROOT == "no" cd ${DESTDIR}/${DISTDIR}/kernel; \ tar cvJf ${DESTDIR}/${DISTDIR}/kernel.txz \ @${DESTDIR}/${DISTDIR}/kernel.meta diff -r 6347303add28 etc/Makefile --- a/etc/Makefile +++ b/etc/Makefile @@ -193,7 +193,7 @@ CAP_MKDB_ENDIAN?= PWD_MKDB_ENDIAN?= .endif -.if defined(NO_ROOT) +.if MK_ROOT == "no" METALOG.add?= cat -l >> ${METALOG} .endif @@ -218,7 +218,7 @@ distribution: .endif pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \ ${DESTDIR}/etc/master.passwd -.if defined(NO_ROOT) +.if MK_ROOT == "no" ( \ echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \ echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \ @@ -354,7 +354,7 @@ distrib-dirs: ${MTREES:N/*} -f $$m -p $$d; \ ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \ done; true -.if defined(NO_ROOT) +.if MK_ROOT == "no" @set ${MTREES}; \ while test $$# -ge 2; do \ m=${.CURDIR}/$$1; \ diff -r 6347303add28 share/mk/src.opts.mk --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -131,6 +131,7 @@ RCMDS \ RCS \ RESCUE \ + ROOT \ ROUTED \ SENDMAIL \ SETUID_LOGIN \ @@ -370,4 +371,9 @@ MK_GNUCXX:=no MK_GCC:=no .endif +# Transition away from NO_ROOT -> WITHOUT_ROOT +.if defined(NO_ROOT) +MK_ROOT:=no +.endif + .endif # !target(____) diff -r 6347303add28 tools/build/options/WITHOUT_ROOT --- /dev/null +++ b/tools/build/options/WITHOUT_ROOT @@ -0,0 +1,21 @@ +.\" $FreeBSD$ +The +.It hierarchy, +.It installkernel, +.It installworld, +.It distributeworld, +.It distributeworld, +.It packageworld, +.It reinstalkernel +or +.It packagekernel +.Xr make 1 +targets copy the files to the proper location and create a METALOG file which +contains all the metadata about ownership, permissions, etc for files in the +system. +.Xr makefs 8 +can use this log to create a filesystem image with the correct metadata +without the need to use root privilege to set this metadata in the host's +filesystem. +This option has no effect for any build targets. +This option does not work when building an individual directory.