diff options
Diffstat (limited to 'core/busybox/build')
-rwxr-xr-x | core/busybox/build | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/core/busybox/build b/core/busybox/build index 28320a46..c4144f19 100755 --- a/core/busybox/build +++ b/core/busybox/build @@ -6,18 +6,35 @@ kinstall() { chmod "$1" "$3" } -for patch in *.patch; do +for patch in patches/*.patch; do patch -p1 < "$patch" 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" |