[U-Boot] [PATCH] Fix "autostart" env variable handling

Patch 5a442c0a [boot cmds: convert to getenv_yesno() with autostart] changes the boot commands code to use the getenv_yesno() helper function. But this function returns true (1) when "autostart" is not defined at all.
This patch changes the logic of getenv_yesno() to only return true when "autostart" is defined and the first char is set to "y". This restores the old behavior on boards where "autostart" is not defined at all.
Signed-off-by: Stefan Roese sr@denx.de Cc: Mike Frysinger vapier@gentoo.org --- common/image.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/common/image.c b/common/image.c index f63a2ff..aa95882 100644 --- a/common/image.c +++ b/common/image.c @@ -412,7 +412,7 @@ static const image_header_t *image_get_ramdisk (ulong rd_addr, uint8_t arch, int getenv_yesno (char *var) { char *s = getenv (var); - return (s && (*s == 'n')) ? 0 : 1; + return (s && (*s == 'y')) ? 1 : 0; }
ulong getenv_bootm_low(void)

On Tuesday, December 07, 2010 05:19:01 Stefan Roese wrote:
Patch 5a442c0a [boot cmds: convert to getenv_yesno() with autostart] changes the boot commands code to use the getenv_yesno() helper function. But this function returns true (1) when "autostart" is not defined at all.
This patch changes the logic of getenv_yesno() to only return true when "autostart" is defined and the first char is set to "y". This restores the old behavior on boards where "autostart" is not defined at all.
NAK; this breaks other things. i already mentioned the issue here: http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/87057/focus=90059 but waiting for response from wolfgang ... -mke
participants (2)
-
Mike Frysinger
-
Stefan Roese