x86: Don't process the kernel command line unless enabled
authorSimon Glass <sjg@chromium.org>
Wed, 29 Dec 2021 18:57:39 +0000 (11:57 -0700)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fri, 31 Dec 2021 05:45:01 +0000 (06:45 +0100)
If the 'bootm' command is not enabled then this code is not available and
this causes a link error. Fix it.

Note that for the EFI app, there is no indication of missing code. It just
hangs!

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
arch/x86/lib/zimage.c

index 7ce0222..9cc0449 100644 (file)
@@ -365,11 +365,14 @@ int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot,
                        strcpy(cmd_line, (char *)cmdline_force);
                else
                        build_command_line(cmd_line, auto_boot);
-               ret = bootm_process_cmdline(cmd_line, max_size, BOOTM_CL_ALL);
-               if (ret) {
-                       printf("Cmdline setup failed (max_size=%x, bootproto=%x, err=%d)\n",
-                              max_size, bootproto, ret);
-                       return ret;
+               if (IS_ENABLED(CONFIG_CMD_BOOTM)) {
+                       ret = bootm_process_cmdline(cmd_line, max_size,
+                                                   BOOTM_CL_ALL);
+                       if (ret) {
+                               printf("Cmdline setup failed (max_size=%x, bootproto=%x, err=%d)\n",
+                                      max_size, bootproto, ret);
+                               return ret;
+                       }
                }
                printf("Kernel command line: \"");
                puts(cmd_line);