2021-11-25 21:06:05 +00:00
|
|
|
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>
|
|
|
|
|
2021-11-25 21:16:00 +00:00
|
|
|
---
|
|
|
|
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)
|
2021-11-25 21:06:05 +00:00
|
|
|
{
|
2021-11-25 21:16:00 +00:00
|
|
|
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;
|
2021-11-25 21:06:05 +00:00
|
|
|
|
2021-11-25 21:16:00 +00:00
|
|
|
- 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);
|
2021-11-25 21:06:05 +00:00
|
|
|
|
2021-11-25 21:16:00 +00:00
|
|
|
string dash;
|
|
|
|
if (stripped.size() > 0) {
|