From: Michael Tremer Date: Fri, 5 Jul 2024 10:43:26 +0000 (+0000) Subject: make.sh: run_command: Fix basedir in and outside the chroot X-Git-Tag: v2.29-core188~10^2~333 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0059a357de378cf40000e995d072f8efdceaf433;p=ipfire-2.x.git make.sh: run_command: Fix basedir in and outside the chroot Signed-off-by: Michael Tremer --- diff --git a/make.sh b/make.sh index bbd21b91d4..0d146903ca 100755 --- a/make.sh +++ b/make.sh @@ -730,13 +730,17 @@ run_command() { local pkg local actions=() - local chroot="false" + local basedir="${BASEDIR}" + local command=() local quiet="false" while [ $# -gt 0 ]; do case "${1}" in --chroot) - chroot="true" + command+=( "enterchroot" ) + + # Move the basedir + basedir="/usr/src" ;; --quiet) @@ -762,7 +766,8 @@ run_command() { shift done - local command=( + # Build the command + command+=( # Run a shell "bash" @@ -770,16 +775,9 @@ run_command() { "-x" # Run the following command - "-c" "cd /usr/src/lfs && make -f ${pkg} LFS_BASEDIR=/usr/src ${actions[@]}" + "-c" "cd ${basedir}/lfs && make -f ${pkg} LFS_BASEDIR=${basedir} ${actions[@]}" ) - # Run this in chroot? - case "${chroot}" in - true) - command=( "enterchroot" "${command[@]}" ) - ;; - esac - # Return code local r=0