From 7509c19698fc1eaf41c47a1678126ab75684e07cfae0c4987385404805e7ad11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Tesa=C5=99=C3=ADk?= Date: Mon, 30 Mar 2020 11:40:41 +0000 Subject: [PATCH] - kdump-make-sure-that-the-udev-runtime-directory-exists.patch: Make sure that the udev runtime directory exists (bsc#1164713). OBS-URL: https://build.opensuse.org/package/show/Kernel:kdump/kdump?expand=0&rev=197 --- ...at-the-udev-runtime-directory-exists.patch | 66 +++++++++++++++++++ kdump.changes | 6 ++ kdump.spec | 2 + 3 files changed, 74 insertions(+) create mode 100644 kdump-make-sure-that-the-udev-runtime-directory-exists.patch diff --git a/kdump-make-sure-that-the-udev-runtime-directory-exists.patch b/kdump-make-sure-that-the-udev-runtime-directory-exists.patch new file mode 100644 index 0000000..c35754f --- /dev/null +++ b/kdump-make-sure-that-the-udev-runtime-directory-exists.patch @@ -0,0 +1,66 @@ +From c79aa44d58ef29e22516986641970c343cb15cd0 Mon Sep 17 00:00:00 2001 +From: Petr Tesarik +Date: Tue, 25 Feb 2020 14:47:02 +0100 +Subject: Make sure that the udev runtime directory exists +References: bsc#1164713 +Upstream: merged +Git-commit: c79aa44d58ef29e22516986641970c343cb15cd0 + +Hotplug operations will not work with kdump if the udev runtime +directory does not exist at startup. + +While fixing it, move udev rules handling to load.sh / unload.sh. + +Signed-off-by: Petr Tesarik +--- + init/kdump.service | 2 -- + init/load.sh | 3 +++ + init/unload.sh | 2 ++ + 3 files changed, 5 insertions(+), 2 deletions(-) + +--- a/init/kdump.service ++++ b/init/kdump.service +@@ -5,8 +5,6 @@ After=local-fs.target network.service Ya + [Service] + Type=oneshot + ExecStart=/lib/kdump/load.sh --update +-ExecStartPost=-/usr/bin/cp /usr/lib/kdump/70-kdump.rules /run/udev/rules.d/70-kdump.rules +-ExecStopPost=-/usr/bin/rm -f /run/udev/rules.d/70-kdump.rules + ExecStop=/lib/kdump/unload.sh + RemainAfterExit=true + +--- a/init/load.sh ++++ b/init/load.sh +@@ -7,6 +7,7 @@ KDUMPTOOL=/usr/sbin/kdumptool + KEXEC=/sbin/kexec + FADUMP_ENABLED=/sys/kernel/fadump_enabled + FADUMP_REGISTERED=/sys/kernel/fadump_registered ++UDEV_RULES_DIR=/run/udev/rules.d + + # + # Remove an option from the kernel command line +@@ -324,6 +325,8 @@ result=$? + + if [ $result = 0 ] ; then + echo 1 > /proc/sys/kernel/panic_on_oops ++ mkdir -p "$UDEV_RULES_DIR" ++ cp /usr/lib/kdump/70-kdump.rules "$UDEV_RULES_DIR"/70-kdump.rules + fi + + exit $result +--- a/init/unload.sh ++++ b/init/unload.sh +@@ -6,6 +6,7 @@ + KDUMPTOOL=/usr/sbin/kdumptool + KEXEC=/sbin/kexec + FADUMP_REGISTERED=/sys/kernel/fadump_registered ++UDEV_RULES_DIR=/run/udev/rules.d + + eval $($KDUMPTOOL dump_config) + +@@ -21,4 +22,5 @@ fi + + test $? -eq 0 || exit 1 + ++rm -f "$UDEV_RULES_DIR"/70-kdump.rules + exit 0 diff --git a/kdump.changes b/kdump.changes index 050df51..63d6217 100644 --- a/kdump.changes +++ b/kdump.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Mar 30 11:40:15 UTC 2020 - Petr Tesařík + +- kdump-make-sure-that-the-udev-runtime-directory-exists.patch: + Make sure that the udev runtime directory exists (bsc#1164713). + ------------------------------------------------------------------- Mon Jan 27 16:35:50 UTC 2020 - Martin Wilck diff --git a/kdump.spec b/kdump.spec index 0895a09..134b077 100644 --- a/kdump.spec +++ b/kdump.spec @@ -67,6 +67,7 @@ Patch28: %{name}-powerpc-no-reload-on-CPU-removal.patch Patch29: %{name}-prefer-by-path-and-device-mapper.patch Patch30: %{name}-calibrate-Update-values.patch Patch31: %{name}-activate-udev-rules-late-during-boot.patch +Patch32: %{name}-make-sure-that-the-udev-runtime-directory-exists.patch BuildRequires: asciidoc BuildRequires: cmake BuildRequires: gcc-c++ @@ -156,6 +157,7 @@ after a crash dump has occured. %patch29 -p1 %patch30 -p1 %patch31 -p1 +%patch32 -p1 %build export CFLAGS="%{optflags}"