[PATCH v2] kdumpctl: Print warning in case the raw device is formatted and contains filesystem.
by Kenneth Dsouza
From: Kenneth D'souza <kdsouza(a)redhat.com>
Changes since v1: Added warning instead of error.
Currently the kdumpctl script doesn't check if the raw device is
formatted which might destroy existing data at the time of dump
capture.
This patch addresses this issue, by ensuring kdumpctl prints
a warning in case it finds the raw device to be formatted.
Signed-off-by: Kenneth D'souza <kdsouza(a)redhat.com>
---
kdumpctl | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/kdumpctl b/kdumpctl
index 6a01c13..201586c 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -779,6 +779,11 @@ save_raw()
echo "raw partition $raw_target not found"
return 1
}
+ check_fs=$(lsblk --nodeps -npo FSTYPE $raw_target)
+ if [[ $(echo $check_fs | wc -w) -ne 0 ]]; then
+ echo "Warning: Detected '$check_fs' signature on $raw_target, data loss is expected."
+ return 0
+ fi
kdump_dir=`grep ^path $KDUMP_CONFIG_FILE | cut -d' ' -f2-`
if [ -z "${kdump_dir}" ]; then
coredir="/var/crash/`date +"%Y-%m-%d-%H:%M"`"
--
2.14.3
4 years, 7 months
[PATCH] Add 'nfs4' to the list of deprecated kdump configuration options.
by Raghavendra Rao
Rather than calling out 'nfs4' as an invalid config option within
kdump.conf, it would be ideal to label it as "deprecated" as its no
longer used. This is because nfs shares are expected to be mounted
beforehand hence no special care needs to taken with respect to NFS
versions.
Only when opting for dracut_args, one can specify the NFS version
explicitly.
Signed-off-by: Raghavendra Rao <ragrao(a)redhat.com>
---
kdumpctl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl
index 6a01c13..b81df9a 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -229,7 +229,7 @@ check_config()
return 1;
}
;;
- net|options|link_delay|disk_timeout|debug_mem_level|blacklist)
+ net|nfs4|options|link_delay|disk_timeout|debug_mem_level|blacklist)
echo "Deprecated kdump config option: $config_opt. Refer to kdump.conf manpage for alternatives."
return 1
;;
--
1.8.3.1
4 years, 8 months
[PATCH] kexec: fix for "Unhandled rela relocation: R_X86_64_PLT32" error
by Bhupesh Sharma
Resolves: bz1619122
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1619122
This patch fixes the "Unhandled rela relocation: R_X86_64_PLT32" error
that we are seeing with Fedora 29 (and newer kernels > 4.18) which
trying to run kexec/kdump on x86_64 machines.
The patch is being discussed upstream and has been ACK'ed by Baoquan and
myself (see <https://www.spinics.net/lists/kexec/msg21255.html>) and I
have also tested the same on Fedora 29/rawhide x86_64 machine as well:
Before the patch:
----------------
[root@hp-bl480c-01 ~]# kdumpctl restart
kexec: unloaded kdump kernel
Stopping kdump: [OK]
Unhandled rela relocation: R_X86_64_PLT32
kexec: failed to load kdump kernel
Starting kdump: [FAILED]
After the patch:
---------------
[root@hp-bl480c-01 ~]# kdumpctl restart
kexec: unloaded kdump kernel
Stopping kdump: [OK]
kexec: loaded kdump kernel
Starting kdump: [OK]
Suggested Upstream Fix:
In response to a change in binutils, commit b21ebf2fb4c
(x86: Treat R_X86_64_PLT32 as R_X86_64_PC32) was applied to
the linux kernel during the 4.16 development cycle and has
since been backported to earlier stable kernel series. The
change results in the failure message in $SUBJECT when
rebooting via kexec.
Fix this by replicating the change in kexec.
Signed-off-by: Chris Clayton <chris2553(a)googlemail.com>
Signed-off-by: Bhupesh Sharma <bhsharma(a)redhat.com>
---
...or-Unhandled-rela-relocation-R_X86_64_PLT.patch | 37 ++++++++++++++++++++++
kexec-tools.spec | 3 ++
2 files changed, 40 insertions(+)
create mode 100644 kexec-tools-2.0.17-kexec-fix-for-Unhandled-rela-relocation-R_X86_64_PLT.patch
diff --git a/kexec-tools-2.0.17-kexec-fix-for-Unhandled-rela-relocation-R_X86_64_PLT.patch b/kexec-tools-2.0.17-kexec-fix-for-Unhandled-rela-relocation-R_X86_64_PLT.patch
new file mode 100644
index 000000000000..ace1ea935a0e
--- /dev/null
+++ b/kexec-tools-2.0.17-kexec-fix-for-Unhandled-rela-relocation-R_X86_64_PLT.patch
@@ -0,0 +1,37 @@
+From 35a2fb50293da9fbd94f29a2ed6a4f114fd8044f Mon Sep 17 00:00:00 2001
+From: Bhupesh Sharma <bhsharma(a)redhat.com>
+Date: Tue, 21 Aug 2018 16:22:31 +0530
+Subject: [PATCH] kexec: fix for "Unhandled rela relocation: R_X86_64_PLT32"
+ error
+
+In response to a change in binutils, commit b21ebf2fb4c
+(x86: Treat R_X86_64_PLT32 as R_X86_64_PC32) was applied to
+the linux kernel during the 4.16 development cycle and has
+since been backported to earlier stable kernel series. The
+change results in the failure message in $SUBJECT when
+rebooting via kexec.
+
+Fix this by replicating the change in kexec.
+
+Signed-off-by: Chris Clayton <chris2553(a)googlemail.com>
+---
+ kexec/arch/x86_64/kexec-elf-rel-x86_64.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/kexec/arch/x86_64/kexec-elf-rel-x86_64.c b/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
+index 7fdde73a5eca..af33689a7d43 100644
+--- a/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
++++ b/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
+@@ -78,7 +78,8 @@ void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr),
+ if ((int64_t)value != *(int32_t *)location)
+ goto overflow;
+ break;
+- case R_X86_64_PC32:
++ case R_X86_64_PC32:
++ case R_X86_64_PLT32:
+ *(uint32_t *)location = value - address;
+ break;
+ default:
+--
+2.7.4
+
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 7f27bd40d963..38d46b58e584 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -71,6 +71,7 @@ Obsoletes: diskdumputils netdump kexec-tools-eppic
#
# Patches 101 through 200 are meant for x86_64 kexec-tools enablement
#
+Patch101: kexec-tools-2.0.17-kexec-fix-for-Unhandled-rela-relocation-R_X86_64_PLT.patch
#
# Patches 301 through 400 are meant for ppc64 kexec-tools enablement
@@ -101,6 +102,8 @@ mkdir -p -m755 kcp
tar -z -x -v -f %{SOURCE9}
tar -z -x -v -f %{SOURCE19}
+%patch101 -p1
+
%ifarch ppc
%define archdef ARCH=ppc
%endif
--
2.7.4
4 years, 9 months
[PATCH] [RFE] kdump-config cmdline tool to display and manipulate configuration information.
by Kenneth Dsouza
From: Kenneth D'souza <kdsouza(a)redhat.com>
A cmdline tool to edit and retrieve information from /etc/kdump.conf.
This tool will avoid typos and have basic sanity check for options.
Signed-off-by: Kenneth D'souza <kdsouza(a)redhat.com>
---
kdump-config.py | 281 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 281 insertions(+)
create mode 100755 kdump-config.py
diff --git a/kdump-config.py b/kdump-config.py
new file mode 100755
index 0000000..07b3201
--- /dev/null
+++ b/kdump-config.py
@@ -0,0 +1,281 @@
+#!/usr/bin/python
+# kdump-config.py - cmdline tool to display and manipulate configuration information of /etc/kdump.conf
+# Author: Kenneth D'souza <kdsouza(a)redhat.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+import sys
+import os
+import stat
+import argparse
+import subprocess
+
+CONFIG_FILE = "/etc/kdump.conf"
+
+
+# Filter comments and optional settings.
+def filter_data(data):
+ comments = []
+ data_without_comments = []
+ for line in data:
+ line = line.strip()
+ if line.startswith('#'):
+ comments.append(line)
+ else:
+ data_without_comments.append(line)
+ return comments, data_without_comments
+
+
+# Get only unique data, avoids duplicate.
+def unique(data_without_comments, option):
+ unique_data = set()
+ for line in data_without_comments:
+ if len(line.split()) > 1:
+ if line.startswith(
+ ("path", "core_collector", "raw", "nfs", "ssh", "kdump_post",
+ "kdump_pre", "extra_bins", "extra_modules", "sshkey",
+ "default", "debug_mem_level", "force_rebuild",
+ "force_no_rebuild", "dracut_args", "fence_kdump_args",
+ "fence_kdump_nodes", "ext2", "ext3", "ext4", "btfs", "minix",
+ "xfs")):
+ if line not in unique_data and not line.startswith(option + ' '):
+ if option == "ssh":
+ if not line.startswith(
+ ("nfs", "raw", "ext4", "ext3", "ext2",
+ "xfs", "btrfs", "minix")):
+ unique_data.add(line)
+ elif option == "nfs":
+ if not line.startswith(
+ ("ssh", "raw", "ext4", "ext3", "ext2", "xfs",
+ "btrfs", "minix")):
+ unique_data.add(line)
+ elif option == "raw":
+ if not line.startswith(
+ ("nfs", "ssh", "ext4", "ext3", "ext2", "xfs",
+ "btrfs", "minix")):
+ unique_data.add(line)
+ elif option in ("ext2", "ext3", "ext4", "xfs", "btrfs",
+ "minix"):
+ if not line.startswith(("ssh", "nfs", "raw")):
+ unique_data.add(line)
+ else:
+ unique_data.add(line)
+ return unique_data
+
+
+# We cannot have both the options set to be 1.
+def check_for_mutual_exculsive(unique_data):
+ for line in unique_data:
+ if line.startswith("force_no_rebuild") or line.startswith(
+ "force_rebuild"):
+ optional = line.split()[1]
+ if optional == value == "1":
+ print("force_no_rebuild and force_rebuild cannot be 1 at the same time.")
+ return True
+ return False
+
+
+# Check if ssh server is set, if not give warning.
+def checks_for_ssh(unique_data):
+ for line in unique_data:
+ if line.find("ssh") != -1:
+ return True
+ return False
+
+
+# Write changes to the file with comments, unique data and optional
+# settings given by the user.
+def replace_value_write(comments, unique_data, option, value, unset_value):
+ try:
+ with open(CONFIG_FILE, "r+") as f:
+ f.seek(0)
+ f.truncate()
+ for item in comments:
+ f.write("%s\n" % item)
+ for i in range(len(unique_data)):
+ f.write("%s\n" % unique_data[i])
+ if not unset_value:
+ append_txt = ("%s %s\n" % (option, value))
+ f.write("%s" % append_txt)
+ f.close()
+ except IOError as reason:
+ print("You need to have root privileges to run this option.")
+ print("%s" % reason)
+
+
+# Read the file only once and save the data.
+def check(CONFIG_FILE, option, value, unset_value):
+ with open(CONFIG_FILE, "r") as f1:
+ data = f1.readlines()
+ comments, data_without_comments = filter_data(data)
+ unique_data = list(unique(data_without_comments, option))
+ unique_data = list(filter(None, unique_data))
+ if option == "force_no_rebuild" or option == "force_rebuild" and value == "1":
+ result = check_for_mutual_exculsive(unique_data)
+ if result:
+ sys.exit(1)
+ if option == "sshkey":
+ result_ssh = checks_for_ssh(unique_data)
+ if not result_ssh:
+ print("Warning: Remember to add an entry for ssh")
+ replace_value_write(comments, unique_data, option, value, unset_value)
+ f1.close()
+
+
+# Check if the device is valid, check the option passed and work accordingly:
+def check_device(option, value):
+ try:
+ if not stat.S_ISBLK(os.lstat(value).st_mode):
+ print("not a valid device '%s'" % value)
+ elif option == "raw":
+ check(CONFIG_FILE, option, args.raw, False)
+ else:
+ cmd = subprocess.Popen(
+ "lsblk --nodeps -p -n -o FSTYPE,UUID %s " % (value),
+ stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT,
+ shell=True)
+ option = cmd.communicate()[0].strip().decode()
+ fstype, UUID = option.split()
+ if fstype in ("ext2", "ext3", "ext4", "xfs", "btrfs", "minix"):
+ check(CONFIG_FILE, fstype, "UUID=" + UUID, False)
+ else:
+ print("Filesystem '%s' not supported." % fstype)
+ except ValueError:
+ print("'%s' does not contain a valid Filesystem." % value)
+ except Exception:
+ print("not a valid device '%s'" % value)
+
+
+# Check if dump target is mounted:
+def check_mnt(nfs_mount):
+ cmd = subprocess.Popen(
+ "findmnt -t nfs,nfs4 %s -o SOURCE -n " % (nfs_mount),
+ stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT,
+ shell=True)
+ option = cmd.communicate()[0].strip().decode()
+ if not option.strip():
+ print("Error: Dump target '%s' is probably not mounted or valid" %
+ nfs_mount)
+ else:
+ check(CONFIG_FILE, "nfs", option, False)
+
+
+# Display configuration settings from /etc/kdump.conf:
+def display_show_config(data_without_comments):
+ for item in data_without_comments:
+ print(item)
+
+
+# Check if kdump config file exists.
+try:
+ lines = open(CONFIG_FILE).readlines()
+except IOError as reason:
+ print("Error reading kdump configuration.")
+ exit("%s" % reason)
+
+# Check if no arguments are given.
+if len(sys.argv) < 2:
+ exit("Please specify an action to perform. \nTry `kdump-config --help' for more information.")
+
+parser = argparse.ArgumentParser(
+ description="Please specify an action to perform,")
+parser.add_argument(
+ "--path",
+ help="path represents the file system path in which vmcore will be saved.")
+parser.add_argument("--raw", help=" specify raw device ex: /dev/sdc1")
+parser.add_argument(
+ "--nfs", help="specify nfs-server ex: my.server.com:/export/tmp")
+parser.add_argument("--ssh", help="specify ssh server ex: user(a)my.server.com")
+parser.add_argument(
+ "--sshkey", help="specify the path of the ssh key to use when dumping.")
+parser.add_argument(
+ "--showconfig", action="store_true", help="show configuration settings.")
+parser.add_argument(
+ "--local_fs", help="specify local device ex: /dev/myvg/mylv")
+parser.add_argument("--unset", help="unset a given option ex: path")
+parser.add_argument(
+ "--force_no_rebuild",
+ choices=["1", "0"],
+ help="specify 1 to bypass rebuilding of kdump initrd.")
+parser.add_argument(
+ "--force_rebuild",
+ choices=["1", "0"],
+ help="specify 1 to force rebuilding kdump initrd every time when kdump service starts.")
+parser.add_argument(
+ "--default",
+ choices=["reboot", "halt", "poweroff", "shell", "dump_to_rootfs"],
+ help="Action to perform in case dumping to the intended target fails.")
+
+args = parser.parse_args()
+
+if args.default:
+ option = "default"
+ value = args.default
+ check(CONFIG_FILE, option, value, False)
+
+if args.path:
+ option = "path"
+ value = args.path
+ check(CONFIG_FILE, option, value, False)
+
+if args.showconfig:
+ with open(CONFIG_FILE, "r") as f2:
+ data = f2.readlines()
+ comments, data_without_comments = filter_data(data)
+ display_show_config(data_without_comments)
+
+if args.raw:
+ option = "raw"
+ device = os.path.realpath(args.raw)
+ check_device(option, device)
+
+if args.force_rebuild:
+ option = "force_rebuild"
+ value = args.force_rebuild
+ check(CONFIG_FILE, option, value, False)
+
+if args.force_no_rebuild:
+ option = "force_no_rebuild"
+ value = args.force_no_rebuild
+ check(CONFIG_FILE, option, value, False)
+
+if args.nfs:
+ option = "nfs"
+ value = args.nfs
+ check_mnt(value)
+
+if args.ssh:
+ option = "ssh"
+ value = args.ssh
+ check(CONFIG_FILE, option, value, False)
+
+if args.sshkey:
+ if not os.path.isfile(args.sshkey):
+ exit("Invalid file '%s'" % args.sshkey)
+ option = "sshkey"
+ value = args.sshkey
+ check(CONFIG_FILE, option, value, False)
+
+if args.local_fs:
+ device = os.path.realpath(args.local_fs)
+ option = "local"
+ check_device(option, device)
+
+if args.unset:
+ option = args.unset
+ value = ""
+ check(CONFIG_FILE, option, value, True)
--
2.14.3
4 years, 9 months
[PATCH] kdumpctl: Error out in case the raw device is formatted and contains filesystem.
by Kenneth Dsouza
From: Kenneth D'souza <kdsouza(a)redhat.com>
Currently the kdumpctl script doesn't check if the raw device is
formatted which might destroy existing data at the time of dump
capture.
This patch addresses this issue, by ensuring that the kdumpctl
errors out in case it finds the raw device to be formatted.
Signed-off-by: Kenneth D'souza <kdsouza(a)redhat.com>
---
kdumpctl | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/kdumpctl b/kdumpctl
index 6a01c13..bb4e576 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -779,6 +779,11 @@ save_raw()
echo "raw partition $raw_target not found"
return 1
}
+ check_fs=$(lsblk --nodeps -npo FSTYPE $raw_target)
+ if [[ $(echo $check_fs | wc -w) -ne 0 ]]; then
+ echo "Detected $check_fs signature on $raw_target"
+ return 1
+ fi
kdump_dir=`grep ^path $KDUMP_CONFIG_FILE | cut -d' ' -f2-`
if [ -z "${kdump_dir}" ]; then
coredir="/var/crash/`date +"%Y-%m-%d-%H:%M"`"
--
2.14.3
4 years, 9 months
[PATCH] kdumpctl: Error out if path is set more than once.
by Kenneth Dsouza
From: Kenneth D'souza <kdsouza(a)redhat.com>
Currently the kdumpctl script doesn't check if the path option is
set more than once due to which a vmcore is not captured.
This patch addresses this issue by ensuring that only one path
is specified in /etc/kdump.conf file.
Signed-off-by: Kenneth D'souza <kdsouza(a)redhat.com>
---
kdumpctl | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/kdumpctl b/kdumpctl
index 6a01c13..e07ec06 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -204,6 +204,13 @@ check_config()
return 1
}
+ # Check if path option is set more than once.
+ nr=$(awk 'BEGIN{cnt=0} /^path /{cnt++} END{print cnt}' $KDUMP_CONFIG_FILE)
+ [ $nr -gt 1 ] && {
+ echo "Mutiple paths specifed in $KDUMP_CONFIG_FILE"
+ return 1
+ }
+
nr=$(grep "^dracut_args .*\-\-mount" $KDUMP_CONFIG_FILE | grep -o "\-\-mount" | wc -l)
[ $nr -gt 1 ] && {
echo "Multiple mount targets specified in one \"dracut_args\"."
--
2.14.3
4 years, 9 months
[PATCH v2] Always drop nofail or nobootwait options
by Kairui Song
If nofail or nobootwait option is used, systemd's local-fs.target won't
wait for the mounting to complete, and kdump might start before the
required mount point is ready and then fail.
The host might use nofail for reasons like the device may get unpluged,
and if the device is not mounted and it is set as kdump target as the same
time then kdump service won't start, we will never enter the capture
kernel. By the time we have entered the capture kernel, the target device
must exist and ready to use, or else kdump would fail anyway. So force
remove nofail and nobootwait option.
Also drop rootflags=nofail option, as we don't depend on rootfs anymore
if the dump target don't required it. So the nofail option is no longer
needed.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
---
kdump.sysconfig.i386 | 2 +-
kdump.sysconfig.ppc64 | 2 +-
kdump.sysconfig.ppc64le | 2 +-
kdump.sysconfig.s390x | 2 +-
kdump.sysconfig.x86_64 | 2 +-
mkdumprd | 3 +++
6 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/kdump.sysconfig.i386 b/kdump.sysconfig.i386
index 18c407e..b5ec653 100644
--- a/kdump.sysconfig.i386
+++ b/kdump.sysconfig.i386
@@ -21,7 +21,7 @@ KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet"
# This variable lets us append arguments to the current kdump commandline
# after processed by KDUMP_COMMANDLINE_REMOVE
-KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices numa=off udev.children-max=2 panic=10 rootflags=nofail transparent_hugepage=never"
+KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices numa=off udev.children-max=2 panic=10 transparent_hugepage=never"
# Any additional kexec arguments required. In most situations, this should
# be left empty
diff --git a/kdump.sysconfig.ppc64 b/kdump.sysconfig.ppc64
index 55a01cc..e142c6e 100644
--- a/kdump.sysconfig.ppc64
+++ b/kdump.sysconfig.ppc64
@@ -21,7 +21,7 @@ KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet"
# This variable lets us append arguments to the current kdump commandline
# after processed by KDUMP_COMMANDLINE_REMOVE
-KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_disable=memory numa=off udev.children-max=2 ehea.use_mcs=0 panic=10 rootflags=nofail kvm_cma_resv_ratio=0 transparent_hugepage=never"
+KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_disable=memory numa=off udev.children-max=2 ehea.use_mcs=0 panic=10 kvm_cma_resv_ratio=0 transparent_hugepage=never"
# Any additional kexec arguments required. In most situations, this should
# be left empty
diff --git a/kdump.sysconfig.ppc64le b/kdump.sysconfig.ppc64le
index 55a01cc..e142c6e 100644
--- a/kdump.sysconfig.ppc64le
+++ b/kdump.sysconfig.ppc64le
@@ -21,7 +21,7 @@ KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet"
# This variable lets us append arguments to the current kdump commandline
# after processed by KDUMP_COMMANDLINE_REMOVE
-KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_disable=memory numa=off udev.children-max=2 ehea.use_mcs=0 panic=10 rootflags=nofail kvm_cma_resv_ratio=0 transparent_hugepage=never"
+KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_disable=memory numa=off udev.children-max=2 ehea.use_mcs=0 panic=10 kvm_cma_resv_ratio=0 transparent_hugepage=never"
# Any additional kexec arguments required. In most situations, this should
# be left empty
diff --git a/kdump.sysconfig.s390x b/kdump.sysconfig.s390x
index b3aec3c..6edc2fa 100644
--- a/kdump.sysconfig.s390x
+++ b/kdump.sysconfig.s390x
@@ -21,7 +21,7 @@ KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet"
# This variable lets us append arguments to the current kdump commandline
# after processed by KDUMP_COMMANDLINE_REMOVE
-KDUMP_COMMANDLINE_APPEND="nr_cpus=1 cgroup_disable=memory numa=off udev.children-max=2 panic=10 rootflags=nofail transparent_hugepage=never"
+KDUMP_COMMANDLINE_APPEND="nr_cpus=1 cgroup_disable=memory numa=off udev.children-max=2 panic=10 transparent_hugepage=never"
# Any additional /sbin/mkdumprd arguments required.
MKDUMPRD_ARGS=""
diff --git a/kdump.sysconfig.x86_64 b/kdump.sysconfig.x86_64
index f269d02..4a5ec1c 100644
--- a/kdump.sysconfig.x86_64
+++ b/kdump.sysconfig.x86_64
@@ -21,7 +21,7 @@ KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet"
# This variable lets us append arguments to the current kdump commandline
# after processed by KDUMP_COMMANDLINE_REMOVE
-KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices cgroup_disable=memory mce=off numa=off udev.children-max=2 panic=10 rootflags=nofail acpi_no_memhotplug transparent_hugepage=never nokaslr"
+KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices cgroup_disable=memory mce=off numa=off udev.children-max=2 panic=10 acpi_no_memhotplug transparent_hugepage=never nokaslr"
# Any additional kexec arguments required. In most situations, this should
# be left empty
diff --git a/mkdumprd b/mkdumprd
index 3d89a80..078f988 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -104,6 +104,9 @@ to_mount() {
_options=$(echo $_options | sed 's/\bnoauto\b//')
#mount fs target as rw in 2nd kernel
_options=$(echo $_options | sed 's/\bro\b/rw/')
+ # drop nofail or nobootwait
+ _options=$(echo $_options | sed 's/\bnofail\b//')
+ _options=$(echo $_options | sed 's/\bnobootwait\b//')
_mntopts="$_target $_fstype $_options"
#for non-nfs _dev converting to use udev persistent name
--
2.17.1
4 years, 9 months
[PATCH] mkdumprd: force drop nofail or nobootwait option in fstab
by Kairui Song
If nofail or nobootwait option is used, systemd's local-fs.target won't
wait for the mounting to complete, and kdump might start before the
required mount point is ready and then fail.
The host might use nofail for reasons like the device may get unpluged,
and if the device is not mounted and it is set as kdump target as the same
time then kdump service won't start, we will never enter the capture
kernel. By the time we have entered the capture kernel, the target device
must exist and ready to use, or else kdump would fail anyway. So force
remove nofail and nobootwait option.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
---
mkdumprd | 3 +++
1 file changed, 3 insertions(+)
diff --git a/mkdumprd b/mkdumprd
index 3d89a80..078f988 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -104,6 +104,9 @@ to_mount() {
_options=$(echo $_options | sed 's/\bnoauto\b//')
#mount fs target as rw in 2nd kernel
_options=$(echo $_options | sed 's/\bro\b/rw/')
+ # drop nofail or nobootwait
+ _options=$(echo $_options | sed 's/\bnofail\b//')
+ _options=$(echo $_options | sed 's/\bnobootwait\b//')
_mntopts="$_target $_fstype $_options"
#for non-nfs _dev converting to use udev persistent name
--
2.17.1
4 years, 9 months
[PATCH] kdumpctl: Add path option in multi dump target checking.
by Kenneth Dsouza
From: Kenneth D'souza <kdsouza(a)redhat.com>
Currently the kdumpctl script doesn't check if the path option is
set more than once due to which a vmcore is not captured.
This patch addresses this issue by ensuring that only one path
is specified in /etc/kdump.conf file.
Signed-off-by: Kenneth D'souza <kdsouza(a)redhat.com>
---
kdumpctl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl
index 6a01c13..e465daf 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -198,7 +198,7 @@ check_config()
{
local nr
- nr=$(awk 'BEGIN{cnt=0} /^raw|^ssh[[:blank:]]|^nfs|^ext[234]|^xfs|^btrfs|^minix|^dracut_args .*\-\-mount/{cnt++} END{print cnt}' $KDUMP_CONFIG_FILE)
+ nr=$(awk 'BEGIN{cnt=0} /^raw|^ssh[[:blank:]]|^nfs|^ext[234]|^xfs|^btrfs|^minix|^path|^dracut_args .*\-\-mount/{cnt++} END{print cnt}' $KDUMP_CONFIG_FILE)
[ $nr -gt 1 ] && {
echo "More than one dump targets specified."
return 1
--
2.14.3
4 years, 9 months
[PATCH] dracut-module-setup: Fix DRM module inclusion test for hyper-v
by Kairui Song
We test if to include the drm module or not by testing if there are any
drm entry in sysfs. But there is an exception for hyper-v, DRM module
take care of hyperv's framebuffer driver as well but hyperv_fb will
not create any drm entry. So currently we got black screen on
hyperv guest.
Fix by detect hyperv's special entry as well.
---
dracut-module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index d1f9f5f..a10244b 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -20,7 +20,7 @@ check() {
depends() {
local _dep="base shutdown"
- if [ -n "$( find /sys/devices -name drm )" ]; then
+ if [ -n "$( find /sys/devices -name drm )" ] || [ -d /sys/module/hyperv_fb ]; then
_dep="$_dep drm"
fi
--
2.17.1
4 years, 9 months