From 834b879ee4793eb4fd84ecb33b3ab7138bffd226 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 5 Jul 2024 10:43:26 +0000 Subject: [PATCH] make.sh: run_command: Fix basedir in and outside the chroot Signed-off-by: Michael Tremer --- make.sh | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/make.sh b/make.sh index bbd21b91d..0d146903c 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 -- 2.39.5