From bfe2e81f4c45c4eafb96ab8136a01a5da64c116a Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Tue, 30 Jul 2019 09:48:57 +0530 Subject: [kdump] collect kdump initramfs content This patch adds a command (lsinitrd) to extract the content of kdump initramfs. Resolves: #1744 Signed-off-by: Sourabh Jain Signed-off-by: Pavel Moravec --- sos/plugins/kdump.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sos/plugins/kdump.py b/sos/plugins/kdump.py index 08d3b5fa..feb222f1 100644 --- a/sos/plugins/kdump.py +++ b/sos/plugins/kdump.py @@ -6,6 +6,8 @@ # # See the LICENSE file in the source distribution for further information. +import os +import platform from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin @@ -51,6 +53,12 @@ class RedHatKDump(KDump, RedHatPlugin): def setup(self): super(RedHatKDump, self).setup() + + initramfs_img = "/boot/initramfs-" + platform.release() \ + + "kdump.img" + if os.path.exists(initramfs_img): + self.add_cmd_output("lsinitrd %s" % initramfs_img) + self.add_copy_spec([ "/etc/kdump.conf", "/etc/udev/rules.d/*kexec.rules", @@ -72,6 +80,11 @@ class DebianKDump(KDump, DebianPlugin, UbuntuPlugin): def setup(self): super(DebianKDump, self).setup() + + initramfs_img = "/var/lib/kdump/initrd.img-" + platform.release() + if os.path.exists(initramfs_img): + self.add_cmd_output("lsinitrd %s" % initramfs_img) + self.add_copy_spec([ "/etc/default/kdump-tools" ]) -- cgit