armv8 tools: Static bootloader passes full cmdline
authorDaniel Schwyn <daniel.schwyn@inf.ethz.ch>
Mon, 25 Nov 2019 13:41:31 +0000 (14:41 +0100)
committerDaniel Schwyn <daniel.schwyn@inf.ethz.ch>
Wed, 18 Mar 2020 14:15:02 +0000 (15:15 +0100)
Used to just pass arguments which borke cmdline parsing.

Signed-off-by: Daniel Schwyn <daniel.schwyn@inf.ethz.ch>

tools/armv8_bootimage/armv8_bootimage.c

index 845eb75..bbcef94 100644 (file)
@@ -228,8 +228,10 @@ void *create_multiboot_info(struct menu_lst *menu,
             (struct multiboot_tag_string *) cursor;
         bootcmd->type = MULTIBOOT_TAG_TYPE_CMDLINE;
         bootcmd->size = ALIGN(sizeof(struct multiboot_tag_string)
-                              + strlen(menu->kernel.args) + 1);
-        strcpy(bootcmd->string, menu->kernel.args);
+                             + strlen(menu->kernel.path) +
+                             strlen(menu->kernel.args) + 2);
+        sprintf(bootcmd->string, "%s %s", menu->kernel.path,
+                menu->kernel.args);
         cursor += bootcmd->size;
     }