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>
struct process *process;
char *s_initrd = NULL;
char *s_args = NULL;
struct process *process;
char *s_initrd = NULL;
char *s_args = NULL;
char *s_dtb = NULL;
const char **p;
int result;
char *s_dtb = NULL;
const char **p;
int result;
*p++ = pb_system_apps.kexec; /* 1 */
*p++ = "-l"; /* 2 */
*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);
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);
}
if (local_dtb) {
s_dtb = talloc_asprintf(boot_task, "--dtb=%s",
local_dtb);
assert(s_dtb);
}
s_args = talloc_asprintf(boot_task, "--append=%s",
boot_task->args ?: "\"\"");
assert(s_args);
}
s_args = talloc_asprintf(boot_task, "--append=%s",
boot_task->args ?: "\"\"");
assert(s_args);
- *p++ = local_image; /* 6 */
- *p++ = NULL; /* 7 */
+ *p++ = local_image; /* 7 */
+ *p++ = NULL; /* 8 */
result = process_run_sync(process);
if (result) {
result = process_run_sync(process);
if (result) {
+bool pb_log_get_debug(void)
+{
+ return debug;
+}
+
FILE *pb_log_get_stream(void)
{
static FILE *null_stream;
FILE *pb_log_get_stream(void)
{
static FILE *null_stream;
#endif
void pb_log_set_debug(bool debug);
#endif
void pb_log_set_debug(bool debug);
+bool pb_log_get_debug(void);
FILE *pb_log_get_stream(void);
#endif /* _LOG_H */
FILE *pb_log_get_stream(void);
#endif /* _LOG_H */