aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSourabh Jain <sourabhjain@linux.ibm.com>2019-07-30 09:48:57 +0530
committerPavel Moravec <pmoravec@redhat.com>2019-08-26 17:54:56 +0200
commitbfe2e81f4c45c4eafb96ab8136a01a5da64c116a (patch)
treeeac60689253d3b737bcb8c0e49c67ddf7913ff05
parentb31788aeeb3acdce01435dd734d46f4edc06c051 (diff)
downloadsos-bfe2e81f4c45c4eafb96ab8136a01a5da64c116a.tar.gz
[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 <sourabhjain@linux.ibm.com> Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
-rw-r--r--sos/plugins/kdump.py13
1 files changed, 13 insertions, 0 deletions
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"
])