It isn't clear how useful it is to pass the arguments of bootm to the OS. For example, if "bootm 1000 2000 3000" is used, the three arguments at the end are passed to the OS. This seems like a strange approach, since the argument have already been parsed by U-Boot and processed.
Rely instead on the "bootargs" mechanism, which is the standard approach. Signed-off-by: Simon Glass <s...@chromium.org> --- boot/bootm_os.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/boot/bootm_os.c b/boot/bootm_os.c index b92422171a84..b5055d78706c 100644 --- a/boot/bootm_os.c +++ b/boot/bootm_os.c @@ -102,19 +102,9 @@ static int do_bootm_netbsd(int flag, int argc, char *const argv[], os_hdr = hdr; } - if (argc > 0) { - ulong len; - int i; - - for (i = 0, len = 0; i < argc; i += 1) - len += strlen(argv[i]) + 1; - cmdline = malloc(len); - copy_args(cmdline, argc, argv, ' '); - } else { - cmdline = env_get("bootargs"); - if (cmdline == NULL) - cmdline = ""; - } + cmdline = env_get("bootargs"); + if (!cmdline) + cmdline = ""; loader = (void (*)(struct bd_info *, struct legacy_img_hdr *, char *, char *))images->ep; -- 2.43.0.rc2.451.g8631bc7472-goog