From afb903a2eb9436baa9270ccc0c27082d86497d89 Mon Sep 17 00:00:00 2001 From: Jeffrey Mann Date: Mon, 23 Apr 2007 14:00:11 +0200 Subject: [patch] setenv(...) can delete environmentalvariables update setenv() function so that entering a NULL value for the variable's value will delete the environmental variable Signed-off-by: Jeffrey Mann Acked-by: Stefan Roese --- common/cmd_nvedit.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) mode change 100644 => 100755 common/cmd_nvedit.c (limited to 'common') diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c old mode 100644 new mode 100755 index 9834ba6..977ec5b --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -391,7 +391,10 @@ int _do_setenv (int flag, int argc, char *argv[]) void setenv (char *varname, char *varvalue) { char *argv[4] = { "setenv", varname, varvalue, NULL }; - _do_setenv (0, 3, argv); + if (varvalue == NULL) + _do_setenv (0, 2, argv); + else + _do_setenv (0, 3, argv); } int do_setenv ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) -- cgit v1.1 From 7fc4c71a143be8666d70803fb25ae60379c95622 Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Mon, 23 Apr 2007 15:39:59 +0200 Subject: Fix file mode Signed-off-by: Stefan Roese --- common/cmd_nvedit.c | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 common/cmd_nvedit.c (limited to 'common') diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c old mode 100755 new mode 100644 -- cgit v1.1 From ada4d40091f6ed4a4f0040e08d20db21967e4a67 Mon Sep 17 00:00:00 2001 From: Ladislav Michl Date: Wed, 25 Apr 2007 16:01:26 +0200 Subject: [PATCH] simplify silent console Signed-off-by: Ladislav Michl Acked-by: Stefan Roese --- common/console.c | 8 +------- common/main.c | 50 +++++++++++--------------------------------------- 2 files changed, 12 insertions(+), 46 deletions(-) (limited to 'common') diff --git a/common/console.c b/common/console.c index e9f23be..d8a0cb6 100644 --- a/common/console.c +++ b/common/console.c @@ -494,13 +494,7 @@ int console_init_r (void) /* suppress all output if splash screen is enabled and we have a bmp to display */ if (getenv("splashimage") != NULL) - outputdev = search_device (DEV_FLAGS_OUTPUT, "nulldev"); -#endif - -#ifdef CONFIG_SILENT_CONSOLE - /* Suppress all output if "silent" mode requested */ - if (gd->flags & GD_FLG_SILENT) - outputdev = search_device (DEV_FLAGS_OUTPUT, "nulldev"); + gd->flags |= GD_FLG_SILENT; #endif /* Scan devices looking for input and output devices */ diff --git a/common/main.c b/common/main.c index cc4b50f..0003da2 100644 --- a/common/main.c +++ b/common/main.c @@ -112,16 +112,8 @@ static __inline__ int abortboot(int bootdelay) u_int presskey_max = 0; u_int i; -#ifdef CONFIG_SILENT_CONSOLE - if (gd->flags & GD_FLG_SILENT) { - /* Restore serial console */ - console_assign (stdout, "serial"); - console_assign (stderr, "serial"); - } -#endif - # ifdef CONFIG_AUTOBOOT_PROMPT - printf (CONFIG_AUTOBOOT_PROMPT, bootdelay); + printf(CONFIG_AUTOBOOT_PROMPT, bootdelay); # endif # ifdef CONFIG_AUTOBOOT_DELAY_STR @@ -195,18 +187,12 @@ static __inline__ int abortboot(int bootdelay) } # if DEBUG_BOOTKEYS if (!abort) - puts ("key timeout\n"); + puts("key timeout\n"); # endif #ifdef CONFIG_SILENT_CONSOLE - if (abort) { - /* permanently enable normal console output */ - gd->flags &= ~(GD_FLG_SILENT); - } else if (gd->flags & GD_FLG_SILENT) { - /* Restore silent console */ - console_assign (stdout, "nulldev"); - console_assign (stderr, "nulldev"); - } + if (abort) + gd->flags &= ~GD_FLG_SILENT; #endif return abort; @@ -222,14 +208,6 @@ static __inline__ int abortboot(int bootdelay) { int abort = 0; -#ifdef CONFIG_SILENT_CONSOLE - if (gd->flags & GD_FLG_SILENT) { - /* Restore serial console */ - console_assign (stdout, "serial"); - console_assign (stderr, "serial"); - } -#endif - #ifdef CONFIG_MENUPROMPT printf(CONFIG_MENUPROMPT, bootdelay); #else @@ -244,8 +222,8 @@ static __inline__ int abortboot(int bootdelay) if (bootdelay >= 0) { if (tstc()) { /* we got a key press */ (void) getc(); /* consume input */ - puts ("\b\b\b 0"); - abort = 1; /* don't auto boot */ + puts("\b\b\b 0"); + abort = 1; /* don't auto boot */ } } #endif @@ -266,23 +244,17 @@ static __inline__ int abortboot(int bootdelay) # endif break; } - udelay (10000); + udelay(10000); } - printf ("\b\b\b%2d ", bootdelay); + printf("\b\b\b%2d ", bootdelay); } - putc ('\n'); + putc('\n'); #ifdef CONFIG_SILENT_CONSOLE - if (abort) { - /* permanently enable normal console output */ - gd->flags &= ~(GD_FLG_SILENT); - } else if (gd->flags & GD_FLG_SILENT) { - /* Restore silent console */ - console_assign (stdout, "nulldev"); - console_assign (stderr, "nulldev"); - } + if (abort) + gd->flags &= ~GD_FLG_SILENT; #endif return abort; -- cgit v1.1