9
0
Fork 0

make command support optional

In a noninveractive environment we do not need commands. So make
them optional.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2011-04-01 15:16:27 +02:00
parent 71a4899e18
commit 3c702a58c7
4 changed files with 17 additions and 3 deletions

View File

@ -1,7 +1,14 @@
config REGINFO config REGINFO
bool bool
menu "Commands " config COMMAND_SUPPORT
bool
depends on !SHELL_NONE
default y
if COMMAND_SUPPORT
menu "commands "
menu "scripting " menu "scripting "
@ -404,3 +411,5 @@ config CMD_USB
The usb command allows to rescan for USB devices. The usb command allows to rescan for USB devices.
endmenu endmenu
endif

View File

@ -223,6 +223,7 @@ choice
config SHELL_HUSH config SHELL_HUSH
bool "hush parser" bool "hush parser"
select ENVIRONMENT_VARIABLES select ENVIRONMENT_VARIABLES
select COMMAND_SUPPORT
help help
Enable hush support. This is the most advanced shell available Enable hush support. This is the most advanced shell available
for barebox. for barebox.
@ -230,6 +231,7 @@ choice
config SHELL_SIMPLE config SHELL_SIMPLE
bool "Simple parser" bool "Simple parser"
select ENVIRONMENT_VARIABLES select ENVIRONMENT_VARIABLES
select COMMAND_SUPPORT
help help
simple shell. No if/then, no return values from commands, no loops simple shell. No if/then, no return values from commands, no loops
endchoice endchoice

View File

@ -11,7 +11,7 @@ obj-$(CONFIG_BLOCK) += block.o
obj-y += dlmalloc.o obj-y += dlmalloc.o
obj-y += clock.o obj-y += clock.o
obj-y += version.o obj-y += version.o
obj-y += command.o obj-$(CONFIG_COMMAND_SUPPORT) += command.o
obj-$(CONFIG_CONSOLE_FULL) += console.o obj-$(CONFIG_CONSOLE_FULL) += console.o
obj-$(CONFIG_CONSOLE_SIMPLE) += console_simple.o obj-$(CONFIG_CONSOLE_SIMPLE) += console_simple.o
obj-$(CONFIG_DIGEST) += digest.o obj-$(CONFIG_DIGEST) += digest.o

View File

@ -118,7 +118,9 @@ void start_barebox (void)
{ {
initcall_t *initcall; initcall_t *initcall;
int result; int result;
#ifdef CONFIG_COMMAND_SUPPORT
struct stat s; struct stat s;
#endif
#ifdef CONFIG_HAS_EARLY_INIT #ifdef CONFIG_HAS_EARLY_INIT
/* We are running from RAM now, copy early initdata from /* We are running from RAM now, copy early initdata from
@ -150,6 +152,7 @@ void start_barebox (void)
#endif #endif
} }
#endif #endif
#ifdef CONFIG_COMMAND_SUPPORT
printf("running /env/bin/init...\n"); printf("running /env/bin/init...\n");
if (!stat("/env/bin/init", &s)) { if (!stat("/env/bin/init", &s)) {
@ -157,7 +160,7 @@ void start_barebox (void)
} else { } else {
printf("not found\n"); printf("not found\n");
} }
#endif
/* main_loop() can return to retry autoboot, if so just run it again. */ /* main_loop() can return to retry autoboot, if so just run it again. */
for (;;) for (;;)
run_shell(); run_shell();