nologin: make it possible to build it as single applet

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2020-06-24 13:39:13 +02:00
parent d5314e7129
commit 67e1529b92
5 changed files with 110 additions and 64 deletions

View File

@ -754,7 +754,9 @@ static void install_links(const char *busybox UNUSED_PARAM,
} }
# endif # endif
# if ENABLE_BUSYBOX || NUM_APPLETS > 0
static void run_applet_and_exit(const char *name, char **argv) NORETURN; static void run_applet_and_exit(const char *name, char **argv) NORETURN;
#endif
# if NUM_SCRIPTS > 0 # if NUM_SCRIPTS > 0
static int find_script_by_name(const char *name) static int find_script_by_name(const char *name)
@ -775,13 +777,13 @@ int scripted_main(int argc UNUSED_PARAM, char **argv)
{ {
int script = find_script_by_name(applet_name); int script = find_script_by_name(applet_name);
if (script >= 0) if (script >= 0)
#if ENABLE_ASH || ENABLE_SH_IS_ASH || ENABLE_BASH_IS_ASH # if ENABLE_SHELL_ASH
exit(ash_main(-script - 1, argv)); exit(ash_main(-script - 1, argv));
#elif ENABLE_HUSH || ENABLE_SH_IS_HUSH || ENABLE_BASH_IS_HUSH # elif ENABLE_SHELL_HUSH
exit(hush_main(-script - 1, argv)); exit(hush_main(-script - 1, argv));
#else # else
return 1; return 1;
#endif # endif
return 0; return 0;
} }
@ -1024,7 +1026,33 @@ static NORETURN void run_applet_and_exit(const char *name, char **argv)
} }
# endif # endif
#endif /* !defined(SINGLE_APPLET_MAIN) */ #else /* defined(SINGLE_APPLET_MAIN) */
# if NUM_SCRIPTS > 0
/* if SINGLE_APPLET_MAIN, these two functions are simpler: */
int scripted_main(int argc UNUSED_PARAM, char **argv) MAIN_EXTERNALLY_VISIBLE;
int scripted_main(int argc UNUSED_PARAM, char **argv)
{
# if ENABLE_SHELL_ASH
int script = 0;
exit(ash_main(-script - 1, argv));
# elif ENABLE_SHELL_HUSH
int script = 0;
exit(hush_main(-script - 1, argv));
# else
return 1;
# endif
}
char* FAST_FUNC
get_script_content(unsigned n UNUSED_PARAM)
{
char *t = unpack_bz2_data(packed_scripts, sizeof(packed_scripts),
UNPACKED_SCRIPTS_LENGTH);
return t;
}
# endif /* NUM_SCRIPTS > 0 */
#endif /* defined(SINGLE_APPLET_MAIN) */
#if ENABLE_BUILD_LIBBUSYBOX #if ENABLE_BUILD_LIBBUSYBOX

View File

@ -17,6 +17,7 @@ choice
config SH_IS_ASH config SH_IS_ASH
depends on !NOMMU depends on !NOMMU
bool "ash" bool "ash"
select SHELL_ASH
help help
Choose ash to be the shell executed by 'sh' name. Choose ash to be the shell executed by 'sh' name.
The ash code will be built into busybox. If you don't select The ash code will be built into busybox. If you don't select
@ -25,6 +26,7 @@ config SH_IS_ASH
config SH_IS_HUSH config SH_IS_HUSH
bool "hush" bool "hush"
select SHELL_HUSH
help help
Choose hush to be the shell executed by 'sh' name. Choose hush to be the shell executed by 'sh' name.
The hush code will be built into busybox. If you don't select The hush code will be built into busybox. If you don't select
@ -57,6 +59,7 @@ choice
config BASH_IS_ASH config BASH_IS_ASH
depends on !NOMMU depends on !NOMMU
bool "ash" bool "ash"
select SHELL_ASH
help help
Choose ash to be the shell executed by 'bash' name. Choose ash to be the shell executed by 'bash' name.
The ash code will be built into busybox. If you don't select The ash code will be built into busybox. If you don't select
@ -65,6 +68,7 @@ config BASH_IS_ASH
config BASH_IS_HUSH config BASH_IS_HUSH
bool "hush" bool "hush"
select SHELL_HUSH
help help
Choose hush to be the shell executed by 'bash' name. Choose hush to be the shell executed by 'bash' name.
The hush code will be built into busybox. If you don't select The hush code will be built into busybox. If you don't select
@ -81,12 +85,12 @@ INSERT
comment "Options common to all shells" comment "Options common to all shells"
if ASH || HUSH || SH_IS_ASH || BASH_IS_ASH || SH_IS_HUSH || BASH_IS_HUSH if SHELL_ASH || SHELL_HUSH
config FEATURE_SH_MATH config FEATURE_SH_MATH
bool "POSIX math support" bool "POSIX math support"
default y default y
depends on ASH || HUSH || SH_IS_ASH || BASH_IS_ASH || SH_IS_HUSH || BASH_IS_HUSH depends on SHELL_ASH || SHELL_HUSH
help help
Enable math support in the shell via $((...)) syntax. Enable math support in the shell via $((...)) syntax.
@ -107,14 +111,14 @@ config FEATURE_SH_MATH_BASE
config FEATURE_SH_EXTRA_QUIET config FEATURE_SH_EXTRA_QUIET
bool "Hide message on interactive shell startup" bool "Hide message on interactive shell startup"
default y default y
depends on ASH || HUSH || SH_IS_ASH || BASH_IS_ASH || SH_IS_HUSH || BASH_IS_HUSH depends on SHELL_ASH || SHELL_HUSH
help help
Remove the busybox introduction when starting a shell. Remove the busybox introduction when starting a shell.
config FEATURE_SH_STANDALONE config FEATURE_SH_STANDALONE
bool "Standalone shell" bool "Standalone shell"
default n default n
depends on ASH || HUSH || SH_IS_ASH || BASH_IS_ASH || SH_IS_HUSH || BASH_IS_HUSH depends on SHELL_ASH || SHELL_HUSH
help help
This option causes busybox shells to use busybox applets This option causes busybox shells to use busybox applets
in preference to executables in the PATH whenever possible. For in preference to executables in the PATH whenever possible. For
@ -135,7 +139,7 @@ config FEATURE_SH_STANDALONE
config FEATURE_SH_NOFORK config FEATURE_SH_NOFORK
bool "Run 'nofork' applets directly" bool "Run 'nofork' applets directly"
default n default n
depends on ASH || HUSH || SH_IS_ASH || BASH_IS_ASH || SH_IS_HUSH || BASH_IS_HUSH depends on SHELL_ASH || SHELL_HUSH
help help
This option causes busybox shells to not execute typical This option causes busybox shells to not execute typical
fork/exec/wait sequence, but call <applet>_main directly, fork/exec/wait sequence, but call <applet>_main directly,
@ -153,14 +157,14 @@ config FEATURE_SH_NOFORK
config FEATURE_SH_READ_FRAC config FEATURE_SH_READ_FRAC
bool "read -t N.NNN support (+110 bytes)" bool "read -t N.NNN support (+110 bytes)"
default y default y
depends on ASH || HUSH || SH_IS_ASH || BASH_IS_ASH || SH_IS_HUSH || BASH_IS_HUSH depends on SHELL_ASH || SHELL_HUSH
help help
Enable support for fractional second timeout in read builtin. Enable support for fractional second timeout in read builtin.
config FEATURE_SH_HISTFILESIZE config FEATURE_SH_HISTFILESIZE
bool "Use $HISTFILESIZE" bool "Use $HISTFILESIZE"
default y default y
depends on ASH || HUSH || SH_IS_ASH || BASH_IS_ASH || SH_IS_HUSH || BASH_IS_HUSH depends on SHELL_ASH || SHELL_HUSH
help help
This option makes busybox shells to use $HISTFILESIZE variable This option makes busybox shells to use $HISTFILESIZE variable
to set shell history size. Note that its max value is capped to set shell history size. Note that its max value is capped
@ -169,7 +173,7 @@ config FEATURE_SH_HISTFILESIZE
config FEATURE_SH_EMBEDDED_SCRIPTS config FEATURE_SH_EMBEDDED_SCRIPTS
bool "Embed scripts in the binary" bool "Embed scripts in the binary"
default y default y
depends on ASH || HUSH || SH_IS_ASH || BASH_IS_ASH || SH_IS_HUSH || BASH_IS_HUSH depends on SHELL_ASH || SHELL_HUSH
help help
Allow scripts to be compressed and embedded in the busybox Allow scripts to be compressed and embedded in the busybox
binary. The scripts should be placed in the 'embed' directory binary. The scripts should be placed in the 'embed' directory

View File

@ -15,10 +15,15 @@
* *
* Licensed under GPLv2 or later, see file LICENSE in this source tree. * Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/ */
//config:config SHELL_ASH
//config: bool #hidden option
//config: depends on !NOMMU
//config:
//config:config ASH //config:config ASH
//config: bool "ash (78 kb)" //config: bool "ash (78 kb)"
//config: default y //config: default y
//config: depends on !NOMMU //config: depends on !NOMMU
//config: select SHELL_ASH
//config: help //config: help
//config: The most complete and most pedantically correct shell included with //config: The most complete and most pedantically correct shell included with
//config: busybox. This shell is actually a derivative of the Debian 'dash' //config: busybox. This shell is actually a derivative of the Debian 'dash'
@ -28,17 +33,17 @@
//config:# ash options //config:# ash options
//config:# note: Don't remove !NOMMU part in the next line; it would break //config:# note: Don't remove !NOMMU part in the next line; it would break
//config:# menuconfig's indenting. //config:# menuconfig's indenting.
//config:if !NOMMU && (ASH || SH_IS_ASH || BASH_IS_ASH) //config:if !NOMMU && (SHELL_ASH || ASH || SH_IS_ASH || BASH_IS_ASH)
//config: //config:
//config:config ASH_OPTIMIZE_FOR_SIZE //config:config ASH_OPTIMIZE_FOR_SIZE
//config: bool "Optimize for size instead of speed" //config: bool "Optimize for size instead of speed"
//config: default y //config: default y
//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH //config: depends on SHELL_ASH
//config: //config:
//config:config ASH_INTERNAL_GLOB //config:config ASH_INTERNAL_GLOB
//config: bool "Use internal glob() implementation" //config: bool "Use internal glob() implementation"
//config: default y # Y is bigger, but because of uclibc glob() bug, let Y be default for now //config: default y # Y is bigger, but because of uclibc glob() bug, let Y be default for now
//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH //config: depends on SHELL_ASH
//config: help //config: help
//config: Do not use glob() function from libc, use internal implementation. //config: Do not use glob() function from libc, use internal implementation.
//config: Use this if you are getting "glob.h: No such file or directory" //config: Use this if you are getting "glob.h: No such file or directory"
@ -49,7 +54,7 @@
//config:config ASH_BASH_COMPAT //config:config ASH_BASH_COMPAT
//config: bool "bash-compatible extensions" //config: bool "bash-compatible extensions"
//config: default y //config: default y
//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH //config: depends on SHELL_ASH
//config: //config:
//config:config ASH_BASH_SOURCE_CURDIR //config:config ASH_BASH_SOURCE_CURDIR
//config: bool "'source' and '.' builtins search current directory after $PATH" //config: bool "'source' and '.' builtins search current directory after $PATH"
@ -70,17 +75,17 @@
//config:config ASH_JOB_CONTROL //config:config ASH_JOB_CONTROL
//config: bool "Job control" //config: bool "Job control"
//config: default y //config: default y
//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH //config: depends on SHELL_ASH
//config: //config:
//config:config ASH_ALIAS //config:config ASH_ALIAS
//config: bool "Alias support" //config: bool "Alias support"
//config: default y //config: default y
//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH //config: depends on SHELL_ASH
//config: //config:
//config:config ASH_RANDOM_SUPPORT //config:config ASH_RANDOM_SUPPORT
//config: bool "Pseudorandom generator and $RANDOM variable" //config: bool "Pseudorandom generator and $RANDOM variable"
//config: default y //config: default y
//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH //config: depends on SHELL_ASH
//config: help //config: help
//config: Enable pseudorandom generator and dynamic variable "$RANDOM". //config: Enable pseudorandom generator and dynamic variable "$RANDOM".
//config: Each read of "$RANDOM" will generate a new pseudorandom value. //config: Each read of "$RANDOM" will generate a new pseudorandom value.
@ -91,7 +96,7 @@
//config:config ASH_EXPAND_PRMT //config:config ASH_EXPAND_PRMT
//config: bool "Expand prompt string" //config: bool "Expand prompt string"
//config: default y //config: default y
//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH //config: depends on SHELL_ASH
//config: help //config: help
//config: $PS# may contain volatile content, such as backquote commands. //config: $PS# may contain volatile content, such as backquote commands.
//config: This option recreates the prompt string from the environment //config: This option recreates the prompt string from the environment
@ -100,14 +105,14 @@
//config:config ASH_IDLE_TIMEOUT //config:config ASH_IDLE_TIMEOUT
//config: bool "Idle timeout variable $TMOUT" //config: bool "Idle timeout variable $TMOUT"
//config: default y //config: default y
//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH //config: depends on SHELL_ASH
//config: help //config: help
//config: Enable bash-like auto-logout after $TMOUT seconds of idle time. //config: Enable bash-like auto-logout after $TMOUT seconds of idle time.
//config: //config:
//config:config ASH_MAIL //config:config ASH_MAIL
//config: bool "Check for new mail in interactive shell" //config: bool "Check for new mail in interactive shell"
//config: default y //config: default y
//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH //config: depends on SHELL_ASH
//config: help //config: help
//config: Enable "check for new mail" function: //config: Enable "check for new mail" function:
//config: if set, $MAIL file and $MAILPATH list of files //config: if set, $MAIL file and $MAILPATH list of files
@ -117,32 +122,32 @@
//config:config ASH_ECHO //config:config ASH_ECHO
//config: bool "echo builtin" //config: bool "echo builtin"
//config: default y //config: default y
//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH //config: depends on SHELL_ASH
//config: //config:
//config:config ASH_PRINTF //config:config ASH_PRINTF
//config: bool "printf builtin" //config: bool "printf builtin"
//config: default y //config: default y
//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH //config: depends on SHELL_ASH
//config: //config:
//config:config ASH_TEST //config:config ASH_TEST
//config: bool "test builtin" //config: bool "test builtin"
//config: default y //config: default y
//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH //config: depends on SHELL_ASH
//config: //config:
//config:config ASH_HELP //config:config ASH_HELP
//config: bool "help builtin" //config: bool "help builtin"
//config: default y //config: default y
//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH //config: depends on SHELL_ASH
//config: //config:
//config:config ASH_GETOPTS //config:config ASH_GETOPTS
//config: bool "getopts builtin" //config: bool "getopts builtin"
//config: default y //config: default y
//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH //config: depends on SHELL_ASH
//config: //config:
//config:config ASH_CMDCMD //config:config ASH_CMDCMD
//config: bool "command builtin" //config: bool "command builtin"
//config: default y //config: default y
//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH //config: depends on SHELL_ASH
//config: help //config: help
//config: Enable support for the 'command' builtin, which allows //config: Enable support for the 'command' builtin, which allows
//config: you to run the specified command or builtin, //config: you to run the specified command or builtin,
@ -155,9 +160,7 @@
//applet:IF_SH_IS_ASH( APPLET_ODDNAME(sh, ash, BB_DIR_BIN, BB_SUID_DROP, ash)) //applet:IF_SH_IS_ASH( APPLET_ODDNAME(sh, ash, BB_DIR_BIN, BB_SUID_DROP, ash))
//applet:IF_BASH_IS_ASH(APPLET_ODDNAME(bash, ash, BB_DIR_BIN, BB_SUID_DROP, ash)) //applet:IF_BASH_IS_ASH(APPLET_ODDNAME(bash, ash, BB_DIR_BIN, BB_SUID_DROP, ash))
//kbuild:lib-$(CONFIG_ASH) += ash.o ash_ptr_hack.o shell_common.o //kbuild:lib-$(CONFIG_SHELL_ASH) += ash.o ash_ptr_hack.o shell_common.o
//kbuild:lib-$(CONFIG_SH_IS_ASH) += ash.o ash_ptr_hack.o shell_common.o
//kbuild:lib-$(CONFIG_BASH_IS_ASH) += ash.o ash_ptr_hack.o shell_common.o
//kbuild:lib-$(CONFIG_ASH_RANDOM_SUPPORT) += random.o //kbuild:lib-$(CONFIG_ASH_RANDOM_SUPPORT) += random.o
/* /*

View File

@ -95,6 +95,7 @@
//config:config HUSH //config:config HUSH
//config: bool "hush (68 kb)" //config: bool "hush (68 kb)"
//config: default y //config: default y
//config: select SHELL_HUSH
//config: help //config: help
//config: hush is a small shell. It handles the normal flow control //config: hush is a small shell. It handles the normal flow control
//config: constructs such as if/then/elif/else/fi, for/in/do/done, while loops, //config: constructs such as if/then/elif/else/fi, for/in/do/done, while loops,
@ -106,10 +107,20 @@
//config: It does not handle select, aliases, tilde expansion, //config: It does not handle select, aliases, tilde expansion,
//config: &>file and >&file redirection of stdout+stderr. //config: &>file and >&file redirection of stdout+stderr.
//config: //config:
// This option is visible (has a description) to make it possible to select
// a "scripted" applet (such as NOLOGIN) but avoid selecting any shells:
//config:config SHELL_HUSH
//config: bool "Internal shell for embedded script support"
//config: default n
//config:
//config:# hush options
//config:# It's only needed to get "nice" menuconfig indenting.
//config:if SHELL_HUSH || HUSH || SH_IS_HUSH || BASH_IS_HUSH
//config:
//config:config HUSH_BASH_COMPAT //config:config HUSH_BASH_COMPAT
//config: bool "bash-compatible extensions" //config: bool "bash-compatible extensions"
//config: default y //config: default y
//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: depends on SHELL_HUSH
//config: //config:
//config:config HUSH_BRACE_EXPANSION //config:config HUSH_BRACE_EXPANSION
//config: bool "Brace expansion" //config: bool "Brace expansion"
@ -133,7 +144,7 @@
//config:config HUSH_INTERACTIVE //config:config HUSH_INTERACTIVE
//config: bool "Interactive mode" //config: bool "Interactive mode"
//config: default y //config: default y
//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: depends on SHELL_HUSH
//config: help //config: help
//config: Enable interactive mode (prompt and command editing). //config: Enable interactive mode (prompt and command editing).
//config: Without this, hush simply reads and executes commands //config: Without this, hush simply reads and executes commands
@ -159,31 +170,31 @@
//config:config HUSH_TICK //config:config HUSH_TICK
//config: bool "Support command substitution" //config: bool "Support command substitution"
//config: default y //config: default y
//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: depends on SHELL_HUSH
//config: help //config: help
//config: Enable `command` and $(command). //config: Enable `command` and $(command).
//config: //config:
//config:config HUSH_IF //config:config HUSH_IF
//config: bool "Support if/then/elif/else/fi" //config: bool "Support if/then/elif/else/fi"
//config: default y //config: default y
//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: depends on SHELL_HUSH
//config: //config:
//config:config HUSH_LOOPS //config:config HUSH_LOOPS
//config: bool "Support for, while and until loops" //config: bool "Support for, while and until loops"
//config: default y //config: default y
//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: depends on SHELL_HUSH
//config: //config:
//config:config HUSH_CASE //config:config HUSH_CASE
//config: bool "Support case ... esac statement" //config: bool "Support case ... esac statement"
//config: default y //config: default y
//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: depends on SHELL_HUSH
//config: help //config: help
//config: Enable case ... esac statement. +400 bytes. //config: Enable case ... esac statement. +400 bytes.
//config: //config:
//config:config HUSH_FUNCTIONS //config:config HUSH_FUNCTIONS
//config: bool "Support funcname() { commands; } syntax" //config: bool "Support funcname() { commands; } syntax"
//config: default y //config: default y
//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: depends on SHELL_HUSH
//config: help //config: help
//config: Enable support for shell functions. +800 bytes. //config: Enable support for shell functions. +800 bytes.
//config: //config:
@ -197,7 +208,7 @@
//config:config HUSH_RANDOM_SUPPORT //config:config HUSH_RANDOM_SUPPORT
//config: bool "Pseudorandom generator and $RANDOM variable" //config: bool "Pseudorandom generator and $RANDOM variable"
//config: default y //config: default y
//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: depends on SHELL_HUSH
//config: help //config: help
//config: Enable pseudorandom generator and dynamic variable "$RANDOM". //config: Enable pseudorandom generator and dynamic variable "$RANDOM".
//config: Each read of "$RANDOM" will generate a new pseudorandom value. //config: Each read of "$RANDOM" will generate a new pseudorandom value.
@ -205,7 +216,7 @@
//config:config HUSH_MODE_X //config:config HUSH_MODE_X
//config: bool "Support 'hush -x' option and 'set -x' command" //config: bool "Support 'hush -x' option and 'set -x' command"
//config: default y //config: default y
//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: depends on SHELL_HUSH
//config: help //config: help
//config: This instructs hush to print commands before execution. //config: This instructs hush to print commands before execution.
//config: Adds ~300 bytes. //config: Adds ~300 bytes.
@ -213,27 +224,27 @@
//config:config HUSH_ECHO //config:config HUSH_ECHO
//config: bool "echo builtin" //config: bool "echo builtin"
//config: default y //config: default y
//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: depends on SHELL_HUSH
//config: //config:
//config:config HUSH_PRINTF //config:config HUSH_PRINTF
//config: bool "printf builtin" //config: bool "printf builtin"
//config: default y //config: default y
//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: depends on SHELL_HUSH
//config: //config:
//config:config HUSH_TEST //config:config HUSH_TEST
//config: bool "test builtin" //config: bool "test builtin"
//config: default y //config: default y
//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: depends on SHELL_HUSH
//config: //config:
//config:config HUSH_HELP //config:config HUSH_HELP
//config: bool "help builtin" //config: bool "help builtin"
//config: default y //config: default y
//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: depends on SHELL_HUSH
//config: //config:
//config:config HUSH_EXPORT //config:config HUSH_EXPORT
//config: bool "export builtin" //config: bool "export builtin"
//config: default y //config: default y
//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: depends on SHELL_HUSH
//config: //config:
//config:config HUSH_EXPORT_N //config:config HUSH_EXPORT_N
//config: bool "Support 'export -n' option" //config: bool "Support 'export -n' option"
@ -245,83 +256,83 @@
//config:config HUSH_READONLY //config:config HUSH_READONLY
//config: bool "readonly builtin" //config: bool "readonly builtin"
//config: default y //config: default y
//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: depends on SHELL_HUSH
//config: help //config: help
//config: Enable support for read-only variables. //config: Enable support for read-only variables.
//config: //config:
//config:config HUSH_KILL //config:config HUSH_KILL
//config: bool "kill builtin (supports kill %jobspec)" //config: bool "kill builtin (supports kill %jobspec)"
//config: default y //config: default y
//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: depends on SHELL_HUSH
//config: //config:
//config:config HUSH_WAIT //config:config HUSH_WAIT
//config: bool "wait builtin" //config: bool "wait builtin"
//config: default y //config: default y
//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: depends on SHELL_HUSH
//config: //config:
//config:config HUSH_COMMAND //config:config HUSH_COMMAND
//config: bool "command builtin" //config: bool "command builtin"
//config: default y //config: default y
//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: depends on SHELL_HUSH
//config: //config:
//config:config HUSH_TRAP //config:config HUSH_TRAP
//config: bool "trap builtin" //config: bool "trap builtin"
//config: default y //config: default y
//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: depends on SHELL_HUSH
//config: //config:
//config:config HUSH_TYPE //config:config HUSH_TYPE
//config: bool "type builtin" //config: bool "type builtin"
//config: default y //config: default y
//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: depends on SHELL_HUSH
//config: //config:
//config:config HUSH_TIMES //config:config HUSH_TIMES
//config: bool "times builtin" //config: bool "times builtin"
//config: default y //config: default y
//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: depends on SHELL_HUSH
//config: //config:
//config:config HUSH_READ //config:config HUSH_READ
//config: bool "read builtin" //config: bool "read builtin"
//config: default y //config: default y
//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: depends on SHELL_HUSH
//config: //config:
//config:config HUSH_SET //config:config HUSH_SET
//config: bool "set builtin" //config: bool "set builtin"
//config: default y //config: default y
//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: depends on SHELL_HUSH
//config: //config:
//config:config HUSH_UNSET //config:config HUSH_UNSET
//config: bool "unset builtin" //config: bool "unset builtin"
//config: default y //config: default y
//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: depends on SHELL_HUSH
//config: //config:
//config:config HUSH_ULIMIT //config:config HUSH_ULIMIT
//config: bool "ulimit builtin" //config: bool "ulimit builtin"
//config: default y //config: default y
//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: depends on SHELL_HUSH
//config: //config:
//config:config HUSH_UMASK //config:config HUSH_UMASK
//config: bool "umask builtin" //config: bool "umask builtin"
//config: default y //config: default y
//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: depends on SHELL_HUSH
//config: //config:
//config:config HUSH_GETOPTS //config:config HUSH_GETOPTS
//config: bool "getopts builtin" //config: bool "getopts builtin"
//config: default y //config: default y
//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: depends on SHELL_HUSH
//config: //config:
//config:config HUSH_MEMLEAK //config:config HUSH_MEMLEAK
//config: bool "memleak builtin (debugging)" //config: bool "memleak builtin (debugging)"
//config: default n //config: default n
//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: depends on SHELL_HUSH
//config:
//config:endif # hush options
//applet:IF_HUSH(APPLET(hush, BB_DIR_BIN, BB_SUID_DROP)) //applet:IF_HUSH(APPLET(hush, BB_DIR_BIN, BB_SUID_DROP))
// APPLET_ODDNAME:name main location suid_type help // APPLET_ODDNAME:name main location suid_type help
//applet:IF_SH_IS_HUSH( APPLET_ODDNAME(sh, hush, BB_DIR_BIN, BB_SUID_DROP, hush)) //applet:IF_SH_IS_HUSH( APPLET_ODDNAME(sh, hush, BB_DIR_BIN, BB_SUID_DROP, hush))
//applet:IF_BASH_IS_HUSH(APPLET_ODDNAME(bash, hush, BB_DIR_BIN, BB_SUID_DROP, hush)) //applet:IF_BASH_IS_HUSH(APPLET_ODDNAME(bash, hush, BB_DIR_BIN, BB_SUID_DROP, hush))
//kbuild:lib-$(CONFIG_HUSH) += hush.o match.o shell_common.o //kbuild:lib-$(CONFIG_SHELL_HUSH) += hush.o match.o shell_common.o
//kbuild:lib-$(CONFIG_SH_IS_HUSH) += hush.o match.o shell_common.o
//kbuild:lib-$(CONFIG_BASH_IS_HUSH) += hush.o match.o shell_common.o
//kbuild:lib-$(CONFIG_HUSH_RANDOM_SUPPORT) += random.o //kbuild:lib-$(CONFIG_HUSH_RANDOM_SUPPORT) += random.o
/* -i (interactive) is also accepted, /* -i (interactive) is also accepted,

View File

@ -7,7 +7,7 @@
//config: //config:
//config:config NOLOGIN_DEPENDENCIES //config:config NOLOGIN_DEPENDENCIES
//config: bool "Enable dependencies for nologin" //config: bool "Enable dependencies for nologin"
//config: default y //config: default n # Y default makes it harder to select single-applet test
//config: depends on NOLOGIN //config: depends on NOLOGIN
//config: select CAT //config: select CAT
//config: select ECHO //config: select ECHO