aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-07-16 14:31:34 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-07-16 14:31:34 +0200
commit771f1995a99e63600a513f97ce35cbb9f6865138 (patch)
treebcf36201ace3b73e8158fe3f248539bd155718dc
parent29082231d0cb1a5b327de5d515b16f332d4dbdaf (diff)
downloadbusybox-w32-771f1995a99e63600a513f97ce35cbb9f6865138.tar.gz
busybox-w32-771f1995a99e63600a513f97ce35cbb9f6865138.tar.bz2
busybox-w32-771f1995a99e63600a513f97ce35cbb9f6865138.zip
ash: move config stuff into ash.c, no code chages
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--include/applets.src.h3
-rw-r--r--include/usage.src.h7
-rw-r--r--shell/Config.src114
-rw-r--r--shell/Kbuild.src3
-rw-r--r--shell/ash.c117
-rw-r--r--shell/hush.c2
6 files changed, 126 insertions, 120 deletions
diff --git a/include/applets.src.h b/include/applets.src.h
index 5d84597b0..6ca0c3230 100644
--- a/include/applets.src.h
+++ b/include/applets.src.h
@@ -72,10 +72,8 @@ IF_ADJTIMEX(APPLET(adjtimex, _BB_DIR_SBIN, _BB_SUID_DROP))
72IF_AR(APPLET(ar, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 72IF_AR(APPLET(ar, _BB_DIR_USR_BIN, _BB_SUID_DROP))
73IF_ARP(APPLET(arp, _BB_DIR_SBIN, _BB_SUID_DROP)) 73IF_ARP(APPLET(arp, _BB_DIR_SBIN, _BB_SUID_DROP))
74IF_ARPING(APPLET(arping, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 74IF_ARPING(APPLET(arping, _BB_DIR_USR_BIN, _BB_SUID_DROP))
75IF_ASH(APPLET(ash, _BB_DIR_BIN, _BB_SUID_DROP))
76IF_AWK(APPLET_NOEXEC(awk, awk, _BB_DIR_USR_BIN, _BB_SUID_DROP, awk)) 75IF_AWK(APPLET_NOEXEC(awk, awk, _BB_DIR_USR_BIN, _BB_SUID_DROP, awk))
77IF_BASENAME(APPLET_NOFORK(basename, basename, _BB_DIR_USR_BIN, _BB_SUID_DROP, basename)) 76IF_BASENAME(APPLET_NOFORK(basename, basename, _BB_DIR_USR_BIN, _BB_SUID_DROP, basename))
78IF_FEATURE_BASH_IS_ASH(APPLET_ODDNAME(bash, ash, _BB_DIR_BIN, _BB_SUID_DROP, bash))
79IF_BBCONFIG(APPLET(bbconfig, _BB_DIR_BIN, _BB_SUID_DROP)) 77IF_BBCONFIG(APPLET(bbconfig, _BB_DIR_BIN, _BB_SUID_DROP))
80//IF_BBSH(APPLET(bbsh, _BB_DIR_BIN, _BB_SUID_DROP)) 78//IF_BBSH(APPLET(bbsh, _BB_DIR_BIN, _BB_SUID_DROP))
81IF_BEEP(APPLET(beep, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 79IF_BEEP(APPLET(beep, _BB_DIR_USR_BIN, _BB_SUID_DROP))
@@ -344,7 +342,6 @@ IF_SETLOGCONS(APPLET(setlogcons, _BB_DIR_USR_SBIN, _BB_SUID_DROP))
344IF_SETSEBOOL(APPLET(setsebool, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 342IF_SETSEBOOL(APPLET(setsebool, _BB_DIR_USR_SBIN, _BB_SUID_DROP))
345IF_SETSID(APPLET(setsid, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 343IF_SETSID(APPLET(setsid, _BB_DIR_USR_BIN, _BB_SUID_DROP))
346IF_SETUIDGID(APPLET_ODDNAME(setuidgid, chpst, _BB_DIR_USR_BIN, _BB_SUID_DROP, setuidgid)) 344IF_SETUIDGID(APPLET_ODDNAME(setuidgid, chpst, _BB_DIR_USR_BIN, _BB_SUID_DROP, setuidgid))
347IF_FEATURE_SH_IS_ASH(APPLET_ODDNAME(sh, ash, _BB_DIR_BIN, _BB_SUID_DROP, sh))
348IF_SHA1SUM(APPLET_ODDNAME(sha1sum, md5_sha1_sum, _BB_DIR_USR_BIN, _BB_SUID_DROP, sha1sum)) 345IF_SHA1SUM(APPLET_ODDNAME(sha1sum, md5_sha1_sum, _BB_DIR_USR_BIN, _BB_SUID_DROP, sha1sum))
349IF_SHA256SUM(APPLET_ODDNAME(sha256sum, md5_sha1_sum, _BB_DIR_USR_BIN, _BB_SUID_DROP, sha256sum)) 346IF_SHA256SUM(APPLET_ODDNAME(sha256sum, md5_sha1_sum, _BB_DIR_USR_BIN, _BB_SUID_DROP, sha256sum))
350IF_SHA512SUM(APPLET_ODDNAME(sha512sum, md5_sha1_sum, _BB_DIR_USR_BIN, _BB_SUID_DROP, sha512sum)) 347IF_SHA512SUM(APPLET_ODDNAME(sha512sum, md5_sha1_sum, _BB_DIR_USR_BIN, _BB_SUID_DROP, sha512sum))
diff --git a/include/usage.src.h b/include/usage.src.h
index b3396006f..46d64c135 100644
--- a/include/usage.src.h
+++ b/include/usage.src.h
@@ -115,13 +115,6 @@ INSERT
115 "\n -s SRC_IP Sender IP address" \ 115 "\n -s SRC_IP Sender IP address" \
116 "\n DST_IP Target IP address" \ 116 "\n DST_IP Target IP address" \
117 117
118#define sh_trivial_usage NOUSAGE_STR
119#define sh_full_usage ""
120#define ash_trivial_usage NOUSAGE_STR
121#define ash_full_usage ""
122#define bash_trivial_usage NOUSAGE_STR
123#define bash_full_usage ""
124
125#define awk_trivial_usage \ 118#define awk_trivial_usage \
126 "[OPTIONS] [AWK_PROGRAM] [FILE]..." 119 "[OPTIONS] [AWK_PROGRAM] [FILE]..."
127#define awk_full_usage "\n\n" \ 120#define awk_full_usage "\n\n" \
diff --git a/shell/Config.src b/shell/Config.src
index f415a5fa6..6389d943a 100644
--- a/shell/Config.src
+++ b/shell/Config.src
@@ -7,109 +7,6 @@ menu "Shells"
7 7
8INSERT 8INSERT
9 9
10config ASH
11 bool "ash"
12 default y
13 depends on !NOMMU
14 help
15 Tha 'ash' shell adds about 60k in the default configuration and is
16 the most complete and most pedantically correct shell included with
17 busybox. This shell is actually a derivative of the Debian 'dash'
18 shell (by Herbert Xu), which was created by porting the 'ash' shell
19 (written by Kenneth Almquist) from NetBSD.
20
21config ASH_BASH_COMPAT
22 bool "bash-compatible extensions"
23 default y
24 depends on ASH
25 help
26 Enable bash-compatible extensions.
27
28config ASH_JOB_CONTROL
29 bool "Job control"
30 default y
31 depends on ASH
32 help
33 Enable job control in the ash shell.
34
35config ASH_ALIAS
36 bool "alias support"
37 default y
38 depends on ASH
39 help
40 Enable alias support in the ash shell.
41
42config ASH_GETOPTS
43 bool "Builtin getopt to parse positional parameters"
44 default y
45 depends on ASH
46 help
47 Enable getopts builtin in the ash shell.
48
49config ASH_BUILTIN_ECHO
50 bool "Builtin version of 'echo'"
51 default y
52 depends on ASH
53 help
54 Enable support for echo, builtin to ash.
55
56config ASH_BUILTIN_PRINTF
57 bool "Builtin version of 'printf'"
58 default y
59 depends on ASH
60 help
61 Enable support for printf, builtin to ash.
62
63config ASH_BUILTIN_TEST
64 bool "Builtin version of 'test'"
65 default y
66 depends on ASH
67 help
68 Enable support for test, builtin to ash.
69
70config ASH_CMDCMD
71 bool "'command' command to override shell builtins"
72 default y
73 depends on ASH
74 help
75 Enable support for the ash 'command' builtin, which allows
76 you to run the specified command with the specified arguments,
77 even when there is an ash builtin command with the same name.
78
79config ASH_MAIL
80 bool "Check for new mail on interactive shells"
81 default n
82 depends on ASH
83 help
84 Enable "check for new mail" in the ash shell.
85
86config ASH_OPTIMIZE_FOR_SIZE
87 bool "Optimize for size instead of speed"
88 default y
89 depends on ASH
90 help
91 Compile ash for reduced size at the price of speed.
92
93config ASH_RANDOM_SUPPORT
94 bool "Pseudorandom generator and $RANDOM variable"
95 default y
96 depends on ASH
97 help
98 Enable pseudorandom generator and dynamic variable "$RANDOM".
99 Each read of "$RANDOM" will generate a new pseudorandom value.
100 You can reset the generator by using a specified start value.
101 After "unset RANDOM" the generator will switch off and this
102 variable will no longer have special treatment.
103
104config ASH_EXPAND_PRMT
105 bool "Expand prompt string"
106 default y
107 depends on ASH
108 help
109 "PS#" may contain volatile content, such as backquote commands.
110 This option recreates the prompt string from the environment
111 variable each time it is displayed.
112
113 10
114choice 11choice
115 prompt "Choose which shell is aliased to 'sh' name" 12 prompt "Choose which shell is aliased to 'sh' name"
@@ -284,12 +181,17 @@ config CTTYHACK
284 181
285 ::respawn:/bin/cttyhack /bin/sh 182 ::respawn:/bin/cttyhack /bin/sh
286 183
184 Starting an interactive shell from boot shell script:
185
186 setsid cttyhack sh
187
287 Giving controlling tty to shell running with PID 1: 188 Giving controlling tty to shell running with PID 1:
288 189
289 $ exec cttyhack sh 190 # exec cttyhack sh
290 191
291 Starting an interactive shell from boot shell script: 192 Without cttyhack, you need to know exact tty name,
193 and do something like this:
292 194
293 setsid cttyhack sh 195 # exec setsid sh -c 'exec sh </dev/tty1 >/dev/tty1 2>&1'
294 196
295endmenu 197endmenu
diff --git a/shell/Kbuild.src b/shell/Kbuild.src
index c7eb5b61a..bce99240f 100644
--- a/shell/Kbuild.src
+++ b/shell/Kbuild.src
@@ -8,8 +8,5 @@ lib-y:=
8 8
9INSERT 9INSERT
10 10
11lib-$(CONFIG_ASH) += ash.o ash_ptr_hack.o shell_common.o
12lib-$(CONFIG_CTTYHACK) += cttyhack.o 11lib-$(CONFIG_CTTYHACK) += cttyhack.o
13
14lib-$(CONFIG_SH_MATH_SUPPORT) += math.o 12lib-$(CONFIG_SH_MATH_SUPPORT) += math.o
15lib-$(CONFIG_ASH_RANDOM_SUPPORT) += random.o
diff --git a/shell/ash.c b/shell/ash.c
index 0337a5535..9b33e78ec 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -70,6 +70,123 @@
70# error "Do not even bother, ash will not run on NOMMU machine" 70# error "Do not even bother, ash will not run on NOMMU machine"
71#endif 71#endif
72 72
73//applet:IF_ASH(APPLET(ash, _BB_DIR_BIN, _BB_SUID_DROP))
74//applet:IF_FEATURE_SH_IS_ASH(APPLET_ODDNAME(sh, ash, _BB_DIR_BIN, _BB_SUID_DROP, sh))
75//applet:IF_FEATURE_BASH_IS_ASH(APPLET_ODDNAME(bash, ash, _BB_DIR_BIN, _BB_SUID_DROP, bash))
76
77//kbuild:lib-$(CONFIG_ASH) += ash.o ash_ptr_hack.o shell_common.o
78//kbuild:lib-$(CONFIG_ASH_RANDOM_SUPPORT) += random.o
79
80//config:config ASH
81//config: bool "ash"
82//config: default y
83//config: depends on !NOMMU
84//config: help
85//config: Tha 'ash' shell adds about 60k in the default configuration and is
86//config: the most complete and most pedantically correct shell included with
87//config: busybox. This shell is actually a derivative of the Debian 'dash'
88//config: shell (by Herbert Xu), which was created by porting the 'ash' shell
89//config: (written by Kenneth Almquist) from NetBSD.
90//config:
91//config:config ASH_BASH_COMPAT
92//config: bool "bash-compatible extensions"
93//config: default y
94//config: depends on ASH
95//config: help
96//config: Enable bash-compatible extensions.
97//config:
98//config:config ASH_JOB_CONTROL
99//config: bool "Job control"
100//config: default y
101//config: depends on ASH
102//config: help
103//config: Enable job control in the ash shell.
104//config:
105//config:config ASH_ALIAS
106//config: bool "alias support"
107//config: default y
108//config: depends on ASH
109//config: help
110//config: Enable alias support in the ash shell.
111//config:
112//config:config ASH_GETOPTS
113//config: bool "Builtin getopt to parse positional parameters"
114//config: default y
115//config: depends on ASH
116//config: help
117//config: Enable getopts builtin in the ash shell.
118//config:
119//config:config ASH_BUILTIN_ECHO
120//config: bool "Builtin version of 'echo'"
121//config: default y
122//config: depends on ASH
123//config: help
124//config: Enable support for echo, builtin to ash.
125//config:
126//config:config ASH_BUILTIN_PRINTF
127//config: bool "Builtin version of 'printf'"
128//config: default y
129//config: depends on ASH
130//config: help
131//config: Enable support for printf, builtin to ash.
132//config:
133//config:config ASH_BUILTIN_TEST
134//config: bool "Builtin version of 'test'"
135//config: default y
136//config: depends on ASH
137//config: help
138//config: Enable support for test, builtin to ash.
139//config:
140//config:config ASH_CMDCMD
141//config: bool "'command' command to override shell builtins"
142//config: default y
143//config: depends on ASH
144//config: help
145//config: Enable support for the ash 'command' builtin, which allows
146//config: you to run the specified command with the specified arguments,
147//config: even when there is an ash builtin command with the same name.
148//config:
149//config:config ASH_MAIL
150//config: bool "Check for new mail on interactive shells"
151//config: default n
152//config: depends on ASH
153//config: help
154//config: Enable "check for new mail" in the ash shell.
155//config:
156//config:config ASH_OPTIMIZE_FOR_SIZE
157//config: bool "Optimize for size instead of speed"
158//config: default y
159//config: depends on ASH
160//config: help
161//config: Compile ash for reduced size at the price of speed.
162//config:
163//config:config ASH_RANDOM_SUPPORT
164//config: bool "Pseudorandom generator and $RANDOM variable"
165//config: default y
166//config: depends on ASH
167//config: help
168//config: Enable pseudorandom generator and dynamic variable "$RANDOM".
169//config: Each read of "$RANDOM" will generate a new pseudorandom value.
170//config: You can reset the generator by using a specified start value.
171//config: After "unset RANDOM" the generator will switch off and this
172//config: variable will no longer have special treatment.
173//config:
174//config:config ASH_EXPAND_PRMT
175//config: bool "Expand prompt string"
176//config: default y
177//config: depends on ASH
178//config: help
179//config: "PS#" may contain volatile content, such as backquote commands.
180//config: This option recreates the prompt string from the environment
181//config: variable each time it is displayed.
182
183//usage:#define ash_trivial_usage NOUSAGE_STR
184//usage:#define ash_full_usage ""
185//usage:#define sh_trivial_usage NOUSAGE_STR
186//usage:#define sh_full_usage ""
187//usage:#define bash_trivial_usage NOUSAGE_STR
188//usage:#define bash_full_usage ""
189
73 190
74/* ============ Hash table sizes. Configurable. */ 191/* ============ Hash table sizes. Configurable. */
75 192
diff --git a/shell/hush.c b/shell/hush.c
index c5a8ea617..56a3f4b14 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -114,7 +114,7 @@
114//config: bool "hush" 114//config: bool "hush"
115//config: default y 115//config: default y
116//config: help 116//config: help
117//config: hush is a small shell (22k). It handles the normal flow control 117//config: hush is a small shell (25k). It handles the normal flow control
118//config: constructs such as if/then/elif/else/fi, for/in/do/done, while loops, 118//config: constructs such as if/then/elif/else/fi, for/in/do/done, while loops,
119//config: case/esac. Redirections, here documents, $((arithmetic)) 119//config: case/esac. Redirections, here documents, $((arithmetic))
120//config: and functions are supported. 120//config: and functions are supported.