X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lbuild-initvm.sh;h=886bff1b816637c0ca2df69181cf397d9cf21ccb;hb=8e35c394f7bdbfc14e24c0a56d5b90373e65a6bc;hp=193be78d62328588c9d9d3d04e8df50cc83858c3;hpb=f47278cb82f983de9b7f79aa8dbd86b84cf77cf0;p=build.git diff --git a/lbuild-initvm.sh b/lbuild-initvm.sh index 193be78d..886bff1b 100755 --- a/lbuild-initvm.sh +++ b/lbuild-initvm.sh @@ -8,11 +8,7 @@ DIRNAME=$(dirname $0) BUILD_DIR=$(pwd) # pkgs parsing utilities -PATH=$(dirname $0):$PATH export PATH - -# old guests have e.g. mount in /bin but this is no longer part of -# the standard PATH in recent hosts after usrmove, so let's keep it simple -PATH=$PATH:/bin:/sbin export PATH +export PATH=$(dirname $0):$PATH . build.common @@ -749,17 +745,6 @@ function devel_or_vtest_tools () { return 0 } -# would be much simpler if enter-lxc-namespace was looking along a PATH... -function bin_in_container () { - binary=$1; shift - lxc=$1; shift - - for path in /sbin /bin /usr/bin /usr/sbin; do - [ -f $rootfs_path/$path/$binary ] && { echo $path/$binary; return; } - done - echo bin_in_container_cannot_find_$binary -} - function post_install () { lxc=$1; shift personality=$1; shift @@ -767,7 +752,7 @@ function post_install () { post_install_build $lxc $personality lxc_start $lxc # manually run dhclient in guest - somehow this network won't start on its own - virsh -c lxc:/// lxc-enter-namespace $lxc $(bin_in_container dhclient $lxc) $VIF_GUEST + virsh -c lxc:/// lxc-enter-namespace $lxc $(bin_in_container $lxc dhclient) $VIF_GUEST else post_install_myplc $lxc $personality lxc_start $lxc