summaryrefslogtreecommitdiff
path: root/scripts/build/chroot_hooks
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-05-20 08:19:39 +0200
committerDaniel Baumann <mail@daniel-baumann.ch>2015-05-20 08:19:56 +0200
commit50794b1de1b0211ee4c040a83bba9a5f3148d066 (patch)
tree81416e66e8478945470b097fd69436ef9fe98625 /scripts/build/chroot_hooks
parent3c303e7f53f7843c1f621d0889c4c6fec241ffbf (diff)
downloadvyos-live-build-50794b1de1b0211ee4c040a83bba9a5f3148d066.tar.gz
vyos-live-build-50794b1de1b0211ee4c040a83bba9a5f3148d066.zip
Splitting non-live specific hooks into their own subdirectory within hooks.
Diffstat (limited to 'scripts/build/chroot_hooks')
-rwxr-xr-xscripts/build/chroot_hooks21
1 files changed, 12 insertions, 9 deletions
diff --git a/scripts/build/chroot_hooks b/scripts/build/chroot_hooks
index e25f3b7fd..26ffdd701 100755
--- a/scripts/build/chroot_hooks
+++ b/scripts/build/chroot_hooks
@@ -78,28 +78,32 @@ then
fi
## Processing local hooks
-
-if Find_files config/hooks/live/*.chroot
+if ls config/hooks/*.chroot > /dev/null 2>&1
then
# Restoring cache
Restore_cache cache/packages.chroot
- for _HOOK in config/hooks/live/*.chroot
+ for HOOK in config/hooks/normal/*.binary config/hooks/live/*.binary
do
+ if [ ! -e "${HOOK}" ]
+ then
+ continue
+ fi
+
# Copying hook
- cp "${_HOOK}" chroot/root
+ cp "${HOOK}" chroot/root
# Making hook executable
- if [ ! -x chroot/root/"$(basename ${_HOOK})" ]
+ if [ ! -x chroot/root/"$(basename ${HOOK})" ]
then
- chmod +x chroot/root/"$(basename ${_HOOK})"
+ chmod +x chroot/root/"$(basename ${HOOK})"
fi
# Executing hook
- Chroot chroot "/root/$(basename ${_HOOK})" || { Echo_error "${_HOOK} failed (exit non-zero). You should check for errors."; exit 1 ;}
+ Chroot chroot "/root/$(basename ${HOOK})" || { Echo_error "${HOOK} failed (exit non-zero). You should check for errors."; exit 1 ;}
# Removing hook
- rm -f chroot/root/"$(basename ${_HOOK})"
+ rm -f chroot/root/"$(basename ${HOOK})"
done
# Saving cache
@@ -112,4 +116,3 @@ fi
# Remove bind mount of build config inside chroot.
umount chroot/live-build/config
rmdir chroot/live-build/config
-