summaryrefslogtreecommitdiffstats
path: root/etc/Makefile
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2013-01-22 21:10:03 +0000
committerbrooks <brooks@FreeBSD.org>2013-01-22 21:10:03 +0000
commit75f69e58cce1b1205e345702e744162ee6c8b275 (patch)
tree8b35141d5c2c2cca08e8c6e2439de91bac41eaa0 /etc/Makefile
parent76aab083f3fb8d8737e23e74c34ae8956236b4ff (diff)
downloadFreeBSD-src-75f69e58cce1b1205e345702e744162ee6c8b275.zip
FreeBSD-src-75f69e58cce1b1205e345702e744162ee6c8b275.tar.gz
Introduce a new option -DNO_ROOT that allows install and distribution
targets to be run without root privilege. Information about ownership, group, flags, and suid bits are stored in the file specified by METALOG which defaults to ${DESTDIR}/METALOG. This file can be used in conjunction with bsdtar or makefs to generate archives or file system images with correct permissions. The packageworld target has been altered to use this metadata allowing non-root releases (subject to further changes in release/Makefile.) Sponsored by: DARPA, AFRL Reviewed by: ian, ray
Diffstat (limited to 'etc/Makefile')
-rw-r--r--etc/Makefile17
1 files changed, 17 insertions, 0 deletions
diff --git a/etc/Makefile b/etc/Makefile
index 33b305a..164cbd4 100644
--- a/etc/Makefile
+++ b/etc/Makefile
@@ -156,6 +156,9 @@ ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
# Special top level files for FreeBSD
FREEBSD=COPYRIGHT
+# Sanitize DESTDIR
+DESTDIR:= ${DESTDIR:C://*:/:g}
+
afterinstall:
.if ${MK_MAN} != "no"
${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb
@@ -324,6 +327,20 @@ distrib-dirs:
-f $$m -p $$d; \
${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
done; true
+.if defined(NO_ROOT)
+ @set ${MTREES}; \
+ while test $$# -ge 2; do \
+ m=${.CURDIR}/$$1; \
+ shift; \
+ d=$$1; \
+ test "$$d" == "/" && d=""; \
+ d=${DISTBASE}$$d; \
+ shift; \
+ ${ECHO} "${MTREE_CMD} -C -f $$m | sed s#^\.#.$$d# >>" \
+ "${METALOG}" ; \
+ ${MTREE_CMD} -C -f $$m | sed s#^\.#.$$d# >> ${METALOG} ; \
+ done; true
+.endif
${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
cd ${DESTDIR}/usr/share/man; \
for mandir in man*; do \
OpenPOWER on IntegriCloud