- kdump-Store-kdump-initrd-in-kernel-image-path.patch: Fix kdumprd

location for usrmerge kernels (boo#1190920).

OBS-URL: https://build.opensuse.org/package/show/Kernel:kdump/kdump?expand=0&rev=214
This commit is contained in:
Petr Tesařík 2021-11-25 21:16:00 +00:00 committed by Git OBS Bridge
parent eef96e5dbf
commit 0d7b1fc32d
4 changed files with 39 additions and 91 deletions

View File

@ -1,72 +0,0 @@
From: Petr Tesarik <ptesarik@suse.com>
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 <ptesarik@suse.com>
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)
*/

View File

@ -13,19 +13,42 @@ Canonical path is still used to get the kernel version.
References: boo#1190920
Signed-off-by: Petr Tesarik <ptesarik@suse.com>
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)
---
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)
{
Debug::debug()->trace("KernelPath::KernelPath(%s)", path.c_str());
directory = kernelImage.dirName();
- KString kernel = kernelImage.baseName();
+ KString kernel = kernelImage.getCanonicalPath().baseName();
- FilePath canonical = path.getCanonicalPath();
- m_directory = canonical.dirName();
- KString name = canonical.baseName();
+ m_directory = path.dirName();
+ KString name = path.getCanonicalPath().baseName();
list<string> imageNames = KernelTool::imageNames(Util::getArch());
for (list<string>::const_iterator it = imageNames.begin();
@@ -470,8 +470,7 @@ Kconfig *KernelTool::retrieveKernelConfi
// at first, search for the config on disk
string dir, stripped;
for (auto const pfx : imageNames(Util::getArch())) {
if (name.startsWith(pfx)) {
- 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) {

View File

@ -1,9 +1,8 @@
-------------------------------------------------------------------
Thu Nov 25 21:04:51 UTC 2021 - Petr Tesařík <ptesarik@suse.com>
- Fix kdumprd location for usrmerge kernels (boo#1190920):
* kdump-Remove-unused-KernelPath-name.patch
* kdump-Store-kdump-initrd-in-kernel-image-path.patch
- 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 <ptesarik@suse.com>

View File

@ -41,8 +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}-Remove-unused-KernelPath-name.patch
Patch18: %{name}-Store-kdump-initrd-in-kernel-image-path.patch
Patch17: %{name}-Store-kdump-initrd-in-kernel-image-path.patch
BuildRequires: asciidoc
BuildRequires: cmake
BuildRequires: gcc-c++
@ -106,7 +105,6 @@ after a crash dump has occured.
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%build
export CXXFLAGS="%{optflags} -std=c++11"