Pass NULL for cmd_start/end when bootcmd not present
PATCH 1/1 Pass NULL for cmd_start/end when bootcmd not present
Update the way cmd_start and cmd_end are passed to the kernel when there is no provided 'bootcmd' environment variable.
In this case r6 and r7, which are optional arguments, should be passed as NULL. This lets the kernel fall back on its default command line arguments as defined in the kernel .config as CONFIG_CMDLINE
Signed-off-by Martin Hicks <[email protected]>
---
common/cmd_bootm.c | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-)
7bd5192777d195833d18fe4a224ca71bfb55117c
common/cmd_bootm.c +11 -6
@@ -567,18 +567,23 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int fl cmdline = (char *)((sp -CFG_BARGSIZE ) & ~0xF ); kbd = (bd_t *)(((ulong )cmdline -sizeof (bd_t)) & ~0xF ); -if ((s =getenv ("bootargs" )) ==NULL ) +if ((s =getenv ("bootargs" )) ==NULL ) { + cmd_start = cmd_end =0 ; s ="" ; + }else { +strcpy (cmdline, s); -strcpy (cmdline, s); - - cmd_start = (ulong)&cmdline[0 ]; - cmd_end = cmd_start +strlen (cmdline); + cmd_start = (ulong)&cmdline[0 ]; + cmd_end = cmd_start +strlen (cmdline); + } *kbd = *(gd->bd);#ifdef DEBUG -printf ("## cmdline at 0x%08lX ... 0x%08lX\n" , cmd_start, cmd_end); +if (cmd_start) +printf ("## cmdline at 0x%08lX ... 0x%08lX\n" , cmd_start, cmd_end); +else +printf ("## cmdline len is 0. Not passing a cmdline\n" );do_bdinfo (NULL ,0 ,0 ,NULL );#endif
Signature · 1 line
1.2.4