aboutsummaryrefslogtreecommitdiff
path: root/libbb/lineedit.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-11-01 09:53:25 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2018-11-01 10:15:13 +0100
commit4f2ef4a836be37b25808c94f41c7c85895db6f93 (patch)
treee224e4f3b8513b35655da80b26369d42bd62d24d /libbb/lineedit.c
parent552796791f8c5aa12dfb790e3a94c2d905f367ee (diff)
downloadbusybox-4f2ef4a836be37b25808c94f41c7c85895db6f93.tar.gz
ash: allow shell scripts to be embedded in the binary
To assist in the deployment of shell scripts it may be convenient to embed them in the BusyBox binary. 'Embed scripts in the binary' takes any files in the directory 'embed', concatenates them with null separators, compresses them and embeds them in the binary. When scripts are embedded in the binary, scripts can be run as 'busybox SCRIPT [ARGS]' or by usual (sym)link mechanism. embed/nologin is provided as an example. function old new delta packed_scripts - 123 +123 unpack_scripts - 87 +87 ash_main 1103 1171 +68 run_applet_and_exit 78 128 +50 get_script_content - 32 +32 script_names - 10 +10 expmeta 663 659 -4 ------------------------------------------------------------------------------ (add/remove: 4/0 grow/shrink: 2/1 up/down: 370/-4) Total: 366 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb/lineedit.c')
-rw-r--r--libbb/lineedit.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index b1e971f88..aef1911d9 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -41,6 +41,12 @@
#include "busybox.h"
#include "NUM_APPLETS.h"
#include "unicode.h"
+#if ENABLE_ASH_EMBEDDED_SCRIPTS
+# include "embedded_scripts.h"
+#else
+# define NUM_SCRIPTS 0
+#endif
+
#ifndef _POSIX_VDISABLE
# define _POSIX_VDISABLE '\0'
#endif