summaryrefslogtreecommitdiff
path: root/scripts/build/lb_chroot_hooks
diff options
context:
space:
mode:
authorMatthijs Kooijman <matthijs@stdin.nl>2012-01-10 20:11:52 +0100
committerMatthijs Kooijman <matthijs@stdin.nl>2012-01-10 21:54:58 +0100
commite7ecf56be3df3623bb3e78a85598f74dbd08b6a0 (patch)
tree69fc3c47e54861e869f656d993edb3a56be866ad /scripts/build/lb_chroot_hooks
parentea491a1a1a81fecfe43ff02a9a627a9f9a9eea85 (diff)
downloadvyos-live-build-e7ecf56be3df3623bb3e78a85598f74dbd08b6a0.tar.gz
vyos-live-build-e7ecf56be3df3623bb3e78a85598f74dbd08b6a0.zip
Make the config available to all hooks.
Previously, the config was bindmounted inside the chroot only for hooks from the config dir, now it is done earlier so it is available for all hooks. Note that it is now also done if there are no hooks, but this is probably enough of an exception case to not warrant the extra plumbing required to detect the case (and doing an extra bindmount shouldn't really hurt anyway...).
Diffstat (limited to 'scripts/build/lb_chroot_hooks')
-rwxr-xr-xscripts/build/lb_chroot_hooks17
1 files changed, 9 insertions, 8 deletions
diff --git a/scripts/build/lb_chroot_hooks b/scripts/build/lb_chroot_hooks
index a0459335d..64656a041 100755
--- a/scripts/build/lb_chroot_hooks
+++ b/scripts/build/lb_chroot_hooks
@@ -40,6 +40,10 @@ Create_lockfile .lock
## Processing distribution hooks
+# Make build config available to chroot hooks.
+mkdir -p chroot/root/config
+mount -o bind,ro config chroot/root/config
+
# Copying hooks
for _HOOK in ${LB_CHROOT_HOOKS}
do
@@ -69,10 +73,6 @@ then
# Restoring cache
Restore_cache cache/packages_chroot
- # Make build config available to chroot hooks.
- mkdir -p chroot/root/config
- mount -o bind,ro config chroot/root/config
-
for _HOOK in config/hooks/*.chroot
do
# Copying hook
@@ -91,13 +91,14 @@ then
rm -f chroot/root/"$(basename ${_HOOK})"
done
- # Remove bind mount of build config inside chroot.
- umount chroot/root/config
- rmdir chroot/root/config
-
# Saving cache
Save_cache cache/packages_chroot
# Creating stage file
Create_stagefile .stage/chroot_hooks
fi
+
+# Remove bind mount of build config inside chroot.
+umount chroot/root/config
+rmdir chroot/root/config
+