SHA256
1
0
forked from pool/kdump
kdump/kdump-Store-kdump-initrd-in-kernel-image-path.patch
2021-11-25 21:16:00 +00:00

55 lines
2.0 KiB
Diff

From: Petr Tesarik <ptesarik@suse.com>
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 <ptesarik@suse.com>
---
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<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;
- 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) {