aboutsummaryrefslogtreecommitdiff
path: root/etc/Makefile
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2013-01-22 21:10:03 +0000
committerBrooks Davis <brooks@FreeBSD.org>2013-01-22 21:10:03 +0000
commit4a63ae115090c0b413d0532a291eac14bc6effe5 (patch)
tree8b35141d5c2c2cca08e8c6e2439de91bac41eaa0 /etc/Makefile
parent3a6df89b646ab67c372783f6630a8f379d601572 (diff)
downloadsrc-4a63ae115090c0b413d0532a291eac14bc6effe5.tar.gz
src-4a63ae115090c0b413d0532a291eac14bc6effe5.zip
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
Notes
Notes: svn path=/head/; revision=245825
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 33b305a36512..164cbd4ba851 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 \