diff --git a/bin/disk-image-create b/bin/disk-image-create index 86ecdf1f..5b40aa28 100755 --- a/bin/disk-image-create +++ b/bin/disk-image-create @@ -25,6 +25,11 @@ export LANG=C export DIB_ARGS="$@" export DIB_ENV=$(export) +# Fedora and others don't always have /usr/local/bin in $PATH +if [[ ! "$PATH" == */usr/local/bin* ]] ; then + export PATH="${PATH}:/usr/local/bin/" +fi + SCRIPTNAME=$(basename $0) SCRIPT_HOME=$(dirname $0) export _LIB=$(dirname $0)/../lib diff --git a/lib/img-functions b/lib/img-functions index f0914840..a943c33c 100644 --- a/lib/img-functions +++ b/lib/img-functions @@ -102,8 +102,9 @@ function create_base () { # Helper function to run a command inside the chroot function run_in_target() { - # -E to preserve http_proxy - sudo -E chroot $TMP_MOUNT_PATH "$@" + # Explicitly set PATH to prevent sudo from resetting it + # and -E to preserve http_proxy + sudo -E PATH=${PATH} chroot $TMP_MOUNT_PATH "$@" } # Helper function to run a directory of scripts inside the chroot