[U-Boot] [PATCH] bootdelay can be an environemt variable

Matthias Weisser weisserm at arcor.de
Tue Apr 27 08:13:54 CEST 2010


This patch allows the bootdelay variable contain the name of
another variable holding the actual bootdelay value.

Signed-off-by: Matthias Weisser <weisserm at arcor.de>
---
 common/main.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/common/main.c b/common/main.c
index f7e7c1c..f43802c 100644
--- a/common/main.c
+++ b/common/main.c
@@ -371,7 +371,14 @@ void main_loop (void)
 
 #if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0)
 	s = getenv ("bootdelay");
-	bootdelay = s ? (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY;
+	if (s != NULL) {
+		char *v = getenv (s);
+		if (v != NULL)
+			bootdelay = (int)simple_strtol(v, NULL, 10);
+		else
+			bootdelay = (int)simple_strtol(s, NULL, 10);
+	} else
+		bootdelay = CONFIG_BOOTDELAY;
 
 	debug ("### main_loop entered: bootdelay=%d\n\n", bootdelay);
 
-- 
1.5.6.3



More information about the U-Boot mailing list