mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 2/8] make command support optional
Date: Fri,  8 Apr 2011 16:56:13 +0200	[thread overview]
Message-ID: <1302274579-11158-3-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1302274579-11158-1-git-send-email-s.hauer@pengutronix.de>

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

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 commands/Kconfig |   11 ++++++++++-
 common/Kconfig   |    2 ++
 common/Makefile  |    2 +-
 common/startup.c |    5 ++++-
 4 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/commands/Kconfig b/commands/Kconfig
index a443501..f192d30 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 b493a31..83975ee 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 c8a4332..6a04460 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 b487c5b..3808709 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();
-- 
1.7.2.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2011-04-08 14:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-08 14:56 Size reduction patches Sascha Hauer
2011-04-08 14:56 ` [PATCH 1/8] env: Make environment variable support optional Sascha Hauer
2011-04-08 14:56 ` Sascha Hauer [this message]
2011-04-08 14:56 ` [PATCH 3/8] add noshell support Sascha Hauer
2011-04-08 14:56 ` [PATCH 4/8] arm: compile icache command only when command support is present Sascha Hauer
2011-04-08 14:56 ` [PATCH 5/8] malloc: put common memory functions to seperate file Sascha Hauer
2011-04-08 14:56 ` [PATCH 6/8] add dummy_malloc functions Sascha Hauer
2011-04-08 14:56 ` [PATCH 7/8] ARM: make exception handling optional Sascha Hauer
2011-04-08 14:56 ` [PATCH 8/8] nand: make reading oob optional Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1302274579-11158-3-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox