ash: move config stuff into ash.c, no code chages
[platform/upstream/busybox.git] / shell / Config.src
1 #
2 # For a description of the syntax of this configuration file,
3 # see scripts/kbuild/config-language.txt.
4 #
5
6 menu "Shells"
7
8 INSERT
9
10
11 choice
12         prompt "Choose which shell is aliased to 'sh' name"
13         default FEATURE_SH_IS_ASH
14         help
15           Choose which shell you want to be executed by 'sh' alias.
16           The ash shell is the most bash compatible and full featured one.
17
18 # note: cannot use "select ASH" here, it breaks "make allnoconfig"
19 config FEATURE_SH_IS_ASH
20         depends on ASH
21         bool "ash"
22         depends on !NOMMU
23
24 config FEATURE_SH_IS_HUSH
25         depends on HUSH
26         bool "hush"
27
28 config FEATURE_SH_IS_NONE
29         bool "none"
30
31 endchoice
32
33 choice
34         prompt "Choose which shell is aliased to 'bash' name"
35         default FEATURE_BASH_IS_NONE
36         help
37           Choose which shell you want to be executed by 'bash' alias.
38           The ash shell is the most bash compatible and full featured one.
39
40           Note that selecting this option does not switch on any bash
41           compatibility code. It merely makes it possible to install
42           /bin/bash (sym)link and run scripts which start with
43           #!/bin/bash line.
44
45           Many systems use it in scripts which use bash-specific features,
46           even simple ones like $RANDOM. Without this option, busybox
47           can't be used for running them because it won't recongnize
48           "bash" as a supported applet name.
49
50 config FEATURE_BASH_IS_ASH
51         depends on ASH
52         bool "ash"
53         depends on !NOMMU
54
55 config FEATURE_BASH_IS_HUSH
56         depends on HUSH
57         bool "hush"
58
59 config FEATURE_BASH_IS_NONE
60         bool "none"
61
62 endchoice
63
64
65 config LASH
66         bool "lash (deprecated: aliased to hush)"
67         default n
68         select HUSH
69         help
70           lash is deprecated and will be removed, please migrate to hush.
71
72 config MSH
73         bool "msh (deprecated: please use hush)"
74         default n
75         select HUSH
76         help
77           msh is deprecated and will be removed, please migrate to hush.
78           If there is a feature msh has but hush does not, please let us know.
79
80 #         The minix shell (adds just 30k) is quite complete and handles things
81 #         like for/do/done, case/esac and all the things you expect a Bourne
82 #         shell to do. It is not always pedantically correct about Bourne
83 #         shell grammar (try running the shell testscript "tests/sh.testcases"
84 #         on it and compare vs bash) but for most things it works quite well.
85 #         It uses only vfork, so it can be used on uClinux systems.
86
87
88 config SH_MATH_SUPPORT
89         bool "POSIX math support"
90         default y
91         depends on ASH || HUSH
92         help
93           Enable math support in the shell via $((...)) syntax.
94
95 config SH_MATH_SUPPORT_64
96         bool "Extend POSIX math support to 64 bit"
97         default y
98         depends on SH_MATH_SUPPORT
99         help
100           Enable 64-bit math support in the shell. This will make the shell
101           slightly larger, but will allow computation with very large numbers.
102           This is not in POSIX, so do not rely on this in portable code.
103
104 config FEATURE_SH_EXTRA_QUIET
105         bool "Hide message on interactive shell startup"
106         default y
107         depends on HUSH || ASH
108         help
109           Remove the busybox introduction when starting a shell.
110
111 config FEATURE_SH_STANDALONE
112         bool "Standalone shell"
113         default n
114         depends on (HUSH || ASH) && FEATURE_PREFER_APPLETS
115         help
116           This option causes busybox shells to use busybox applets
117           in preference to executables in the PATH whenever possible. For
118           example, entering the command 'ifconfig' into the shell would cause
119           busybox to use the ifconfig busybox applet. Specifying the fully
120           qualified executable name, such as '/sbin/ifconfig' will still
121           execute the /sbin/ifconfig executable on the filesystem. This option
122           is generally used when creating a statically linked version of busybox
123           for use as a rescue shell, in the event that you screw up your system.
124
125           This is implemented by re-execing /proc/self/exe (typically)
126           with right parameters. Some selected applets ("NOFORK" applets)
127           can even be executed without creating new process.
128           Instead, busybox will call <applet>_main() internally.
129
130           However, this causes problems in chroot jails without mounted /proc
131           and with ps/top (command name can be shown as 'exe' for applets
132           started this way).
133 # untrue?
134 #         Note that this will *also* cause applets to take precedence
135 #         over shell builtins of the same name. So turning this on will
136 #         eliminate any performance gained by turning on the builtin "echo"
137 #         and "test" commands in ash.
138 # untrue?
139 #         Note that when using this option, the shell will attempt to directly
140 #         run '/bin/busybox'. If you do not have the busybox binary sitting in
141 #         that exact location with that exact name, this option will not work at
142 #         all.
143
144 config FEATURE_SH_NOFORK
145         bool "Run 'nofork' applets directly"
146         default n
147         depends on (HUSH || ASH) && FEATURE_PREFER_APPLETS
148         help
149           This option causes busybox shells [currently only ash]
150           to not execute typical fork/exec/wait sequence, but call <applet>_main
151           directly, if possible. (Sometimes it is not possible: for example,
152           this is not possible in pipes).
153
154           This will be done only for some applets (those which are marked
155           NOFORK in include/applets.h).
156
157           This may significantly speed up some shell scripts.
158
159           This feature is relatively new. Use with care.
160
161 config CTTYHACK
162         bool "cttyhack"
163         default y
164         help
165           One common problem reported on the mailing list is "can't access tty;
166           job control turned off" error message which typically appears when
167           one tries to use shell with stdin/stdout opened to /dev/console.
168           This device is special - it cannot be a controlling tty.
169
170           Proper solution is to use correct device instead of /dev/console.
171
172           cttyhack provides "quick and dirty" solution to this problem.
173           It analyzes stdin with various ioctls, trying to determine whether
174           it is a /dev/ttyN or /dev/ttySN (virtual terminal or serial line).
175           If it detects one, it closes stdin/out/err and reopens that device.
176           Then it executes given program. Opening the device will make
177           that device a controlling tty. This may require cttyhack
178           to be a session leader.
179
180           Example for /etc/inittab (for busybox init):
181
182           ::respawn:/bin/cttyhack /bin/sh
183
184           Starting an interactive shell from boot shell script:
185
186           setsid cttyhack sh
187
188           Giving controlling tty to shell running with PID 1:
189
190           # exec cttyhack sh
191
192           Without cttyhack, you need to know exact tty name,
193           and do something like this:
194
195           # exec setsid sh -c 'exec sh </dev/tty1 >/dev/tty1 2>&1'
196
197 endmenu