summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBaoquan He <bhe@redhat.com>2023-11-14 23:20:30 +0800
committerSimon Horman <horms@kernel.org>2024-03-15 09:32:30 +0100
commit9d9cf8de8b2ad8273861a30476a46f34cd34871a (patch)
tree89546eae8bd562ec813724f9df6e0c5685ff0ed9
parent6ee2ac1bf7395a66c50365a329ae0a1519094c92 (diff)
downloadkexec-tools-9d9cf8de8b2ad8273861a30476a46f34cd34871a.tar.gz
kexec_file: add kexec_file flag to support debug printing
This add KEXEC_FILE_DEBUG to kexec_file_flags so that it can be passed to kernel when '-d' is added with kexec_file_load interface. With that flag enabled, kernel can enable the debugging message printing. Signed-off-by: Baoquan He <bhe@redhat.com> Signed-off-by: Simon Horman <horms@kernel.org>
-rw-r--r--kexec/kexec-syscall.h1
-rw-r--r--kexec/kexec.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/kexec/kexec-syscall.h b/kexec/kexec-syscall.h
index 2559bffb..73e52543 100644
--- a/kexec/kexec-syscall.h
+++ b/kexec/kexec-syscall.h
@@ -119,6 +119,7 @@ static inline long kexec_file_load(int kernel_fd, int initrd_fd,
#define KEXEC_FILE_UNLOAD 0x00000001
#define KEXEC_FILE_ON_CRASH 0x00000002
#define KEXEC_FILE_NO_INITRAMFS 0x00000004
+#define KEXEC_FILE_DEBUG 0x00000008
/* These values match the ELF architecture values.
* Unless there is a good reason that should continue to be the case.
diff --git a/kexec/kexec.c b/kexec/kexec.c
index 9d0ec46e..222f79e3 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -1477,6 +1477,7 @@ int main(int argc, char *argv[])
return 0;
case OPT_DEBUG:
kexec_debug = 1;
+ kexec_file_flags |= KEXEC_FILE_DEBUG;
break;
case OPT_NOIFDOWN:
skip_ifdown = 1;