diff --git a/kdump-Store-kdump-initrd-in-kernel-image-path.patch b/kdump-Store-kdump-initrd-in-kernel-image-path.patch new file mode 100644 index 0000000..f6d7fd9 --- /dev/null +++ b/kdump-Store-kdump-initrd-in-kernel-image-path.patch @@ -0,0 +1,54 @@ +From: Petr Tesarik +Date: Thu Nov 25 21:40:15 2021 +0100 +Subject: Store kdump initrd in the kernel image path +Upstream: merged +Git-commit: 202eef81d13fb0488f6e462e78ce20841a477c86 + +If the kernel image is a symlink, store the kdump initrd in the +same directory as the symlink. This fixes kdump for usrmerge +kernels, where the kernel image is under /usr. + +Canonical path is still used to get the kernel version. + +References: boo#1190920 +Signed-off-by: Petr Tesarik + +--- + kdumptool/findkernel.cc | 4 +--- + kdumptool/kerneltool.cc | 5 ++--- + 2 files changed, 3 insertions(+), 6 deletions(-) + +--- a/kdumptool/kerneltool.cc ++++ b/kdumptool/kerneltool.cc +@@ -142,7 +142,7 @@ bool KernelTool::stripImageName(const Fi + string &rest) + { + directory = kernelImage.dirName(); +- KString kernel = kernelImage.baseName(); ++ KString kernel = kernelImage.getCanonicalPath().baseName(); + + list imageNames = KernelTool::imageNames(Util::getArch()); + for (list::const_iterator it = imageNames.begin(); +@@ -470,8 +470,7 @@ Kconfig *KernelTool::retrieveKernelConfi + // at first, search for the config on disk + string dir, stripped; + +- if (KernelTool::stripImageName( +- m_kernel.getCanonicalPath(), dir, stripped)) { ++ if (KernelTool::stripImageName(m_kernel, dir, stripped)) { + FilePath config = dir; + config.appendPath("config-" + stripped); + Debug::debug()->dbg("Trying %s for config", config.c_str()); +--- a/kdumptool/findkernel.cc ++++ b/kdumptool/findkernel.cc +@@ -313,9 +313,7 @@ string FindKernel::findInitrd(const File + // use the resolved name, not the symlink to generate the initrd + FilePath dir; + string stripped; +- KernelTool::stripImageName( +- kernelPath.getCanonicalPath(), dir, stripped +- ); ++ KernelTool::stripImageName(kernelPath, dir, stripped); + + string dash; + if (stripped.size() > 0) { diff --git a/kdump.changes b/kdump.changes index 86a7456..9d2752f 100644 --- a/kdump.changes +++ b/kdump.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Nov 25 21:04:51 UTC 2021 - Petr Tesařík + +- kdump-Store-kdump-initrd-in-kernel-image-path.patch: Fix kdumprd + location for usrmerge kernels (boo#1190920). + ------------------------------------------------------------------- Fri May 28 10:33:45 UTC 2021 - Petr Tesařík diff --git a/kdump.spec b/kdump.spec index b695308..b79d886 100644 --- a/kdump.spec +++ b/kdump.spec @@ -41,6 +41,7 @@ Patch13: %{name}-do-not-iterate-past-end-of-string.patch Patch14: %{name}-fix-incorrect-exit-code-checking.patch Patch15: %{name}-avoid-endless-loop-on-EAI_AGAIN.patch Patch16: %{name}-install-real-resolv.conf.patch +Patch17: %{name}-Store-kdump-initrd-in-kernel-image-path.patch BuildRequires: asciidoc BuildRequires: cmake BuildRequires: gcc-c++ @@ -63,7 +64,9 @@ Requires: makedumpfile Requires: openssh # FIXME: use proper Requires(pre/post/preun/...) PreReq: %fillup_prereq -PreReq: /usr/bin/mkdir /usr/bin/rm /usr/bin/touch +PreReq: /usr/bin/mkdir +PreReq: /usr/bin/rm +PreReq: /usr/bin/touch Recommends: cifs-utils Recommends: nfs-client # update should detect the split-off from kexec-tools @@ -101,6 +104,7 @@ after a crash dump has occured. %patch14 -p1 %patch15 -p1 %patch16 -p1 +%patch17 -p1 %build export CXXFLAGS="%{optflags} -std=c++11"