diff options
author | Ron Yorston <rmy@pobox.com> | 2018-11-27 14:34:25 +0000 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-11-27 16:13:07 +0100 |
commit | 71df2d3589e3e682cd6770f41f0b184841b78702 (patch) | |
tree | 0c71963e9d622bc48256a3917c1ce55ccc019a4f /docs | |
parent | f4709d78cb0c4f54283046e8f86edb9ecd7e41ca (diff) | |
download | busybox-w32-71df2d3589e3e682cd6770f41f0b184841b78702.tar.gz busybox-w32-71df2d3589e3e682cd6770f41f0b184841b78702.tar.bz2 busybox-w32-71df2d3589e3e682cd6770f41f0b184841b78702.zip |
hush: allow hush to run embedded scripts
Embedded scripts require a shell to be present in the BusyBox
binary. Allow either ash or hush to be used for this purpose.
If both are enabled ash takes precedence.
The size of the binary is unchanged in the default configuration:
both ash and hush are present but support for embedded scripts
isn't compiled into hush.
Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/embedded-scripts.txt | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/docs/embedded-scripts.txt b/docs/embedded-scripts.txt index 1b0c5b591..7a273d698 100644 --- a/docs/embedded-scripts.txt +++ b/docs/embedded-scripts.txt | |||
@@ -3,13 +3,9 @@ Embedded Shell Scripts in BusyBox | |||
3 | 3 | ||
4 | BusyBox allows applets to be implemented as shell scripts. Since | 4 | BusyBox allows applets to be implemented as shell scripts. Since |
5 | this obviously requires a shell to interpret the scripts the feature | 5 | this obviously requires a shell to interpret the scripts the feature |
6 | depends on having a shell (specifically, ash) built into the binary. | 6 | depends on having a shell built into the binary. Either ash or hush |
7 | Support for embedded scripts also has to be enabled. | 7 | will do. If both are present ash will be used. Support for embedded |
8 | 8 | scripts also has to be enabled. | |
9 | To embed scripts in BusyBox you must enable these configuration options: | ||
10 | |||
11 | ASH | ||
12 | ASH_EMBEDDED_SCRIPTS | ||
13 | 9 | ||
14 | It's unlikely that your applet will be implemented as a pure shell | 10 | It's unlikely that your applet will be implemented as a pure shell |
15 | script: it will probably need some external commands. If these are | 11 | script: it will probably need some external commands. If these are |
@@ -75,10 +71,9 @@ code for the native applet: | |||
75 | 71 | ||
76 | The only difference is that the applet is specified as being of type | 72 | The only difference is that the applet is specified as being of type |
77 | APPLET_SCRIPTED. It would also be useful to include details of any | 73 | APPLET_SCRIPTED. It would also be useful to include details of any |
78 | dependencies the script has. We can assume that ash is available. | 74 | dependencies the script has. No external commands are used by our mu |
79 | No external commands are used by our mu script, but it does depend on | 75 | script, but it does depend on optional shell features. We can ensure |
80 | optional shell features. We can ensure these are selected by adding | 76 | these are selected by adding this to the configuration: |
81 | this to the configuration: | ||
82 | 77 | ||
83 | //config:config MU_DEPENDENCIES | 78 | //config:config MU_DEPENDENCIES |
84 | //config: bool "Enable dependencies for mu" | 79 | //config: bool "Enable dependencies for mu" |
@@ -87,8 +82,8 @@ this to the configuration: | |||
87 | //config: select ASH_RANDOM_SUPPORT | 82 | //config: select ASH_RANDOM_SUPPORT |
88 | //config: select FEATURE_SH_MATH | 83 | //config: select FEATURE_SH_MATH |
89 | //config: help | 84 | //config: help |
90 | //config: mu is implemented as a shell script. It requires ash | 85 | //config: mu is implemented as a shell script. It requires support |
91 | //config: support for $RANDOM and arithmetic. | 86 | //config: for $RANDOM and arithmetic. |
92 | 87 | ||
93 | The configuration data should be placed in a C file in an appropriate | 88 | The configuration data should be placed in a C file in an appropriate |
94 | subdirectory. There isn't any C code, though! In this case the file | 89 | subdirectory. There isn't any C code, though! In this case the file |