]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
x86: zimage: Improve command-line debug handling
authorSimon Glass <sjg@chromium.org>
Sun, 24 Jan 2021 17:06:09 +0000 (10:06 -0700)
committerBin Meng <bmeng.cn@gmail.com>
Mon, 1 Feb 2021 07:33:25 +0000 (15:33 +0800)
At present if the command line is very long it is truncated by the
printf() statement, which works within a limited buffer. Use puts()
instead. Also show better debugging with the command-line setup
fails.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
arch/x86/lib/zimage.c

index 3e9ee12400facd843c4cd1409b4730dbe73ac546..602788e016dea9e563cf164759187fd1ae67b53e 100644 (file)
@@ -109,8 +109,11 @@ static void build_command_line(char *command_line, int auto_boot)
 
        if (env_command_line)
                strcat(command_line, env_command_line);
-
-       printf("Kernel command line: \"%s\"\n", command_line);
+#ifdef DEBUG
+       printf("Kernel command line:");
+       puts(command_line);
+       printf("\n");
+#endif
 }
 
 static int kernel_magic_ok(struct setup_header *hdr)
@@ -354,7 +357,8 @@ int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot,
                        build_command_line(cmd_line, auto_boot);
                ret = bootm_process_cmdline(cmd_line, max_size, BOOTM_CL_ALL);
                if (ret) {
-                       printf("Cmdline setup failed (err=%d)\n", ret);
+                       printf("Cmdline setup failed (max_size=%x, bootproto=%x, err=%d)\n",
+                              max_size, bootproto, ret);
                        return ret;
                }
                printf("Kernel command line: \"");