summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2016-08-19 14:39:28 +1000
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2016-08-19 15:15:23 +1000
commitd2bb9b5a636753586e9d6b2b3606770a2bff6a11 (patch)
treee5fd3e230ab035bd26a988fe68c2806945e85c0b
parent8f0e069fc43ed6f6a230329839f970415147d1aa (diff)
downloadpetitboot-d2bb9b5a636753586e9d6b2b3606770a2bff6a11.zip
petitboot-d2bb9b5a636753586e9d6b2b3606770a2bff6a11.tar.gz
discover/boot: Always pass --append to kexec
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>
-rw-r--r--discover/boot.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/discover/boot.c b/discover/boot.c
index ba6ce25..04e7a54 100644
--- a/discover/boot.c
+++ b/discover/boot.c
@@ -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 */
OpenPOWER on IntegriCloud