diff --git a/kdump-Remove-unused-KernelPath-name.patch b/kdump-Remove-unused-KernelPath-name.patch new file mode 100644 index 0000000..fecee99 --- /dev/null +++ b/kdump-Remove-unused-KernelPath-name.patch @@ -0,0 +1,72 @@ +From: Petr Tesarik +Date: Thu Nov 25 21:39:12 2021 +0100 +Subject: Remove unused KernelPath::name() and KernelPath::m_name +Upstream: merged +Git-commit: fd3168af4ba9fd139a55ade3e50b1ad0e08da746 + +This API does not have any users. Let it RIP. + +Signed-off-by: Petr Tesarik + +diff --git a/kdumptool/kernelpath.cc b/kdumptool/kernelpath.cc +index 5a87aae..fd6565f 100644 +--- a/kdumptool/kernelpath.cc ++++ b/kdumptool/kernelpath.cc +@@ -55,25 +55,19 @@ KernelPath::KernelPath(FilePath const &path) + + FilePath canonical = path.getCanonicalPath(); + m_directory = canonical.dirName(); +- m_name = canonical.baseName(); ++ KString name = canonical.baseName(); + + for (auto const pfx : imageNames(Util::getArch())) { +- if (m_name.startsWith(pfx)) { +- if (m_name.length() == pfx.length()) { +- m_name = pfx; +- break; +- } +- if (m_name[pfx.length()] == '-') { +- m_version.assign(m_name, pfx.length() + 1); +- m_name = pfx; +- break; ++ if (name.startsWith(pfx)) { ++ if (name[pfx.length()] == '-') { ++ m_version.assign(name, pfx.length() + 1); + } ++ break; + } + } + +- Debug::debug()->trace("directory=%s, name=%s, version=%s", +- m_directory.c_str(), m_name.c_str(), +- m_version.c_str()); ++ Debug::debug()->trace("directory=%s, version=%s", ++ m_directory.c_str(), m_version.c_str()); + } + + // ----------------------------------------------------------------------------- +diff --git a/kdumptool/kernelpath.h b/kdumptool/kernelpath.h +index 84cba88..332190b 100644 +--- a/kdumptool/kernelpath.h ++++ b/kdumptool/kernelpath.h +@@ -39,7 +39,6 @@ + class KernelPath { + private: + FilePath m_directory; +- KString m_name; + KString m_version; + + public: +@@ -60,12 +59,6 @@ class KernelPath { + const FilePath& directory() + { return m_directory; } + +- /** +- * @return kernel image name +- */ +- const KString& name() +- { return m_name; } +- + /** + * @return kernel version (may be empty) + */ 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..d2536f1 --- /dev/null +++ b/kdump-Store-kdump-initrd-in-kernel-image-path.patch @@ -0,0 +1,31 @@ +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 + +diff --git a/kdumptool/kernelpath.cc b/kdumptool/kernelpath.cc +index fd6565f..180e5e5 100644 +--- a/kdumptool/kernelpath.cc ++++ b/kdumptool/kernelpath.cc +@@ -53,9 +53,8 @@ KernelPath::KernelPath(FilePath const &path) + { + Debug::debug()->trace("KernelPath::KernelPath(%s)", path.c_str()); + +- FilePath canonical = path.getCanonicalPath(); +- m_directory = canonical.dirName(); +- KString name = canonical.baseName(); ++ m_directory = path.dirName(); ++ KString name = path.getCanonicalPath().baseName(); + + for (auto const pfx : imageNames(Util::getArch())) { + if (name.startsWith(pfx)) { diff --git a/kdump.changes b/kdump.changes index 86a7456..0125c1f 100644 --- a/kdump.changes +++ b/kdump.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Nov 25 21:04:51 UTC 2021 - Petr Tesařík + +- Fix kdumprd location for usrmerge kernels (boo#1190920): + * kdump-Remove-unused-KernelPath-name.patch + * kdump-Store-kdump-initrd-in-kernel-image-path.patch + ------------------------------------------------------------------- Fri May 28 10:33:45 UTC 2021 - Petr Tesařík diff --git a/kdump.spec b/kdump.spec index b695308..396e76d 100644 --- a/kdump.spec +++ b/kdump.spec @@ -41,6 +41,8 @@ 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}-Remove-unused-KernelPath-name.patch +Patch18: %{name}-Store-kdump-initrd-in-kernel-image-path.patch BuildRequires: asciidoc BuildRequires: cmake BuildRequires: gcc-c++ @@ -63,7 +65,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 +105,8 @@ after a crash dump has occured. %patch14 -p1 %patch15 -p1 %patch16 -p1 +%patch17 -p1 +%patch18 -p1 %build export CXXFLAGS="%{optflags} -std=c++11"