[PATCH RFC] module-setup.sh: install usb serial driver for ttyUSB0
by Dave Young
In case one want to use usb serial console, we need to pack the usb serial
driver into kdump initramfs so that one can see the console output on the usb
console.
I only handled ttyUSB0, this is like a hard code, but it should be enough for
most cases. Also only install the driver for the ttyUSB0 device.
Tested with adding "console=ttyUSB0" in 2nd kernel commandline.
Tested latest F22 kernel, there's CONFIG_USB_SERIAL_CONSOLE=y, kdump work ok.
Signed-off-by: Dave Young <dyoung(a)redhat.com>
---
dracut-module-setup.sh | 8 ++++++++
1 file changed, 8 insertions(+)
--- kexec-tools.orig/dracut-module-setup.sh
+++ kexec-tools/dracut-module-setup.sh
@@ -626,4 +626,12 @@ installkernel() {
[ "$wdt" = "iTCO_wdt" ] && instmods lpc_ich
instmods $wdt
fi
+
+ if [ -c /dev/ttyUSB0 ]; then
+ _majmin=$(get_maj_min /dev/ttyUSB0)
+
+ _driver=$(readlink /sys/dev/char/$_majmin/device/driver)
+ _driver=$(basename $_driver)
+ instmods $_driver
+ fi
}
7 years, 3 months
[PATCH V4] use "systemctl reboot -f" for reboot action
by Dave Young
In latest rawhide kdump kernel reboot hangs because systemd reports a
conflict when kdump calls reboot during booting. Need further investigation
about the new systemd behavior.
Here is the error message copied from kdump session:
[snip]
kdump: saving vmcore complete
Failed to start reboot.target: Transaction contains conflicting jobs 'stop' and 'start' for shutdown.target. Probably contradicting requirement dependencies configured.
Failed to talk to init daemon.
[FAILED] Failed to start Kdump Vmcore Save Service.
[snip]
We previouly use "reboot -f" but later we changed to reboot because we want
systemd to take care of the shutdown path, mainly for umount filesystems.
Change back to "reboot -f" works but we still need umount by ourselves.
During my tests with "reboot -f" I get below dirty ext2 filesystem:
[root@localhost ~]# fsck /dev/vdb
fsck from util-linux 2.27
e2fsck 1.42.13 (17-May-2015)
/dev/vdb was not cleanly unmounted, check forced.
Actually "reboot -f" equals to "systemctl reboot -f -f"
systemctl manpage says "-f" and "-f -f" means different behavior:
When use -f with reboot, will execute reboot without shutting down all units.
However all processes will be killed forcibly and all file systems are
unmounted or remounted read-only. If -f is specified twice, will reboot
immediately without terminating any processes or unmounting any file systems.
Thus change to use "systemctl reboot -f" for our reboot actions. It can fix
the problem and at the same time it can ensure filesystems are umounted before
rebooting.
OTOH, a systemd changes cause the breakage, it may be a system service new
design, Later I can dig into systemd changes see which commit cause the
breakage.
Signed-off-by: Dave Young <dyoung(a)redhat.com
Signed-off-by: Dangyi Liu <dliu(a)redhat.com>
Acked-by: Baoquan He <bhe(a)redhat.com>
---
The copied systemd log is over 80 character's line limit, but let's keep it as is.
kdump-lib-initramfs.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- kexec-tools.orig/kdump-lib-initramfs.sh
+++ kexec-tools/kdump-lib-initramfs.sh
@@ -6,14 +6,14 @@ KDUMP_PATH="/var/crash"
CORE_COLLECTOR=""
DEFAULT_CORE_COLLECTOR="makedumpfile -l --message-level 1 -d 31"
DMESG_COLLECTOR="/sbin/vmcore-dmesg"
-DEFAULT_ACTION="reboot"
+DEFAULT_ACTION="systemctl reboot -f"
DATEDIR=`date +%Y-%m-%d-%T`
HOST_IP='127.0.0.1'
DUMP_INSTRUCTION=""
SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
KDUMP_SCRIPT_DIR="/kdumpscripts"
DD_BLKSIZE=512
-FINAL_ACTION="reboot"
+FINAL_ACTION="systemctl reboot -f"
KDUMP_CONF="/etc/kdump.conf"
KDUMP_PRE=""
KDUMP_POST=""
@@ -57,7 +57,7 @@ get_kdump_confs()
DEFAULT_ACTION="kdump_emergency_shell"
;;
reboot)
- DEFAULT_ACTION="reboot"
+ DEFAULT_ACTION="systemctl reboot -f"
;;
halt)
DEFAULT_ACTION="halt"
7 years, 9 months
[PATCH v3] use "systemctl reboot -f" as reboot action
by Dave Young
In latest rawhide kdump kernel reboot hangs because systemd reports a
conflict when kdump calls reboot during booting because it tries to stop
services while they are starting up.
We previouly use "reboot -f" but later we changed to reboot because we want
systemd to take care of the shutdown path, mainly for umount filesystems.
Change back to "reboot -f" works but we still need umount by ourselves.
During my tests with "reboot -f" I get below dirty ext2 filesystem:
[root@localhost ~]# fsck /dev/vdb
fsck from util-linux 2.27
e2fsck 1.42.13 (17-May-2015)
/dev/vdb was not cleanly unmounted, check forced.
Actually "reboot -f" equals to "systemctl reboot -f -f"
systemctl manpage says "-f" and "-f -f" means different behavior:
When use -f with reboot, will execute reboot without shutting down all units.
However all processes will be killed forcibly and all file systems are
unmounted or remounted read-only. If -f is specified twice, will reboot
immediately without terminating any processes or unmounting any file systems.
Thus change to use "systemctl reboot -f" for our reboot actions. It can fix
the problem and at the same time it can ensure filesystems are umounted before
rebooting.
OTOH, a systemd changes cause the breakage, it may be a system service new
design, Later I can dig into systemd changes see which commit cause the
breakage.
Signed-off-by: Dave Young <dyoung(a)redhat.com>
Signed-off-by: Dangyi Liu <dliu(a)redhat.com>
---
kdump-lib-initramfs.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- kexec-tools.orig/kdump-lib-initramfs.sh
+++ kexec-tools/kdump-lib-initramfs.sh
@@ -6,14 +6,14 @@ KDUMP_PATH="/var/crash"
CORE_COLLECTOR=""
DEFAULT_CORE_COLLECTOR="makedumpfile -l --message-level 1 -d 31"
DMESG_COLLECTOR="/sbin/vmcore-dmesg"
-DEFAULT_ACTION="reboot"
+DEFAULT_ACTION="systemctl reboot -f"
DATEDIR=`date +%Y-%m-%d-%T`
HOST_IP='127.0.0.1'
DUMP_INSTRUCTION=""
SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
KDUMP_SCRIPT_DIR="/kdumpscripts"
DD_BLKSIZE=512
-FINAL_ACTION="reboot"
+FINAL_ACTION="systemctl reboot -f"
KDUMP_CONF="/etc/kdump.conf"
KDUMP_PRE=""
KDUMP_POST=""
@@ -57,7 +57,7 @@ get_kdump_confs()
DEFAULT_ACTION="kdump_emergency_shell"
;;
reboot)
- DEFAULT_ACTION="reboot"
+ DEFAULT_ACTION="systemctl reboot -f"
;;
halt)
DEFAULT_ACTION="halt"
7 years, 9 months
[PATCH V2] use systemctl reboot -f as reboot action
by Dave Young
Systemd reports a conflict when kdump calls reboot during booting
because it tries to stop services while they are starting up.
use systemctl reboot -f will fix this problem.
man systemd.service show below:
[snip]
reboot causes a reboot
following the normal shutdown procedure (i.e. equivalent to systemctl reboot). reboot-force causes a forced reboot
which will terminate all processes forcibly but should cause no dirty file systems on reboot (i.e. equivalent to
systemctl reboot -f) and reboot-immediate causes immediate execution of the reboot(2) system call, which might result in
data loss.
[snip]
But during test "/sbin/reboot -f" actually equals to systemctl "reboot -f -f"
Test with "reboot -f" I still get below dirty ext2 filesystem:
[root@localhost ~]# fsck /dev/vdb
fsck from util-linux 2.27
e2fsck 1.42.13 (17-May-2015)
/dev/vdb was not cleanly unmounted, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/vdb: 12/128016 files (0.0% non-contiguous), 18474/512000 blocks
Change to systemctl reboot -f will instead get a clean filesystem
Thus let's use systemctl reboot -f instead, it will ensure clean filesystem even if
other services are not stopped, we do not care.
Since it blocks Fedora rawhide kdump I think we should add this ASAP.
Later I will dig into systemd changes see which commit cause the breakage.
Signed-off-by: Dave Young <dyoung(a)redhat.com
Signed-off-by: Dangyi Liu <dliu(a)redhat.com>
---
kdump-lib-initramfs.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- kexec-tools.orig/kdump-lib-initramfs.sh
+++ kexec-tools/kdump-lib-initramfs.sh
@@ -6,14 +6,14 @@ KDUMP_PATH="/var/crash"
CORE_COLLECTOR=""
DEFAULT_CORE_COLLECTOR="makedumpfile -l --message-level 1 -d 31"
DMESG_COLLECTOR="/sbin/vmcore-dmesg"
-DEFAULT_ACTION="reboot"
+DEFAULT_ACTION="systemctl reboot -f"
DATEDIR=`date +%Y-%m-%d-%T`
HOST_IP='127.0.0.1'
DUMP_INSTRUCTION=""
SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
KDUMP_SCRIPT_DIR="/kdumpscripts"
DD_BLKSIZE=512
-FINAL_ACTION="reboot"
+FINAL_ACTION="systemctl reboot -f"
KDUMP_CONF="/etc/kdump.conf"
KDUMP_PRE=""
KDUMP_POST=""
@@ -57,7 +57,7 @@ get_kdump_confs()
DEFAULT_ACTION="kdump_emergency_shell"
;;
reboot)
- DEFAULT_ACTION="reboot"
+ DEFAULT_ACTION="systemctl reboot -f"
;;
halt)
DEFAULT_ACTION="halt"
7 years, 9 months
[PATCH 2/2] Enable makedumpfile building for armv7hl
by Dave Young
makedumpfile has arm support but we did not enable the build options in
Fedora rpm spec file, let's do it for armv7hl.
Tested on bbb arm board with basic "bt" command in crash utility.
Enabling the build so that we can collect more test result
Signed-off-by: Dave Young <dyoung(a)redhat.com>
---
kexec-tools.spec | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
--- kexec-tools.orig/kexec-tools.spec
+++ kexec-tools/kexec-tools.spec
@@ -49,7 +49,7 @@ Requires: dracut, dracut-network, ethtoo
BuildRequires: zlib-devel zlib zlib-static elfutils-devel-static glib2-devel bzip2-devel ncurses-devel bison flex lzo-devel snappy-devel
BuildRequires: pkgconfig intltool gettext
BuildRequires: systemd-units
-%ifarch %{ix86} x86_64 ppc64 ppc s390x ppc64le
+%ifarch %{ix86} x86_64 ppc64 ppc s390x ppc64le armv7hl
Obsoletes: diskdumputils netdump kexec-tools-eppic
%endif
@@ -129,7 +129,7 @@ cp %{SOURCE10} .
cp %{SOURCE21} .
make
-%ifarch %{ix86} x86_64 ppc64 s390x ppc64le
+%ifarch %{ix86} x86_64 ppc64 s390x ppc64le armv7hl
make -C eppic/libeppic
make -C makedumpfile-1.5.9 LINKTYPE=dynamic USELZO=on USESNAPPY=on
make -C makedumpfile-1.5.9 LDFLAGS="-I../eppic/libeppic -L../eppic/libeppic" eppic_makedumpfile.so
@@ -174,7 +174,7 @@ install -m 755 -D %{SOURCE22} $RPM_BUILD
mkdir -p $RPM_BUILD_ROOT/usr/sbin
install -m 755 %{SOURCE17} $RPM_BUILD_ROOT/usr/sbin/rhcrashkernel-param
-%ifarch %{ix86} x86_64 ppc64 s390x ppc64le
+%ifarch %{ix86} x86_64 ppc64 s390x ppc64le armv7hl
install -m 755 makedumpfile-1.5.9/makedumpfile $RPM_BUILD_ROOT/sbin/makedumpfile
install -m 644 makedumpfile-1.5.9/makedumpfile.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8/makedumpfile.8.gz
install -m 644 makedumpfile-1.5.9/makedumpfile.conf.5.gz $RPM_BUILD_ROOT/%{_mandir}/man5/makedumpfile.conf.5.gz
@@ -280,7 +280,7 @@ done
%{_bindir}/*
%{_datadir}/kdump
%{_prefix}/lib/kdump
-%ifarch %{ix86} x86_64 ppc64 s390x ppc64le
+%ifarch %{ix86} x86_64 ppc64 s390x ppc64le armv7hl
%{_sysconfdir}/makedumpfile.conf.sample
%endif
%config(noreplace,missingok) %{_sysconfdir}/sysconfig/kdump
@@ -299,7 +299,7 @@ done
%doc TODO
%doc kexec-kdump-howto.txt
%doc kdump-in-cluster-environment.txt
-%ifarch %{ix86} x86_64 ppc64 s390x ppc64le
+%ifarch %{ix86} x86_64 ppc64 s390x ppc64le armv7hl
%{_libdir}/eppic_makedumpfile.so
/usr/share/makedumpfile/eppic_scripts/
%endif
7 years, 9 months
[PATCH 1/2] Add missing prefixes in default sysconfig file
by Dave Young
For arches we do not exlictly support, kdumpctl will fail with errors because
kernel can not be found. It is caused by there's no proper KDUMP_IMG prefix
so kernel image can not be found.
Kexec/kdump functionality may simply work, so let's add those prefix in
default sysconfig file thus one can test and use kexec/kdump in Fedora.
Signed-off-by: Dave Young <dyoung(a)redhat.com>
---
kdump.sysconfig | 6 ++++++
1 file changed, 6 insertions(+)
--- kexec-tools.orig/kdump.sysconfig
+++ kexec-tools/kdump.sysconfig
@@ -24,3 +24,9 @@ KDUMP_COMMANDLINE_APPEND="irqpoll maxcpu
# Example:
# KEXEC_ARGS="--elf32-core-headers"
KEXEC_ARGS=""
+
+#Where to find the boot image
+#KDUMP_BOOTDIR="/boot"
+
+#What is the image type used for kdump
+KDUMP_IMG="vmlinuz"
7 years, 9 months
[PATCH] dracut-module-setup: Mute the error message when kdump detects iSCSI session by iscsiadm
by Minfei Huang
For independent hardware iSCSI HBA, the network config will be recorded
in the firmware BIOS. It fails to use normal means(like iscsiadm) to
detect iSCSI session details, since HBA firmware doesn't expose the
session to running kernel.
Mute the error message when kdump detects iSCSI session by iscsiadm.
Signed-off-by: Minfei Huang <mhuang(a)redhat.com>
---
dracut-module-setup.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 9b398eb..1736315 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -512,9 +512,9 @@ kdump_setup_iscsi_device() {
# Check once before getting explicit values, so we can output a decent
# error message.
- if ! /sbin/iscsiadm -m session -r ${path} >/dev/null ; then
- derror "Unable to find iscsi record for $path"
- return 1
+ if ! /sbin/iscsiadm -m session -r ${path} 2>&- > /dev/null ; then
+ # Yes, it is hardware iscsi HBA.
+ return
fi
tgt_name=$(kdump_iscsi_get_rec_val ${path} "node.name")
--
2.1.0
7 years, 9 months
[PATCH v2] Remove kernel param "quiet" from kdump kernel cmdline
by Dave Young
"quiet" will disable most of log messages. For debugging kdump
kernel purpose it is better to remove quiet in 2nd kernel so that
we always see kernel messages.
Signed-off-by: Dangyi Liu <dliu(a)redhat.com>
Acked-by: Dave Young <dyoung(a)redhat.com>
---
dyoung: Rebased Dangyi's V1 to his KDUMP_COMMANDLINE_REMOVE patch
kdump.sysconfig | 2 +-
kdump.sysconfig.i386 | 2 +-
kdump.sysconfig.ppc64 | 2 +-
kdump.sysconfig.ppc64le | 2 +-
kdump.sysconfig.s390x | 2 +-
kdump.sysconfig.x86_64 | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
--- kexec-tools.orig/kdump.sysconfig
+++ kexec-tools/kdump.sysconfig
@@ -17,7 +17,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us remove arguments from the current kdump commandline
# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
# NOTE: some arguments such as crashkernel will always be removed
-KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug"
+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
--- kexec-tools.orig/kdump.sysconfig.i386
+++ kexec-tools/kdump.sysconfig.i386
@@ -17,7 +17,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us remove arguments from the current kdump commandline
# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
# NOTE: some arguments such as crashkernel will always be removed
-KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug"
+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
--- kexec-tools.orig/kdump.sysconfig.ppc64
+++ kexec-tools/kdump.sysconfig.ppc64
@@ -17,7 +17,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us remove arguments from the current kdump commandline
# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
# NOTE: some arguments such as crashkernel will always be removed
-KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug"
+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
--- kexec-tools.orig/kdump.sysconfig.ppc64le
+++ kexec-tools/kdump.sysconfig.ppc64le
@@ -17,7 +17,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us remove arguments from the current kdump commandline
# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
# NOTE: some arguments such as crashkernel will always be removed
-KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug"
+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
--- kexec-tools.orig/kdump.sysconfig.s390x
+++ kexec-tools/kdump.sysconfig.s390x
@@ -17,7 +17,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us remove arguments from the current kdump commandline
# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
# NOTE: some arguments such as crashkernel will always be removed
-KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug"
+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
--- kexec-tools.orig/kdump.sysconfig.x86_64
+++ kexec-tools/kdump.sysconfig.x86_64
@@ -17,7 +17,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us remove arguments from the current kdump commandline
# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
# NOTE: some arguments such as crashkernel will always be removed
-KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug"
+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
7 years, 9 months
[PATCH v3] kdump.sysconfig: add KDUMP_COMMANDLINE_REMOVE
by Dangyi Liu
Use KDUMP_COMMANDLINE_REMOVE config instead of hardcode them in
kdumpctl, which makes it possible system admins decide what params to
remove such as "quiet" or other debug flags.
This patch also adds backward compatibility even if an old config is
used. It will behave the same as the old version.
Signed-off-by: Dangyi Liu <dliu(a)redhat.com>
Cc: Baoquan He <bhe(a)redhat.com>
Cc: Dave Young <dyoung(a)redhat.com>
---
Changes:
v2->v3: Always remove crashkernel and panic_on_warn
v1->v2: Add compatibility; describle the order to process cmdline
kdump.sysconfig | 7 ++++++-
kdump.sysconfig.i386 | 7 ++++++-
kdump.sysconfig.ppc64 | 7 ++++++-
kdump.sysconfig.ppc64le | 7 ++++++-
kdump.sysconfig.s390x | 7 ++++++-
kdump.sysconfig.x86_64 | 7 ++++++-
kdumpctl | 9 +++++++--
7 files changed, 43 insertions(+), 8 deletions(-)
diff --git a/kdump.sysconfig b/kdump.sysconfig
index effe466..d44c8ae 100644
--- a/kdump.sysconfig
+++ b/kdump.sysconfig
@@ -14,8 +14,13 @@ KDUMP_KERNELVER=""
# /proc/cmdline
KDUMP_COMMANDLINE=""
+# This variable lets us remove arguments from the current kdump commandline
+# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
+# NOTE: some arguments such as crashkernel will always be removed
+KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug"
+
# This variable lets us append arguments to the current kdump commandline
-# As taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
+# after processed by KDUMP_COMMANDLINE_REMOVE
KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 reset_devices"
# Any additional kexec arguments required. In most situations, this should
diff --git a/kdump.sysconfig.i386 b/kdump.sysconfig.i386
index bb7a6e5..37d1b96 100644
--- a/kdump.sysconfig.i386
+++ b/kdump.sysconfig.i386
@@ -14,8 +14,13 @@ KDUMP_KERNELVER=""
# /proc/cmdline
KDUMP_COMMANDLINE=""
+# This variable lets us remove arguments from the current kdump commandline
+# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
+# NOTE: some arguments such as crashkernel will always be removed
+KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug"
+
# This variable lets us append arguments to the current kdump commandline
-# As taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
+# 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"
# Any additional kexec arguments required. In most situations, this should
diff --git a/kdump.sysconfig.ppc64 b/kdump.sysconfig.ppc64
index dd09598..3d4db57 100644
--- a/kdump.sysconfig.ppc64
+++ b/kdump.sysconfig.ppc64
@@ -14,8 +14,13 @@ KDUMP_KERNELVER=""
# /proc/cmdline
KDUMP_COMMANDLINE=""
+# This variable lets us remove arguments from the current kdump commandline
+# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
+# NOTE: some arguments such as crashkernel will always be removed
+KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug"
+
# This variable lets us append arguments to the current kdump commandline
-# As taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
+# 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"
# Any additional kexec arguments required. In most situations, this should
diff --git a/kdump.sysconfig.ppc64le b/kdump.sysconfig.ppc64le
index dd09598..3d4db57 100644
--- a/kdump.sysconfig.ppc64le
+++ b/kdump.sysconfig.ppc64le
@@ -14,8 +14,13 @@ KDUMP_KERNELVER=""
# /proc/cmdline
KDUMP_COMMANDLINE=""
+# This variable lets us remove arguments from the current kdump commandline
+# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
+# NOTE: some arguments such as crashkernel will always be removed
+KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug"
+
# This variable lets us append arguments to the current kdump commandline
-# As taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
+# 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"
# Any additional kexec arguments required. In most situations, this should
diff --git a/kdump.sysconfig.s390x b/kdump.sysconfig.s390x
index b103a88..96b3d1b 100644
--- a/kdump.sysconfig.s390x
+++ b/kdump.sysconfig.s390x
@@ -14,8 +14,13 @@ KDUMP_KERNELVER=""
# /proc/cmdline
KDUMP_COMMANDLINE=""
+# This variable lets us remove arguments from the current kdump commandline
+# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
+# NOTE: some arguments such as crashkernel will always be removed
+KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug"
+
# This variable lets us append arguments to the current kdump commandline
-# As taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
+# 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"
# Any additional /sbin/mkdumprd arguments required.
diff --git a/kdump.sysconfig.x86_64 b/kdump.sysconfig.x86_64
index 7991d68..5faab65 100644
--- a/kdump.sysconfig.x86_64
+++ b/kdump.sysconfig.x86_64
@@ -14,8 +14,13 @@ KDUMP_KERNELVER=""
# /proc/cmdline
KDUMP_COMMANDLINE=""
+# This variable lets us remove arguments from the current kdump commandline
+# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
+# NOTE: some arguments such as crashkernel will always be removed
+KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug"
+
# This variable lets us append arguments to the current kdump commandline
-# As taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
+# 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"
# Any additional kexec arguments required. In most situations, this should
diff --git a/kdumpctl b/kdumpctl
index 9f7e56b..ef18a2d 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -19,6 +19,9 @@ DEFAULT_DUMP_MODE="kdump"
standard_kexec_args="-p"
+# Some default values in case /etc/sysconfig/kdump doesn't include
+KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug"
+
if [ -f /etc/sysconfig/kdump ]; then
. /etc/sysconfig/kdump
fi
@@ -105,8 +108,10 @@ prepare_cmdline()
else
cmdline=${KDUMP_COMMANDLINE}
fi
- cmdline=`remove_cmdline_param "$cmdline" crashkernel hugepages hugepagesz panic_on_warn slub_debug`
-
+ # These params should always be removed
+ cmdline=`remove_cmdline_param "$cmdline" crashkernel panic_on_warn`
+ # These params can be removed configurably
+ cmdline=`remove_cmdline_param "$cmdline" ${KDUMP_COMMANDLINE_REMOVE}`
cmdline="${cmdline} ${KDUMP_COMMANDLINE_APPEND}"
--
2.5.0
7 years, 9 months
[PATCH] kdump-lib-initramfs.sh: Add -f for all DEFAULT_ACTIONs
by Dangyi Liu
Systemd reports a conflict when kdump calls reboot during booting
because it tries to stop services while they are starting up.
Adding -f for reboot (halt, poweroff) will make systemd reboot
immediately without the step to stop services, which is safe enough
since we have manually called sync after dumping.
Signed-off-by: Dangyi Liu <dliu(a)redhat.com>
---
kdump-lib-initramfs.sh | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh
index 68a94e8..724fff5 100755
--- a/kdump-lib-initramfs.sh
+++ b/kdump-lib-initramfs.sh
@@ -6,14 +6,14 @@ KDUMP_PATH="/var/crash"
CORE_COLLECTOR=""
DEFAULT_CORE_COLLECTOR="makedumpfile -l --message-level 1 -d 31"
DMESG_COLLECTOR="/sbin/vmcore-dmesg"
-DEFAULT_ACTION="reboot"
+DEFAULT_ACTION="reboot -f"
DATEDIR=`date +%Y-%m-%d-%T`
HOST_IP='127.0.0.1'
DUMP_INSTRUCTION=""
SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
KDUMP_SCRIPT_DIR="/kdumpscripts"
DD_BLKSIZE=512
-FINAL_ACTION="reboot"
+FINAL_ACTION="reboot -f"
KDUMP_CONF="/etc/kdump.conf"
KDUMP_PRE=""
KDUMP_POST=""
@@ -57,13 +57,13 @@ get_kdump_confs()
DEFAULT_ACTION="kdump_emergency_shell"
;;
reboot)
- DEFAULT_ACTION="reboot"
+ DEFAULT_ACTION="reboot -f"
;;
halt)
- DEFAULT_ACTION="halt"
+ DEFAULT_ACTION="halt -f"
;;
poweroff)
- DEFAULT_ACTION="poweroff"
+ DEFAULT_ACTION="poweroff -f"
;;
dump_to_rootfs)
DEFAULT_ACTION="dump_to_rootfs"
--
2.5.0
7 years, 9 months