diff options
Diffstat (limited to 'helpers')
-rwxr-xr-x | helpers/lh_binary_chroot | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/helpers/lh_binary_chroot b/helpers/lh_binary_chroot index f6615e1..50d3d67 100755 --- a/helpers/lh_binary_chroot +++ b/helpers/lh_binary_chroot @@ -78,6 +78,21 @@ ${LH_ROOT_COMMAND} rm -rf chroot.tmp ${LH_ROOT_COMMAND} cp -a chroot chroot.tmp ${LH_ROOT_COMMAND} mv chroot.tmp chroot/chroot +if [ -f config/binary_rootfs/exclude ] +then + # Read exclude file and expand wildcards. + for EXCLUDE in `cat config/binary_rootfs/exclude` + do + if [ -e chroot/chroot/"${EXCLUDE}" ] + then + # Run "rm" inside the chroot so it cannot possibly remove host files. + Chroot "rm -r chroot/${EXCLUDE}" + else + Echo_warning "Excluded path does not exist: ${EXCLUDE}" + fi + done +fi + if [ -n "${LH_ROOT_COMMAND}" ] then ${LH_ROOT_COMMAND} chown -R $(whoami):$(whoami) chroot |