]> git.ipfire.org Git - people/ms/ipfire-2.x.git/commitdiff
make.sh: Don't drop into the lfs/ directory when entering a shell
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 9 Jul 2024 16:04:47 +0000 (16:04 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 9 Jul 2024 16:04:47 +0000 (16:04 +0000)
This is not a very useful place to be.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
make.sh

diff --git a/make.sh b/make.sh
index ae7404a001404aedfef07acdfeee1321cf937303..efbe3d861148df7308596cc89efd0fc6888c8539 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -753,8 +753,8 @@ execute() {
                # Clear the previous environment
                "--ignore-environment"
 
-               # Change the working directory
-               --chdir="${environ[LFS_BASEDIR]}/lfs"
+               # Change to the home directory
+               --chdir="${environ[HOME]}"
        )
 
        # Export the environment
@@ -823,12 +823,20 @@ make_pkg() {
        local args=()
        local pkg
 
+       local basedir="${BASEDIR}"
+
        while [ $# -gt 0 ]; do
                local arg="${1}"
                shift
 
                case "${arg}" in
                        --*)
+                               case "${arg}" in
+                                       --chroot)
+                                               basedir="/usr/src"
+                                               ;;
+                               esac
+
                                args+=( "${arg}" )
                                ;;
 
@@ -840,7 +848,7 @@ make_pkg() {
        done
 
        # Execute the make command in the environment
-       execute "${args[@]}" make --file="${pkg}" "$@"
+       execute "${args[@]}" make --directory="${basedir}/lfs" --file="${pkg}" "$@"
 }
 
 lfsmake1() {