aboutsummaryrefslogtreecommitdiff
path: root/core/busybox/build
diff options
context:
space:
mode:
authorCem Keylan <cem@ckyln.com>2023-06-02 22:19:02 +0200
committerCem Keylan <cem@ckyln.com>2023-06-02 22:20:47 +0200
commitf2ae3114a44e72096fe29ad5bacc5081b16f4025 (patch)
tree994d154f6efba169a32807f28562059c36cca535 /core/busybox/build
parent73a1a27ad1cbe6d42e6950dc2c09744a4ae900d4 (diff)
downloadrepository-f2ae3114a44e72096fe29ad5bacc5081b16f4025.tar.gz
busybox: bump to 1.36.1
Diffstat (limited to 'core/busybox/build')
-rwxr-xr-xcore/busybox/build19
1 files changed, 18 insertions, 1 deletions
diff --git a/core/busybox/build b/core/busybox/build
index 65b1def3..c4144f19 100755
--- a/core/busybox/build
+++ b/core/busybox/build
@@ -12,12 +12,29 @@ done
# Build and install regular busybox.
# This excludes utilities which require 'suid' to function.
-make CC="${CC:-gcc}"
+make CC="${CC:=gcc}"
make CONFIG_PREFIX="$1/usr" install
# Rename the binary temporarily.
mv "$1/usr/bin/busybox" "$1/usr/bin/busybox-nosuid"
+# Build and install recovery busybox.
+# The only difference of this configuration is that it includes a recovery
+# shell.
+clsed '/SH_STANDALONE/cCONFIG_FEATURE_SH_STANDALONE=y' .config
+
+# Create an embedded script for recovery sh
+mkdir embed
+
+# We are not trying to expand here.
+# shellcheck disable=SC2016
+printf '[ "$SHLVL" -gt 20 ] && exit 1; exec -a ash "$0" "$@"\n' > embed/rcsh
+chmod +x embed/rcsh
+
+make CC="$CC"
+make CONFIG_PREFIX="$1/usr" install
+mv "$1/usr/bin/busybox" "$1/usr/bin/rcsh"
+
# Build and install suid busybox.
# This _only_ includes utlities which require 'suid' to function.
cp -f .config-suid .config