Resolves: bz1633881
https://bugzilla.redhat.com/show_bug.cgi?id=1633881
ppc64 kernel does not follow the standard cpu hotplug convention.
Only online/offline, not add/remove message is observed during hotplug.
Under the current kexec-tools.rules, dtb will not be rebuilt to include
a new plugged in cpu's hardware id. And later, if crashing on the new
cpu, the capture kernel can not boot up on the crashed cpu due to lack of
cpu hardware id in dtb.
Workaround it by using a ppc dedicated udev rules, which uses cpu
online/offline message.
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
---
98-kexec-ppc.rules | 16 ++++++++++++++++
kexec-tools.spec | 12 +++++++++---
2 files changed, 25 insertions(+), 3 deletions(-)
create mode 100644 98-kexec-ppc.rules
diff --git a/98-kexec-ppc.rules b/98-kexec-ppc.rules
new file mode 100644
index 0000000..0555cae
--- /dev/null
+++ b/98-kexec-ppc.rules
@@ -0,0 +1,16 @@
+SUBSYSTEM=="cpu", ACTION=="online", GOTO="kdump_reload"
+SUBSYSTEM=="cpu", ACTION=="offline", GOTO="kdump_reload"
+SUBSYSTEM=="memory", ACTION=="online", GOTO="kdump_reload"
+SUBSYSTEM=="memory", ACTION=="offline",
GOTO="kdump_reload"
+
+GOTO="kdump_reload_end"
+
+LABEL="kdump_reload"
+
+# If kdump is not loaded, calling "kdumpctl reload" will end up
+# doing nothing, but it and systemd-run will always generate
+# extra logs for each call, so trigger the "kdumpctl reload"
+# only if kdump service is active to avoid unnecessary logs
+RUN+="/bin/sh -c '/usr/bin/systemctl is-active kdump.service || exit 0;
/usr/bin/systemd-run --quiet /usr/bin/kdumpctl reload'"
+
+LABEL="kdump_reload_end"
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 969785e..aab6b1e 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -16,7 +16,8 @@ Source8: kdump.conf
Source9:
http://downloads.sourceforge.net/project/makedumpfile/makedumpfile/1.6.4/...
Source10: kexec-kdump-howto.txt
Source12: mkdumprd.8
-Source14: 98-kexec.rules
+Source13: 98-kexec.rules
+Source14: 98-kexec-ppc.rules
Source15: kdump.conf.5
Source16: kdump.service
Source18: kdump.sysconfig.s390x
@@ -210,10 +211,15 @@ install -m 644 %{SOURCE25}
$RPM_BUILD_ROOT%{_mandir}/man8/kdumpctl.8
install -m 755 %{SOURCE20} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-lib.sh
install -m 755 %{SOURCE23} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-lib-initramfs.sh
%ifnarch s390x
+install -m 755 %{SOURCE29} $RPM_BUILD_ROOT%{_udevrulesdir}/../kdump-udev-throttler
+%endif
+%ifnarch s390x ppc64 ppc64le
# For s390x the ELF header is created in the kdump kernel and therefore kexec
# udev rules are not required
-install -m 644 %{SOURCE14} $RPM_BUILD_ROOT%{_udevrulesdir}/98-kexec.rules
-install -m 755 %{SOURCE29} $RPM_BUILD_ROOT%{_udevrulesdir}/../kdump-udev-throttler
+install -m 644 %{SOURCE13} $RPM_BUILD_ROOT%{_udevrulesdir}/98-kexec.rules
+%endif
+%ifarch ppc64 ppc64le
+install -m 644 %{SOURCE14} $RPM_BUILD_ROOT%{_udevrulesdir}/98-kexec-ppc.rules
%endif
install -m 644 %{SOURCE15} $RPM_BUILD_ROOT%{_mandir}/man5/kdump.conf.5
install -m 644 %{SOURCE16} $RPM_BUILD_ROOT%{_unitdir}/kdump.service
--
2.19.1