aboutsummaryrefslogtreecommitdiff
path: root/core/busybox/build
diff options
context:
space:
mode:
Diffstat (limited to 'core/busybox/build')
-rwxr-xr-xcore/busybox/build21
1 files changed, 19 insertions, 2 deletions
diff --git a/core/busybox/build b/core/busybox/build
index 3e691c0b..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
@@ -42,7 +59,7 @@ done
chmod u+s "$1/usr/bin/busybox-suid"
# Install runit and sysmgr services.
-DESTDIR=$1 install-sv crond.run mdev.run ntpd.run syslogd.run acpid.run
+clsv -d "$1" crond.run mdev.run ntpd.run syslogd.run acpid.run
# Install configurations for ntp, init, and mdev.
kinstall 644 ntp.conf "$1/etc/ntp.conf"