]> git.ozlabs.org Git - petitboot/commitdiff
discover/boot: Always pass --append to kexec
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>
Fri, 19 Aug 2016 04:39:28 +0000 (14:39 +1000)
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>
Fri, 19 Aug 2016 05:15:23 +0000 (15:15 +1000)
If we don't specify command line arguments for the next kernel, kexec
will add the contents of /chosen/bootargs if present. This is unintended
and not obvious to the user, so explicitly add append="" to the kexec
arguments if we have none to add instead.

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
discover/boot.c

index ba6ce25928180cf02847e1bcfe5fda4a8d4636e4..04e7a543919a819686ca1027ab11dfe628098e5a 100644 (file)
@@ -77,12 +77,10 @@ static int kexec_load(struct boot_task *boot_task)
                *p++ = s_dtb;            /* 4 */
        }
 
-       if (boot_task->args) {
-               s_args = talloc_asprintf(boot_task, "--append=%s",
-                                               boot_task->args);
-               assert(s_args);
-               *p++ = s_args;          /* 5 */
-       }
+       s_args = talloc_asprintf(boot_task, "--append=%s",
+                               boot_task->args ?: "\"\"");
+       assert(s_args);
+       *p++ = s_args;          /* 5 */
 
        *p++ = boot_task->local_image;  /* 6 */
        *p++ = NULL;                    /* 7 */