Skip to content

Commit 20c21fb

Browse files
committed
[fadump] update initrd validation check
The fadump initrd isolation feature brought a new initrd module named zz-fadumpinit in addition to kdumpbase. Now FADump initrd is considered valid if either kdumpbase or zz-fadumpinit module is present. Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
1 parent c65d2d1 commit 20c21fb

2 files changed

Lines changed: 15 additions & 10 deletions

File tree

servicereportpkg/validate/plugins/fadump.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def __init__(self):
3333
self.name = FADump.__name__
3434
self.description = FADump.__doc__
3535
self.dump_service_name = "kdump"
36-
self.dump_comp_name = "kdump"
36+
self.dump_comp_name = ["kdump", "zz-fadumpinit"]
3737
# (system mem, mem reservation needed)
3838
# (GB, MB)
3939
self.log = get_default_logger()

servicereportpkg/validate/plugins/kdump.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Dump(object):
3030

3131
def __init__(self):
3232
self.dump_service_name = ""
33-
self.dump_comp_name = ""
33+
self.dump_comp_name = []
3434
self.initial_ramdisk = ""
3535
self.log = get_default_logger()
3636
self.kernel_release = platform.release()
@@ -57,7 +57,7 @@ def check_is_dump_service_active(self):
5757
def check_dump_component_in_initrd(self):
5858
"""Dump component in initial ramdisk"""
5959

60-
status = True
60+
status = None
6161

6262
if not os.path.isfile(self.initial_ramdisk):
6363
self.log.error("Initial ramdisk not found %s",
@@ -77,14 +77,19 @@ def check_dump_component_in_initrd(self):
7777
self.dump_comp_name)
7878
status = False
7979

80-
elif self.dump_comp_name not in str(stdout):
81-
self.log.error("kdump component is missing in %s",
82-
self.initial_ramdisk)
83-
status = False
80+
elif self.dump_comp_name:
81+
for dump_comp in self.dump_comp_name:
82+
if dump_comp in str(stdout):
83+
status = True;
84+
break
8485

85-
else:
86-
self.log.debug("%s component found in %s", self.dump_comp_name,
86+
if status:
87+
self.log.debug("%s component found in %s", self.dump_comp_name,
88+
self.initial_ramdisk)
89+
else:
90+
self.log.error("kdump component is missing in %s",
8791
self.initial_ramdisk)
92+
status = False
8893

8994
return Check(self.check_dump_component_in_initrd.__doc__,
9095
status)
@@ -118,7 +123,7 @@ def __init__(self):
118123
self.name = Kdump.__name__
119124
self.description = Kdump.__doc__
120125
self.dump_service_name = "kdump"
121-
self.dump_comp_name = "kdump"
126+
self.dump_comp_name = ["kdump"]
122127
self.kdump_etc_conf = "/etc/kdump.conf"
123128
self.kdump_conf_file = "/etc/sysconfig/kdump"
124129
self.log = get_default_logger()

0 commit comments

Comments
 (0)