aboutsummaryrefslogtreecommitdiff
path: root/Makefile
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 /Makefile
parent552796791f8c5aa12dfb790e3a94c2d905f367ee (diff)
downloadbusybox-w32-4f2ef4a836be37b25808c94f41c7c85895db6f93.tar.gz
busybox-w32-4f2ef4a836be37b25808c94f41c7c85895db6f93.tar.bz2
busybox-w32-4f2ef4a836be37b25808c94f41c7c85895db6f93.zip
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 'Makefile')
-rw-r--r--Makefile6
1 files changed, 5 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 59ec83a6a..8a0dbdf49 100644
--- a/Makefile
+++ b/Makefile
@@ -850,11 +850,14 @@ quiet_cmd_gen_common_bufsiz = GEN include/common_bufsiz.h
850 cmd_gen_common_bufsiz = $(srctree)/scripts/generate_BUFSIZ.sh include/common_bufsiz.h 850 cmd_gen_common_bufsiz = $(srctree)/scripts/generate_BUFSIZ.sh include/common_bufsiz.h
851quiet_cmd_split_autoconf = SPLIT include/autoconf.h -> include/config/* 851quiet_cmd_split_autoconf = SPLIT include/autoconf.h -> include/config/*
852 cmd_split_autoconf = scripts/basic/split-include include/autoconf.h include/config 852 cmd_split_autoconf = scripts/basic/split-include include/autoconf.h include/config
853quiet_cmd_gen_embedded_scripts = GEN include/embedded_scripts.h
854 cmd_gen_embedded_scripts = scripts/embedded_scripts include/embedded_scripts.h embed
853#bbox# piggybacked generation of few .h files 855#bbox# piggybacked generation of few .h files
854include/config/MARKER: scripts/basic/split-include include/autoconf.h 856include/config/MARKER: scripts/basic/split-include include/autoconf.h $(wildcard embed/*) scripts/embedded_scripts
855 $(call cmd,split_autoconf) 857 $(call cmd,split_autoconf)
856 $(call cmd,gen_bbconfigopts) 858 $(call cmd,gen_bbconfigopts)
857 $(call cmd,gen_common_bufsiz) 859 $(call cmd,gen_common_bufsiz)
860 $(call cmd,gen_embedded_scripts)
858 @touch $@ 861 @touch $@
859 862
860# Generate some files 863# Generate some files
@@ -974,6 +977,7 @@ MRPROPER_FILES += .config .config.old include/asm .version .old_version \
974 include/autoconf.h \ 977 include/autoconf.h \
975 include/bbconfigopts.h \ 978 include/bbconfigopts.h \
976 include/bbconfigopts_bz2.h \ 979 include/bbconfigopts_bz2.h \
980 include/embedded_scripts.h \
977 include/usage_compressed.h \ 981 include/usage_compressed.h \
978 include/applet_tables.h \ 982 include/applet_tables.h \
979 include/applets.h \ 983 include/applets.h \