From e7ecf56be3df3623bb3e78a85598f74dbd08b6a0 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Tue, 10 Jan 2012 20:11:52 +0100 Subject: 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...). --- scripts/build/lb_chroot_hooks | 17 +++++++++-------- 1 file 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 + -- cgit v1.2.3