From 771f1995a99e63600a513f97ce35cbb9f6865138 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 16 Jul 2010 14:31:34 +0200 Subject: ash: move config stuff into ash.c, no code chages Signed-off-by: Denys Vlasenko --- shell/Config.src | 114 ++++------------------------------------------------- shell/Kbuild.src | 3 -- shell/ash.c | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ shell/hush.c | 2 +- 4 files changed, 126 insertions(+), 110 deletions(-) (limited to 'shell') 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" INSERT -config ASH - bool "ash" - default y - depends on !NOMMU - help - Tha 'ash' shell adds about 60k in the default configuration and is - the most complete and most pedantically correct shell included with - busybox. This shell is actually a derivative of the Debian 'dash' - shell (by Herbert Xu), which was created by porting the 'ash' shell - (written by Kenneth Almquist) from NetBSD. - -config ASH_BASH_COMPAT - bool "bash-compatible extensions" - default y - depends on ASH - help - Enable bash-compatible extensions. - -config ASH_JOB_CONTROL - bool "Job control" - default y - depends on ASH - help - Enable job control in the ash shell. - -config ASH_ALIAS - bool "alias support" - default y - depends on ASH - help - Enable alias support in the ash shell. - -config ASH_GETOPTS - bool "Builtin getopt to parse positional parameters" - default y - depends on ASH - help - Enable getopts builtin in the ash shell. - -config ASH_BUILTIN_ECHO - bool "Builtin version of 'echo'" - default y - depends on ASH - help - Enable support for echo, builtin to ash. - -config ASH_BUILTIN_PRINTF - bool "Builtin version of 'printf'" - default y - depends on ASH - help - Enable support for printf, builtin to ash. - -config ASH_BUILTIN_TEST - bool "Builtin version of 'test'" - default y - depends on ASH - help - Enable support for test, builtin to ash. - -config ASH_CMDCMD - bool "'command' command to override shell builtins" - default y - depends on ASH - help - Enable support for the ash 'command' builtin, which allows - you to run the specified command with the specified arguments, - even when there is an ash builtin command with the same name. - -config ASH_MAIL - bool "Check for new mail on interactive shells" - default n - depends on ASH - help - Enable "check for new mail" in the ash shell. - -config ASH_OPTIMIZE_FOR_SIZE - bool "Optimize for size instead of speed" - default y - depends on ASH - help - Compile ash for reduced size at the price of speed. - -config ASH_RANDOM_SUPPORT - bool "Pseudorandom generator and $RANDOM variable" - default y - depends on ASH - help - Enable pseudorandom generator and dynamic variable "$RANDOM". - Each read of "$RANDOM" will generate a new pseudorandom value. - You can reset the generator by using a specified start value. - After "unset RANDOM" the generator will switch off and this - variable will no longer have special treatment. - -config ASH_EXPAND_PRMT - bool "Expand prompt string" - default y - depends on ASH - help - "PS#" may contain volatile content, such as backquote commands. - This option recreates the prompt string from the environment - variable each time it is displayed. - choice prompt "Choose which shell is aliased to 'sh' name" @@ -284,12 +181,17 @@ config CTTYHACK ::respawn:/bin/cttyhack /bin/sh + Starting an interactive shell from boot shell script: + + setsid cttyhack sh + Giving controlling tty to shell running with PID 1: - $ exec cttyhack sh + # exec cttyhack sh - Starting an interactive shell from boot shell script: + Without cttyhack, you need to know exact tty name, + and do something like this: - setsid cttyhack sh + # exec setsid sh -c 'exec sh /dev/tty1 2>&1' endmenu 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:= INSERT -lib-$(CONFIG_ASH) += ash.o ash_ptr_hack.o shell_common.o lib-$(CONFIG_CTTYHACK) += cttyhack.o - lib-$(CONFIG_SH_MATH_SUPPORT) += math.o -lib-$(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 @@ # error "Do not even bother, ash will not run on NOMMU machine" #endif +//applet:IF_ASH(APPLET(ash, _BB_DIR_BIN, _BB_SUID_DROP)) +//applet:IF_FEATURE_SH_IS_ASH(APPLET_ODDNAME(sh, ash, _BB_DIR_BIN, _BB_SUID_DROP, sh)) +//applet:IF_FEATURE_BASH_IS_ASH(APPLET_ODDNAME(bash, ash, _BB_DIR_BIN, _BB_SUID_DROP, bash)) + +//kbuild:lib-$(CONFIG_ASH) += ash.o ash_ptr_hack.o shell_common.o +//kbuild:lib-$(CONFIG_ASH_RANDOM_SUPPORT) += random.o + +//config:config ASH +//config: bool "ash" +//config: default y +//config: depends on !NOMMU +//config: help +//config: Tha 'ash' shell adds about 60k in the default configuration and is +//config: the most complete and most pedantically correct shell included with +//config: busybox. This shell is actually a derivative of the Debian 'dash' +//config: shell (by Herbert Xu), which was created by porting the 'ash' shell +//config: (written by Kenneth Almquist) from NetBSD. +//config: +//config:config ASH_BASH_COMPAT +//config: bool "bash-compatible extensions" +//config: default y +//config: depends on ASH +//config: help +//config: Enable bash-compatible extensions. +//config: +//config:config ASH_JOB_CONTROL +//config: bool "Job control" +//config: default y +//config: depends on ASH +//config: help +//config: Enable job control in the ash shell. +//config: +//config:config ASH_ALIAS +//config: bool "alias support" +//config: default y +//config: depends on ASH +//config: help +//config: Enable alias support in the ash shell. +//config: +//config:config ASH_GETOPTS +//config: bool "Builtin getopt to parse positional parameters" +//config: default y +//config: depends on ASH +//config: help +//config: Enable getopts builtin in the ash shell. +//config: +//config:config ASH_BUILTIN_ECHO +//config: bool "Builtin version of 'echo'" +//config: default y +//config: depends on ASH +//config: help +//config: Enable support for echo, builtin to ash. +//config: +//config:config ASH_BUILTIN_PRINTF +//config: bool "Builtin version of 'printf'" +//config: default y +//config: depends on ASH +//config: help +//config: Enable support for printf, builtin to ash. +//config: +//config:config ASH_BUILTIN_TEST +//config: bool "Builtin version of 'test'" +//config: default y +//config: depends on ASH +//config: help +//config: Enable support for test, builtin to ash. +//config: +//config:config ASH_CMDCMD +//config: bool "'command' command to override shell builtins" +//config: default y +//config: depends on ASH +//config: help +//config: Enable support for the ash 'command' builtin, which allows +//config: you to run the specified command with the specified arguments, +//config: even when there is an ash builtin command with the same name. +//config: +//config:config ASH_MAIL +//config: bool "Check for new mail on interactive shells" +//config: default n +//config: depends on ASH +//config: help +//config: Enable "check for new mail" in the ash shell. +//config: +//config:config ASH_OPTIMIZE_FOR_SIZE +//config: bool "Optimize for size instead of speed" +//config: default y +//config: depends on ASH +//config: help +//config: Compile ash for reduced size at the price of speed. +//config: +//config:config ASH_RANDOM_SUPPORT +//config: bool "Pseudorandom generator and $RANDOM variable" +//config: default y +//config: depends on ASH +//config: help +//config: Enable pseudorandom generator and dynamic variable "$RANDOM". +//config: Each read of "$RANDOM" will generate a new pseudorandom value. +//config: You can reset the generator by using a specified start value. +//config: After "unset RANDOM" the generator will switch off and this +//config: variable will no longer have special treatment. +//config: +//config:config ASH_EXPAND_PRMT +//config: bool "Expand prompt string" +//config: default y +//config: depends on ASH +//config: help +//config: "PS#" may contain volatile content, such as backquote commands. +//config: This option recreates the prompt string from the environment +//config: variable each time it is displayed. + +//usage:#define ash_trivial_usage NOUSAGE_STR +//usage:#define ash_full_usage "" +//usage:#define sh_trivial_usage NOUSAGE_STR +//usage:#define sh_full_usage "" +//usage:#define bash_trivial_usage NOUSAGE_STR +//usage:#define bash_full_usage "" + /* ============ Hash table sizes. Configurable. */ 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 @@ //config: bool "hush" //config: default y //config: help -//config: hush is a small shell (22k). It handles the normal flow control +//config: hush is a small shell (25k). It handles the normal flow control //config: constructs such as if/then/elif/else/fi, for/in/do/done, while loops, //config: case/esac. Redirections, here documents, $((arithmetic)) //config: and functions are supported. -- cgit v1.2.3