From: Hari Bathini Subject: fadump: add udev event support for fadump References: bsc#1108170 Upstream: merged Git-commit: eb5784f6cb8368b346b9b52be66116fc5a47f720 Currently, the udev rules written in kdump package only support reloading kdump on memory/cpu hot add/remove operation. But this is needed as much for FADump as well. The rules were not updated to support fadump owing to lack of support in the kernel for re-registering FADump. This support is now added to kernel with commit 0823c68b054b ("powerpc/fadump: re-register firmware-assisted dump if already registered"). Update kdump udev rules to load fadump on memory/cpu DLPAR operations. Signed-off-by: Hari Bathini Signed-off-by: Petr Tesarik --- 70-kdump.rules.in | 3 +++ init/load.sh | 29 ++++++++++++++++------------- 2 files changed, 19 insertions(+), 13 deletions(-) --- a/70-kdump.rules.in +++ b/70-kdump.rules.in @@ -21,6 +21,9 @@ GOTO="kdump_end" # Reload only if panic kernel is already loaded LABEL="kdump_try_restart" PROGRAM="/bin/cat /sys/kernel/kexec_crash_loaded", RESULT!="0", RUN+="/lib/kdump/load-once.sh" +@if @ARCH@ ppc64 ppc64le +TEST=="/sys/kernel/fadump_registered", PROGRAM="/bin/cat /sys/kernel/fadump_registered", RESULT!="0", RUN+="/lib/kdump/load-once.sh" +@endif LABEL="kdump_end" @endif --- a/init/load.sh +++ b/init/load.sh @@ -243,21 +243,24 @@ function load_kdump_fadump() local msg local result=0 + local output - # The kernel fails with EINVAL if registered already - # (see bnc#814780) - if [ "$(cat $FADUMP_REGISTERED)" != "1" ] ; then - local output - - output=$( (echo 1 > "$FADUMP_REGISTERED") 2>&1) - if [ $? -eq 0 ] ; then - msg="Registered fadump" - else - msg="FAILED to register fadump: $output" - result=1 - fi + # Re-registering of FADump is supported in kernel (see bsc#1108170). + # So, don't bother about whether FADump was registered already + output=$( (echo 1 > "$FADUMP_REGISTERED") 2>&1) + if [ $? -eq 0 ] ; then + msg="Registered fadump" else - msg="fadump is already registered" + # For backward compatibility on older kernel that + # returns -EEXIST/-EINVAL + if [ "$(cat $FADUMP_REGISTERED)" == "1" ] ; then + # TODO: unregiser/register OR warn user to stop/start? + # Best bet is to update to latest kernel. + msg="fadump is already registered" + else + msg="FAILED to register fadump: $output" + result=1 + fi fi echo "$msg"