- kdump-do-not-touch-dracut-vars-if-not-kdumprd.patch: Do not touch

any dracut variables when generating a non-kdump initrd
  (bsc#1091304).

OBS-URL: https://build.opensuse.org/package/show/Kernel:kdump/kdump?expand=0&rev=165
This commit is contained in:
Petr Tesařík 2018-05-02 11:33:40 +00:00 committed by Git OBS Bridge
parent dd914e044d
commit a4929c8e6f
3 changed files with 73 additions and 0 deletions

View File

@ -0,0 +1,64 @@
From: Petr Tesarik <ptesarik@suse.com>
Date: Wed, 2 May 2018 13:25:27 +0200
Subject: Do not touch dracut variables when generating a non-kdump initrd
References: bsc#1091304
Upstream: merged
Git-commit: a61577cfd7e92486b9fe708056e4c13e202fc21f
The kdump module's check() function is called for all dracut
invocations, i.e. even if the kdump module is not included.
Unfortunately, the check() routine modifies enough of dracut's
internal state to request bogus kdump mount points. This is
desirable for a kdump initrd but may render the system unbootable
otherwise.
Check explicitly that we're building a kdump-enabled initrd before
doing anything else.
Signed-off-by: Petr Tesarik <ptesarik@suse.com>
---
init/module-setup.sh | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
--- a/init/module-setup.sh
+++ b/init/module-setup.sh
@@ -3,6 +3,21 @@
. /lib/kdump/setup-kdump.functions
+kdump_needed() {
+ # Building a kdump initrd?
+ if [[ " $dracutmodules $add_dracutmodules $force_add_dracutmodules" == *\ $_mod\ * ]]; then
+ return 0
+ fi
+
+ # Is FADUMP active?
+ if [ "$KDUMP_FADUMP" = "yes" ]; then
+ return 0
+ fi
+
+ # Do not include kdump by default
+ return 1
+}
+
kdump_check_net() {
kdump_neednet=
for protocol in "${kdump_Protocol[@]}" ; do
@@ -98,6 +113,8 @@ check() {
# Get configuration
kdump_get_config || return 1
+ kdump_needed || return 1
+
# add mount points
if ! [[ $mount_needs ]] ; then
kdump_get_mountpoints || return 1
@@ -112,7 +129,7 @@ check() {
kdump_check_net
- return 255
+ return 0
}
depends() {

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed May 2 11:33:01 UTC 2018 - ptesarik@suse.com
- kdump-do-not-touch-dracut-vars-if-not-kdumprd.patch: Do not touch
any dracut variables when generating a non-kdump initrd
(bsc#1091304).
-------------------------------------------------------------------
Fri Apr 20 16:06:40 UTC 2018 - ptesarik@suse.com

View File

@ -98,6 +98,7 @@ Patch48: %{name}-remove-IPv6-brackets-for-getaddrinfo.patch
Patch49: %{name}-skip-IPv4-if-no-address.patch
Patch50: %{name}-additional-mounts-in-dracut-module.patch
Patch51: %{name}-run-mkinitrd-if-fadump-is-active.patch
Patch52: %{name}-do-not-touch-dracut-vars-if-not-kdumprd.patch
BuildRequires: asciidoc
BuildRequires: cmake
BuildRequires: gcc-c++
@ -211,6 +212,7 @@ cp %{S:1} tests/data/
%patch49 -p1
%patch50 -p1
%patch51 -p1
%patch52 -p1
%build
export CFLAGS="%{optflags}"