summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2011-04-01 15:16:27 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2011-04-11 15:57:51 +0200
commit3c702a58c7db0c3a1d5355643205b97c430a1017 (patch)
treeb38b858bc7de6bd805bdd0e7b06aa8146ada87c8
parent71a4899e18295995e0ea13438b4efe9b8ac16d5a (diff)
downloadbarebox-3c702a58c7db0c3a1d5355643205b97c430a1017.tar.gz
barebox-3c702a58c7db0c3a1d5355643205b97c430a1017.tar.xz
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>
-rw-r--r--commands/Kconfig11
-rw-r--r--common/Kconfig2
-rw-r--r--common/Makefile2
-rw-r--r--common/startup.c5
4 files changed, 17 insertions, 3 deletions
diff --git a/commands/Kconfig b/commands/Kconfig
index a443501f33..f192d30978 100644
--- a/commands/Kconfig
+++ b/commands/Kconfig
@@ -1,7 +1,14 @@
config REGINFO
bool
-menu "Commands "
+config COMMAND_SUPPORT
+ bool
+ depends on !SHELL_NONE
+ default y
+
+if COMMAND_SUPPORT
+
+menu "commands "
menu "scripting "
@@ -404,3 +411,5 @@ config CMD_USB
The usb command allows to rescan for USB devices.
endmenu
+
+endif
diff --git a/common/Kconfig b/common/Kconfig
index b493a31a4e..83975eeee9 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -223,6 +223,7 @@ choice
config SHELL_HUSH
bool "hush parser"
select ENVIRONMENT_VARIABLES
+ select COMMAND_SUPPORT
help
Enable hush support. This is the most advanced shell available
for barebox.
@@ -230,6 +231,7 @@ choice
config SHELL_SIMPLE
bool "Simple parser"
select ENVIRONMENT_VARIABLES
+ select COMMAND_SUPPORT
help
simple shell. No if/then, no return values from commands, no loops
endchoice
diff --git a/common/Makefile b/common/Makefile
index c8a4332139..6a044601c4 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -11,7 +11,7 @@ obj-$(CONFIG_BLOCK) += block.o
obj-y += dlmalloc.o
obj-y += clock.o
obj-y += version.o
-obj-y += command.o
+obj-$(CONFIG_COMMAND_SUPPORT) += command.o
obj-$(CONFIG_CONSOLE_FULL) += console.o
obj-$(CONFIG_CONSOLE_SIMPLE) += console_simple.o
obj-$(CONFIG_DIGEST) += digest.o
diff --git a/common/startup.c b/common/startup.c
index b487c5b027..38087093b0 100644
--- a/common/startup.c
+++ b/common/startup.c
@@ -118,7 +118,9 @@ void start_barebox (void)
{
initcall_t *initcall;
int result;
+#ifdef CONFIG_COMMAND_SUPPORT
struct stat s;
+#endif
#ifdef CONFIG_HAS_EARLY_INIT
/* We are running from RAM now, copy early initdata from
@@ -150,6 +152,7 @@ void start_barebox (void)
#endif
}
#endif
+#ifdef CONFIG_COMMAND_SUPPORT
printf("running /env/bin/init...\n");
if (!stat("/env/bin/init", &s)) {
@@ -157,7 +160,7 @@ void start_barebox (void)
} else {
printf("not found\n");
}
-
+#endif
/* main_loop() can return to retry autoboot, if so just run it again. */
for (;;)
run_shell();