diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-05-20 02:09:45 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-05-20 02:09:45 +0200 |
commit | 40477e2fdb3d32f4d368ee4f7c72ded4a2398082 (patch) | |
tree | 51f0970b7a48406f0331cbd1832119a9da778ba2 | |
parent | 2e068e725ce693afe5e89e10feaa9f24bef5f789 (diff) | |
download | busybox-w32-40477e2fdb3d32f4d368ee4f7c72ded4a2398082.tar.gz busybox-w32-40477e2fdb3d32f4d368ee4f7c72ded4a2398082.tar.bz2 busybox-w32-40477e2fdb3d32f4d368ee4f7c72ded4a2398082.zip |
shell: make it possible to alias one of shells to "bash"
function old new delta
packed_usage 27047 27054 +7
applet_names 2227 2232 +5
applet_main 1304 1308 +4
applet_nameofs 652 654 +2
applet_install_loc 163 164 +1
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 5/0 up/down: 19/0) Total: 19 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | include/applets.h | 2 | ||||
-rw-r--r-- | include/usage.h | 2 | ||||
-rw-r--r-- | shell/Config.in | 43 |
3 files changed, 37 insertions, 10 deletions
diff --git a/include/applets.h b/include/applets.h index 36b24856a..ff8799c63 100644 --- a/include/applets.h +++ b/include/applets.h | |||
@@ -79,6 +79,8 @@ IF_ARPING(APPLET(arping, _BB_DIR_USR_BIN, _BB_SUID_DROP)) | |||
79 | IF_ASH(APPLET(ash, _BB_DIR_BIN, _BB_SUID_DROP)) | 79 | IF_ASH(APPLET(ash, _BB_DIR_BIN, _BB_SUID_DROP)) |
80 | IF_AWK(APPLET_NOEXEC(awk, awk, _BB_DIR_USR_BIN, _BB_SUID_DROP, awk)) | 80 | IF_AWK(APPLET_NOEXEC(awk, awk, _BB_DIR_USR_BIN, _BB_SUID_DROP, awk)) |
81 | IF_BASENAME(APPLET_NOFORK(basename, basename, _BB_DIR_USR_BIN, _BB_SUID_DROP, basename)) | 81 | IF_BASENAME(APPLET_NOFORK(basename, basename, _BB_DIR_USR_BIN, _BB_SUID_DROP, basename)) |
82 | IF_FEATURE_BASH_IS_ASH(APPLET_ODDNAME(bash, ash, _BB_DIR_BIN, _BB_SUID_DROP, bash)) | ||
83 | IF_FEATURE_BASH_IS_HUSH(APPLET_ODDNAME(bash, hush, _BB_DIR_BIN, _BB_SUID_DROP, bash)) | ||
82 | IF_BBCONFIG(APPLET(bbconfig, _BB_DIR_BIN, _BB_SUID_DROP)) | 84 | IF_BBCONFIG(APPLET(bbconfig, _BB_DIR_BIN, _BB_SUID_DROP)) |
83 | //IF_BBSH(APPLET(bbsh, _BB_DIR_BIN, _BB_SUID_DROP)) | 85 | //IF_BBSH(APPLET(bbsh, _BB_DIR_BIN, _BB_SUID_DROP)) |
84 | IF_BEEP(APPLET(beep, _BB_DIR_USR_BIN, _BB_SUID_DROP)) | 86 | IF_BEEP(APPLET(beep, _BB_DIR_USR_BIN, _BB_SUID_DROP)) |
diff --git a/include/usage.h b/include/usage.h index 3fce939bb..a295ab865 100644 --- a/include/usage.h +++ b/include/usage.h | |||
@@ -123,6 +123,8 @@ | |||
123 | #define lash_full_usage "" | 123 | #define lash_full_usage "" |
124 | #define msh_trivial_usage NOUSAGE_STR | 124 | #define msh_trivial_usage NOUSAGE_STR |
125 | #define msh_full_usage "" | 125 | #define msh_full_usage "" |
126 | #define bash_trivial_usage NOUSAGE_STR | ||
127 | #define bash_full_usage "" | ||
126 | 128 | ||
127 | #define awk_trivial_usage \ | 129 | #define awk_trivial_usage \ |
128 | "[OPTIONS] [AWK_PROGRAM] [FILE]..." | 130 | "[OPTIONS] [AWK_PROGRAM] [FILE]..." |
diff --git a/shell/Config.in b/shell/Config.in index cf599dff4..286a3415e 100644 --- a/shell/Config.in +++ b/shell/Config.in | |||
@@ -6,11 +6,11 @@ | |||
6 | menu "Shells" | 6 | menu "Shells" |
7 | 7 | ||
8 | choice | 8 | choice |
9 | prompt "Choose your default shell" | 9 | prompt "Choose which shell is aliased to 'sh' name" |
10 | default FEATURE_SH_IS_NONE | 10 | default FEATURE_SH_IS_NONE |
11 | help | 11 | help |
12 | Choose a shell. The ash shell is the most bash compatible | 12 | Choose which shell you want to be executed by 'sh' alias. |
13 | and full featured one. | 13 | The ash shell is the most bash compatible and full featured one. |
14 | 14 | ||
15 | config FEATURE_SH_IS_ASH | 15 | config FEATURE_SH_IS_ASH |
16 | select ASH | 16 | select ASH |
@@ -21,15 +21,38 @@ config FEATURE_SH_IS_HUSH | |||
21 | select HUSH | 21 | select HUSH |
22 | bool "hush" | 22 | bool "hush" |
23 | 23 | ||
24 | ####config FEATURE_SH_IS_LASH | 24 | config FEATURE_SH_IS_NONE |
25 | #### select LASH | 25 | bool "none" |
26 | #### bool "lash" | ||
27 | 26 | ||
28 | ####config FEATURE_SH_IS_MSH | 27 | endchoice |
29 | #### select MSH | ||
30 | #### bool "msh" | ||
31 | 28 | ||
32 | config FEATURE_SH_IS_NONE | 29 | choice |
30 | prompt "Choose which shell is aliased to 'bash' name" | ||
31 | default FEATURE_BASH_IS_NONE | ||
32 | help | ||
33 | Choose which shell you want to be executed by 'bash' alias. | ||
34 | The ash shell is the most bash compatible and full featured one. | ||
35 | |||
36 | Note that selecting this option does not switch on any bash | ||
37 | compatibility code. It merely makes it possible to install | ||
38 | /bin/bash (sym)link and run scripts which start with | ||
39 | #!/bin/bash line. | ||
40 | |||
41 | Many systems use it in scripts which use bash-specific features, | ||
42 | even simple ones like $RANDOM. Without this option, busybox | ||
43 | can't be used for running them because it won't recongnize | ||
44 | "bash" as a supported applet name. | ||
45 | |||
46 | config FEATURE_BASH_IS_ASH | ||
47 | select ASH | ||
48 | bool "ash" | ||
49 | depends on !NOMMU | ||
50 | |||
51 | config FEATURE_BASH_IS_HUSH | ||
52 | select HUSH | ||
53 | bool "hush" | ||
54 | |||
55 | config FEATURE_BASH_IS_NONE | ||
33 | bool "none" | 56 | bool "none" |
34 | 57 | ||
35 | endchoice | 58 | endchoice |