From 8e7676ca3255a4e35397fa3383bb086366eb74f7 Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Wed, 6 Apr 2016 23:17:05 +0000 Subject: [PATCH] Add optional configuration knob NANO_CUST_FILES_MTREE. If set, it will require an entry in custom mtree definition for every custom installed file. Obtained from: Netflix --- tools/tools/nanobsd/defaults.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh index d8812761545..3b28b392258 100755 --- a/tools/tools/nanobsd/defaults.sh +++ b/tools/tools/nanobsd/defaults.sh @@ -52,6 +52,11 @@ NANO_PACKAGE_LIST="*" # where package metadata gets placed NANO_PKG_META_BASE=/var/db +# Path to mtree file to apply to anything copied by cust_install_files(). +# If you specify this, the mtree file *must* have an entry for every file and +# directory located in Files. +#NANO_CUST_FILES_MTREE="" + # Object tree directory # default is subdir of /usr/obj #NANO_OBJ="" @@ -909,6 +914,10 @@ cust_allow_ssh_root ( ) ( cust_install_files ( ) ( cd "${NANO_TOOLS}/Files" find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)' | cpio -Ldumpv ${NANO_WORLDDIR} + + if [ -f ${NANO_CUST_FILES_MTREE} ]; then + CR "mtree -eiU -p /" <${NANO_CUST_FILES_MTREE} + fi ) #######################################################################