diff options
author | Matthijs Kooijman <matthijs@stdin.nl> | 2012-01-10 20:11:52 +0100 |
---|---|---|
committer | Matthijs Kooijman <matthijs@stdin.nl> | 2012-01-10 21:54:58 +0100 |
commit | e7ecf56be3df3623bb3e78a85598f74dbd08b6a0 (patch) | |
tree | 69fc3c47e54861e869f656d993edb3a56be866ad | |
parent | ea491a1a1a81fecfe43ff02a9a627a9f9a9eea85 (diff) | |
download | vyos-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...).
-rwxr-xr-x | scripts/build/lb_chroot_hooks | 17 |
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 + |