mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-10 02:55:55 +02:00
make.sh: run_command: Fix basedir in and outside the chroot
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
20
make.sh
20
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user