aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcore/busybox/build15
1 files changed, 9 insertions, 6 deletions
diff --git a/core/busybox/build b/core/busybox/build
index 766bc487..f8c919ec 100755
--- a/core/busybox/build
+++ b/core/busybox/build
@@ -10,13 +10,16 @@ for patch in *.patch; do
patch -p1 < "$patch"
done
-[ "$CPT_CROSS_TRIPLET" ] &&
-sed -i "/^CONFIG_CROSS_COMPILER_PREFIX/s/=.*/=\"$CPT_CROSS_TRIPLET-\"/" .config .config-suid
+if [ "$CPT_CROSS_TRIPLET" ]; then
+ mk() { make ARCH=${CPT_CROSS_TRIPLET%%-*} CROSS_COMPILE=$CPT_CROSS_TRIPLET- "$@" ;}
+else
+ mk() { make "$@" ;}
+fi
# Build and install regular busybox.
# This excludes utilities which require 'suid' to function.
-make
-make CONFIG_PREFIX="$1/usr" install
+mk
+mk CONFIG_PREFIX="$1/usr" install
# Rename the binary temporarily.
mv "$1/usr/bin/busybox" "$1/usr/bin/busybox-nosuid"
@@ -24,8 +27,8 @@ mv "$1/usr/bin/busybox" "$1/usr/bin/busybox-nosuid"
# Build and install suid busybox.
# This _only_ includes utlities which require 'suid' to function.
cp -f .config-suid .config
-make
-make CONFIG_PREFIX="$1/usr" install
+mk
+mk CONFIG_PREFIX="$1/usr" install
# Aptly name the busybox binaries.
mv "$1/usr/bin/busybox" "$1/usr/bin/busybox-suid"