summaryrefslogtreecommitdiffstats
path: root/discover/boot.c
diff options
context:
space:
mode:
authorGeoff Levand <geoff@infradead.org>2018-08-02 17:29:34 +0000
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2018-08-07 11:30:36 +1000
commitfb241b16e49ac2bd5bb14db7bc389bd4a0b1df60 (patch)
treebc161b83c2425b40646507b3d082d917fdb44ff1 /discover/boot.c
parentc78f9ec47ba92b74698dacdae963dbbefd9b676f (diff)
downloadtalos-petitboot-fb241b16e49ac2bd5bb14db7bc389bd4a0b1df60.tar.gz
talos-petitboot-fb241b16e49ac2bd5bb14db7bc389bd4a0b1df60.zip
discover: Add --debug to kexec
If verbose logging is enabled then add '--debug' to the kexec command line. Adds a new routine pb_log_get_debug() that can be used to query the log debug state. Signed-off-by: Geoff Levand <geoff@infradead.org> Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Diffstat (limited to 'discover/boot.c')
-rw-r--r--discover/boot.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/discover/boot.c b/discover/boot.c
index 7faec9f..3de7d28 100644
--- a/discover/boot.c
+++ b/discover/boot.c
@@ -62,7 +62,7 @@ static int kexec_load(struct boot_task *boot_task)
struct process *process;
char *s_initrd = NULL;
char *s_args = NULL;
- const char *argv[7];
+ const char *argv[8];
char *s_dtb = NULL;
const char **p;
int result;
@@ -107,27 +107,31 @@ static int kexec_load(struct boot_task *boot_task)
*p++ = pb_system_apps.kexec; /* 1 */
*p++ = "-l"; /* 2 */
+ if (pb_log_get_debug()) {
+ *p++ = "--debug"; /* 3 */
+ }
+
if (local_initrd) {
s_initrd = talloc_asprintf(boot_task, "--initrd=%s",
local_initrd);
assert(s_initrd);
- *p++ = s_initrd; /* 3 */
+ *p++ = s_initrd; /* 4 */
}
if (local_dtb) {
s_dtb = talloc_asprintf(boot_task, "--dtb=%s",
local_dtb);
assert(s_dtb);
- *p++ = s_dtb; /* 4 */
+ *p++ = s_dtb; /* 5 */
}
s_args = talloc_asprintf(boot_task, "--append=%s",
boot_task->args ?: "\"\"");
assert(s_args);
- *p++ = s_args; /* 5 */
+ *p++ = s_args; /* 6 */
- *p++ = local_image; /* 6 */
- *p++ = NULL; /* 7 */
+ *p++ = local_image; /* 7 */
+ *p++ = NULL; /* 8 */
result = process_run_sync(process);
if (result) {
OpenPOWER on IntegriCloud