[PATCH v1 00/14] reuse NetworkManager connection profiles to set up kdump network
by Coiby Xu
Currently, kexec-tools parses legacy ifcfg-* configuration files or
NetworkManager .nmconnection connection profiles to build up dracut
command line parameters like ip=. Then dracut parses these parameters and
runs nm-initrd-generator to generate NetworkManager connection profiles.
Taking a bonding network as an example, nm-initrd-generator generates two
connections as follows,
$ /usr/libexec/nm-initrd-generator -s -- bootdev=mybond0 rd.neednet kdumpnic=mybond0 bond=mybond0:kdump-eth0
*** Connection 'mybond0' ***
[connection]
id=mybond0
uuid=ed87d02b-dd44-4f0e-8b11-37db7e89bb48
interface-name=mybond0
[ipv4]
dhcp-timeout=90
...
*** Connection 'kdump-eth0' ***
[connection]
id=kdump-eth0
uuid=ed6a7448-b5f8-4f8a-b718-3e24ea1c924b
type=ethernet
interface-name=kdump-eth0
master=ed87d02b-dd44-4f0e-8b11-37db7e89bb48
slave-type=bond
wait-device-timeout=60000
...
Later in kdump initrd, dracut starts NetworkManager to activate these
profiles to bring up the network connections. This way of setting up
kdump network is tedious, error-prone and unnecessary. A better way is
to directly copy the needed connection profiles to initrd. A potential
benefit of this approach for the users is they can simply edit the
connection profile directly like changing ipv4.dhcp-timeout instead of
being forced to use the hard-coded value enforced by
nm-initrd-generator.
This patch set reuses NetworkManager connection profiles to setup kdump
network. It also reduces the memory consumption of network drivers and
fix other issues at the same time. A machine could have multiple network
drivers and a network driver may manage multiple NICs. It's possible
kdump may only need one NIC. In this case, there is no need to install
unneeded network drivers or bring up unneeded NICs.
Here are the bug list that addressed by this patch set,
- Bug 1962421 - [RHEL-9]"eth0: Failed to rename network interface 3 from 'eth0' to 'kdump-eth0': File exists"
- Bug 2064708 - kdump: mkdumprd: failed to make kdump initrd for bridge network on z15 z/vm
- bugs related to OOM caused by network driver
- Bug 1950282 - shutdown those unneeded network interfaces to save memory for kdump
- Bug 1958587 - the kdump initramfs includes unnecessary NIC drivers for SSH/NFS dumping target
- Bug 1890021 - be2net is using too much memory during kdump
- Bug 1662202 - [RHEL-8.1] aarch64: hpe-apache crashkernel OOM when dump to network targe
v1:
- refactor complex kdump_copy_nmconnection_file [Philipp]
- clean up temporary file in a trap [Philipp]
- improve sed [Philipp]
- use long name consistently [Philipp]
- use nmcli -t, --terse option to suppress printing of the header [Philipp]
- don't pass kdumpip to initrd [Kairui]
- address the case where kdump_install_net is called multiple times like
fence kdump
- call kdump_install_nm_netif_allowlist after all kdump_install_net
calls have been finished
- ask NM to match a connection profile to a physical NIC by MAC address
- stop treating vlan specially when its parent interface is a physical NIC
- don't add unused NIC drivers to kdump initrd
- fix the error of "/etc/NetworkManager/system-connections/*.nmconnection" not exist
grep: /etc/NetworkManager/system-connections/*.nmconnection: No such file or directory
- redirect the messages of nmcli to ddebug
- use "grep -s" to get rid of the following warnings
grep: /var/tmp/dracut.6tqUm0/initramfs//etc/NetworkManager/system-connections/*.nmconnection: No such file or directory
grep: /etc/sysconfig/network-scripts/ifcfg-*: No such file or directory
grep: /etc/NetworkManager/system-connections/*.nmconnection: No such file or directory
Coiby Xu (14):
add function to copy NetworkManage connection profile to the initramfs
clone NM connection profiles to support legacy ifcfg automatically
ask NM to wait the network device to be available
stop dracut 35network-manager from running nm-initrd-generator
set up kdump network bridge by directly copying NM connection profile
to initrd
set up kdump bonding network by directly copying NM connection profile
to initrd
fix error for vlan over team network interface
set up kdump vlan network by directly copying NM connection profile to
initrd
set up kdump teaming network by directly copying NM connection profile
to initrd
clean up unneeded code after copying .nmconnection to initrd
reduce kdump memory consumption by not letting NetworkManager manage
unneeded network interfaces
reduce kdump memory consumption by only installing needed NIC drivers
address the cases where a NIC has a different name in kdump kernel
simplify setup_znet by copying connection profile to initrd
dracut-kdump.sh | 25 ++-
dracut-module-setup.sh | 484 ++++++++++++++++++-----------------------
kdump-lib-initramfs.sh | 12 +
mkdumprd | 2 +-
4 files changed, 239 insertions(+), 284 deletions(-)
--
2.35.3
1 year, 1 month
[PATCH v3 0/3] support tests against Fedora 35 or newer Cloud Base Images
by Coiby Xu
This patch set enables the integration tests (i.e. the test cases in
tests/) for Fedora 35, 36 and 37 cloud base images.
v3:
- use "unmount -R" to umount both the root and boot partition [Kairui]
- add a code comment for the change of root node [Kairui]
- fix the error of using the first partition as boot partition (the
2nd partition is the boot parition) for Fedora >= 35
- specify backing format for "qemu-img create" as required by newer qemu-img
- specify the Fedora version for fedpkg sources
v2:
- check LAST_PARTITION/root/root instead of LAST_PARTITION/root [Kairui]
- improve commit message
Coiby Xu (3):
tests: correctly mount the root and also the boot partitions for
Fedora 35, 36 and rawhide Cloud Base Image
tests: specify the backing format for the backing file when using
qemu-img create
tests: specify the Fedora version when running fedpkg sources
tests/Makefile | 2 +-
tests/scripts/image-init-lib.sh | 31 +++++++++++++++++++++++++++----
2 files changed, 28 insertions(+), 5 deletions(-)
--
2.35.3
1 year, 3 months
[PATCH] use /run/ostree-booted to tell if scriptlet is running on OSTree system
by Coiby Xu
Resolves: bz2092012
According to the ostree team [1], the existence of /run/ostree-booted
> is the most stable way to signal/check that a system has been
> booted in ostree-style. It is also used by rpm-ostree at
> compose/install time in the sandboxed environment where scriptlets run,
> in order to signal that the package is being installed/composed into
> an ostree commit (i.e. not directly on a live system). See
> https://github.com/coreos/rpm-ostree/blob/8ddf5f40d9cbbd9d3668cc75b703316...
> for reference.
By checking the existence of /run/ostree-booted, we could skip trying to
update kernel cmdline during OSTree compose time.
[1] https://bugzilla.redhat.com/show_bug.cgi?id=2092012#c3
Reported-by: Luca BRUNO <lucab(a)redhat.com>
Suggested-by: Luca BRUNO <lucab(a)redhat.com>
Fixes: 0adb0f4 ("try to reset kernel crashkernel when kexec-tools updates the default crashkernel value")
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
---
kexec-tools.spec | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/kexec-tools.spec b/kexec-tools.spec
index c6e42b2..e7afb9c 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -262,8 +262,12 @@ mkdir -p $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/
mv $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/* $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/
%pre
-# save the old default crashkernel values to /tmp/ when upgrading the package
-if ! grep -qs "ostree" /proc/cmdline && [ $1 == 2 ] && grep -q get-default-crashkernel /usr/bin/kdumpctl; then
+# Save the old default crashkernel values to /tmp/ when upgrading the package
+# so kdumpctl later can tell if it should update the kernel crashkenrel
+# parameter in the posttrans scriptlet. Note this feauture of auto-updating
+# the kernel crashkenrel parameter currently doesn't support ostree, so skip it
+# for ostree.
+if [ ! -f /run/ostree-booted ] && [ $1 == 2 ] && grep -q get-default-crashkernel /usr/bin/kdumpctl; then
kdumpctl get-default-crashkernel kdump > /tmp/old_default_crashkernel 2>/dev/null
%ifarch ppc64 ppc64le
kdumpctl get-default-crashkernel fadump > /tmp/old_default_crashkernel_fadump 2>/dev/null
@@ -336,9 +340,14 @@ do
done
%posttrans
-# try to reset kernel crashkernel value to new default value when upgrading
-# the package
-if ! grep -qs "ostree" /proc/cmdline && [ $1 == 1 ]; then
+# Try to reset kernel crashkernel value to new default value based on the old
+# default value or set up crasherkernel value for osbuild
+#
+# Note
+# 1. Skip ostree systems as they are not supported.
+# 2. "[ $1 == 1 ]" in posttrans scriptlet means both install and upgrade. The
+# former case is used to set up crashkernel for osbuild
+if [ ! -f /run/ostree-booted ] && [ $1 == 1 ]; then
kdumpctl reset-crashkernel-after-update
rm /tmp/old_default_crashkernel 2>/dev/null
%ifarch ppc64 ppc64le
--
2.35.3
1 year, 4 months
[PATCH] allow to update kexec-tools using virt-customize for cloud base image
by Coiby Xu
Resolves: bz2089871
Currently, kexec-tools can't be updated using virt-customize because
older version of kdumpctl can't acquire instance lock for the
get-default-crashkernel subcommand. The reason is /var/lock is linked to
/run/lock however /run doesn't exist in the case of virt-customize.
This patch fixes this problem by creating /run/lock before creating the
lock file.
Note
1. The lock file is now created in /run/lock instead of /var/run/lock since
Fedora has adopted adopted /run [2] since F15.
2. %pre scriptlet now always return success since package update won't
be blocked
[1] https://fedoraproject.org/wiki/Features/var-run-tmpfs
Fixes: 0adb0f4 ("try to reset kernel crashkernel when kexec-tools updates the default crashkernel value")
Reported-by: Nicolas Hicher <nhicher(a)redhat.com>
Suggested-by: Laszlo Ersek <lersek(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
---
kdumpctl | 18 +++++++++++++++++-
kexec-tools.spec | 2 ++
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl
index 6188d47..439276d 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -47,11 +47,27 @@ if ! dlog_init; then
exit 1
fi
+# rmdir /run/lock if it's created by kdumpctl
+clean_up_run_lock()
+{
+ if [[ $(echo /run/lock/*) == /run/lock/kdump ]]; then
+ rm /run/lock/kdump
+ rmdir /run/lock
+ fi
+}
+
+trap clean_up_run_lock EXIT
+
single_instance_lock()
{
local rc timeout=5
- if ! exec 9> /var/lock/kdump; then
+ # when updating package using virt-customize, /run/lock doesn't exist
+ if [[ ! -d /run/lock ]]; then
+ mkdir /run/lock
+ fi
+
+ if ! exec 9> /run/lock/kdump; then
derror "Create file lock failed"
exit 1
fi
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 9c6ea8d..b66f97e 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -269,6 +269,8 @@ if ! grep -qs "ostree" /proc/cmdline && [ $1 == 2 ] && grep -q get-default-crash
kdumpctl get-default-crashkernel fadump > /tmp/old_default_crashkernel_fadump 2>/dev/null
%endif
fi
+# don't block package update
+:
%post
# Initial installation
--
2.35.3
1 year, 4 months
[PATCH v3] sysconfig: use a simple generator script to maintain
by Kairui Song
From: Kairui Song <kasong(a)tencent.com>
These kdump.sysconfig.* files are almost identical with a bit different
in several parameters, just use a simple script to generate them upon
packaging. This should make it easier to maintain, updating a comment or
param for certain arch can be done in one place.
There are only some comment or empty option differences with the generated
version due to some arch's sysconfig is not up-to-dated, this actually
fixed the issue, I used following script to check these differences:
# for arch in aarch64 i386 ppc64 ppc64le s390x x86_64; do
./gen-kdump-sysconfig.sh $arch > kdump.sysconfig.$arch.new
git checkout HEAD^ kdump.sysconfig.$arch &>/dev/null
echo "$arch:"
diff kdump.sysconfig.$arch kdump.sysconfig.$arch.new; echo ""
done; git reset;
Signed-off-by: Kairui Song <kasong(a)tencent.com>
---
Update from V2:
- Rebase to latest code base.
- Simplify commit message.
Update from V1:
- Use a here doc to include the template inline the script.
- Print a warning for unknown arch.
Thanks to Philipp for these suggestion.
kdump.sysconfig => gen-kdump-sysconfig.sh | 59 +++++++++++++++++++++++
kdump.sysconfig.aarch64 | 53 --------------------
kdump.sysconfig.i386 | 56 ---------------------
kdump.sysconfig.ppc64 | 58 ----------------------
kdump.sysconfig.ppc64le | 58 ----------------------
kdump.sysconfig.s390x | 59 -----------------------
kdump.sysconfig.x86_64 | 56 ---------------------
kexec-tools.spec | 17 ++-----
8 files changed, 64 insertions(+), 352 deletions(-)
rename kdump.sysconfig => gen-kdump-sysconfig.sh (50%)
mode change 100644 => 100755
delete mode 100644 kdump.sysconfig.aarch64
delete mode 100644 kdump.sysconfig.i386
delete mode 100644 kdump.sysconfig.ppc64
delete mode 100644 kdump.sysconfig.ppc64le
delete mode 100644 kdump.sysconfig.s390x
delete mode 100644 kdump.sysconfig.x86_64
diff --git a/kdump.sysconfig b/gen-kdump-sysconfig.sh
old mode 100644
new mode 100755
similarity index 50%
rename from kdump.sysconfig
rename to gen-kdump-sysconfig.sh
index c1143f3..d9a500e
--- a/kdump.sysconfig
+++ b/gen-kdump-sysconfig.sh
@@ -1,3 +1,10 @@
+#!/bin/bash
+# $1: target arch
+
+SED_EXP=""
+
+generate() {
+sed "$SED_EXP" <<EOF
# Kernel Version string for the -kdump kernel, such as 2.6.13-1544.FC5kdump
# If no version is specified, then the init script will try to find a
# kdump kernel with the same version number as the running kernel.
@@ -36,6 +43,9 @@ KEXEC_ARGS=""
#What is the image type used for kdump
KDUMP_IMG="vmlinuz"
+#What is the images extension. Relocatable kernels don't have one
+KDUMP_IMG_EXT=""
+
# Logging is controlled by following variables in the first kernel:
# - @var KDUMP_STDLOGLVL - logging level to standard error (console output)
# - @var KDUMP_SYSLOGLVL - logging level to syslog (by logger command)
@@ -51,3 +61,52 @@ KDUMP_IMG="vmlinuz"
# KDUMP_STDLOGLVL=3
# KDUMP_SYSLOGLVL=0
# KDUMP_KMSGLOGLVL=0
+EOF
+}
+
+update_param()
+{
+ SED_EXP="${SED_EXP}s/^$1=.*$/$1=\"$2\"/;"
+}
+
+case "$1" in
+aarch64)
+ update_param KEXEC_ARGS "-s"
+ update_param KDUMP_COMMANDLINE_APPEND \
+ "irqpoll nr_cpus=1 reset_devices cgroup_disable=memory udev.children-max=2 panic=10 swiotlb=noforce novmcoredd cma=0 hugetlb_cma=0"
+ ;;
+i386)
+ update_param KDUMP_COMMANDLINE_APPEND \
+ "irqpoll nr_cpus=1 reset_devices numa=off udev.children-max=2 panic=10 transparent_hugepage=never novmcoredd cma=0 hugetlb_cma=0"
+ ;;
+ppc64)
+ update_param KEXEC_ARGS "--dt-no-old-root"
+ update_param KDUMP_COMMANDLINE_REMOVE \
+ "hugepages hugepagesz slub_debug quiet log_buf_len swiotlb hugetlb_cma ignition.firstboot"
+ update_param 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 novmcoredd hugetlb_cma=0"
+ ;;
+ppc64le)
+ update_param KEXEC_ARGS "--dt-no-old-root -s"
+ update_param KDUMP_COMMANDLINE_REMOVE \
+ "hugepages hugepagesz slub_debug quiet log_buf_len swiotlb hugetlb_cma ignition.firstboot"
+ update_param 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 novmcoredd hugetlb_cma=0"
+ ;;
+s390x)
+ update_param KEXEC_ARGS "-s"
+ update_param KDUMP_COMMANDLINE_REMOVE \
+ "hugepages hugepagesz slub_debug quiet log_buf_len swiotlb vmcp_cma cma hugetlb_cma prot_virt ignition.firstboot"
+ update_param KDUMP_COMMANDLINE_APPEND \
+ "nr_cpus=1 cgroup_disable=memory numa=off udev.children-max=2 panic=10 transparent_hugepage=never novmcoredd vmcp_cma=0 cma=0 hugetlb_cma=0"
+ ;;
+x86_64)
+ update_param KEXEC_ARGS "-s"
+ update_param 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 hest_disable novmcoredd cma=0 hugetlb_cma=0"
+ ;;
+*)
+ echo "Warning: Unknown architecture '$1', using default sysconfig template."
+esac
+
+generate
diff --git a/kdump.sysconfig.aarch64 b/kdump.sysconfig.aarch64
deleted file mode 100644
index df75f94..0000000
--- a/kdump.sysconfig.aarch64
+++ /dev/null
@@ -1,53 +0,0 @@
-# Kernel Version string for the -kdump kernel, such as 2.6.13-1544.FC5kdump
-# If no version is specified, then the init script will try to find a
-# kdump kernel with the same version number as the running kernel.
-KDUMP_KERNELVER=""
-
-# The kdump commandline is the command line that needs to be passed off to
-# the kdump kernel. This will likely match the contents of the grub kernel
-# line. For example:
-# KDUMP_COMMANDLINE="ro root=LABEL=/"
-# Dracut depends on proper root= options, so please make sure that appropriate
-# root= options are copied from /proc/cmdline. In general it is best to append
-# command line options using "KDUMP_COMMANDLINE_APPEND=".
-# If a command line is not specified, the default will be taken from
-# /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 quiet log_buf_len swiotlb cma hugetlb_cma ignition.firstboot"
-
-# 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 udev.children-max=2 panic=10 swiotlb=noforce novmcoredd cma=0 hugetlb_cma=0"
-
-# Any additional kexec arguments required. In most situations, this should
-# be left empty
-#
-# Example:
-# KEXEC_ARGS="--elf32-core-headers"
-KEXEC_ARGS="-s"
-
-#Where to find the boot image
-#KDUMP_BOOTDIR="/boot"
-
-#What is the image type used for kdump
-KDUMP_IMG="vmlinuz"
-
-# Logging is controlled by following variables in the first kernel:
-# - @var KDUMP_STDLOGLVL - logging level to standard error (console output)
-# - @var KDUMP_SYSLOGLVL - logging level to syslog (by logger command)
-# - @var KDUMP_KMSGLOGLVL - logging level to /dev/kmsg (only for boot-time)
-#
-# In the second kernel, kdump will use the rd.kdumploglvl option to set the
-# log level in the above KDUMP_COMMANDLINE_APPEND.
-# - @var rd.kdumploglvl - logging level to syslog (by logger command)
-# - for example: add the rd.kdumploglvl=3 option to KDUMP_COMMANDLINE_APPEND
-#
-# Logging levels: no logging(0), error(1),warn(2),info(3),debug(4)
-#
-# KDUMP_STDLOGLVL=3
-# KDUMP_SYSLOGLVL=0
-# KDUMP_KMSGLOGLVL=0
diff --git a/kdump.sysconfig.i386 b/kdump.sysconfig.i386
deleted file mode 100644
index d8bf5f6..0000000
--- a/kdump.sysconfig.i386
+++ /dev/null
@@ -1,56 +0,0 @@
-# Kernel Version string for the -kdump kernel, such as 2.6.13-1544.FC5kdump
-# If no version is specified, then the init script will try to find a
-# kdump kernel with the same version number as the running kernel.
-KDUMP_KERNELVER=""
-
-# The kdump commandline is the command line that needs to be passed off to
-# the kdump kernel. This will likely match the contents of the grub kernel
-# line. For example:
-# KDUMP_COMMANDLINE="ro root=LABEL=/"
-# Dracut depends on proper root= options, so please make sure that appropriate
-# root= options are copied from /proc/cmdline. In general it is best to append
-# command line options using "KDUMP_COMMANDLINE_APPEND=".
-# If a command line is not specified, the default will be taken from
-# /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 quiet log_buf_len swiotlb cma hugetlb_cma ignition.firstboot"
-
-# 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 transparent_hugepage=never novmcoredd cma=0 hugetlb_cma=0"
-
-# Any additional kexec arguments required. In most situations, this should
-# be left empty
-#
-# 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"
-
-#What is the images extension. Relocatable kernels don't have one
-KDUMP_IMG_EXT=""
-
-# Logging is controlled by following variables in the first kernel:
-# - @var KDUMP_STDLOGLVL - logging level to standard error (console output)
-# - @var KDUMP_SYSLOGLVL - logging level to syslog (by logger command)
-# - @var KDUMP_KMSGLOGLVL - logging level to /dev/kmsg (only for boot-time)
-#
-# In the second kernel, kdump will use the rd.kdumploglvl option to set the
-# log level in the above KDUMP_COMMANDLINE_APPEND.
-# - @var rd.kdumploglvl - logging level to syslog (by logger command)
-# - for example: add the rd.kdumploglvl=3 option to KDUMP_COMMANDLINE_APPEND
-#
-# Logging levels: no logging(0), error(1),warn(2),info(3),debug(4)
-#
-# KDUMP_STDLOGLVL=3
-# KDUMP_SYSLOGLVL=0
-# KDUMP_KMSGLOGLVL=0
diff --git a/kdump.sysconfig.ppc64 b/kdump.sysconfig.ppc64
deleted file mode 100644
index 1b0cdc7..0000000
--- a/kdump.sysconfig.ppc64
+++ /dev/null
@@ -1,58 +0,0 @@
-# Kernel Version string for the -kdump kernel, such as 2.6.13-1544.FC5kdump
-# If no version is specified, then the init script will try to find a
-# kdump kernel with the same version number as the running kernel.
-KDUMP_KERNELVER=""
-
-# The kdump commandline is the command line that needs to be passed off to
-# the kdump kernel. This will likely match the contents of the grub kernel
-# line. For example:
-# KDUMP_COMMANDLINE="ro root=LABEL=/"
-# Dracut depends on proper root= options, so please make sure that appropriate
-# root= options are copied from /proc/cmdline. In general it is best to append
-# command line options using "KDUMP_COMMANDLINE_APPEND=".
-# If a command line is not specified, the default will be taken from
-# /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 quiet log_buf_len swiotlb hugetlb_cma ignition.firstboot"
-
-# 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 kvm_cma_resv_ratio=0 transparent_hugepage=never novmcoredd hugetlb_cma=0"
-
-# Any additional kexec arguments required. In most situations, this should
-# be left empty
-#
-# Example:
-# KEXEC_ARGS="--elf32-core-headers"
-KEXEC_ARGS="--dt-no-old-root"
-
-#Where to find the boot image
-#KDUMP_BOOTDIR="/boot"
-
-#What is the image type used for kdump
-KDUMP_IMG="vmlinuz"
-
-#What is the images extension. Relocatable kernels don't have one
-KDUMP_IMG_EXT=""
-
-#Specify the action after failure
-
-# Logging is controlled by following variables in the first kernel:
-# - @var KDUMP_STDLOGLVL - logging level to standard error (console output)
-# - @var KDUMP_SYSLOGLVL - logging level to syslog (by logger command)
-# - @var KDUMP_KMSGLOGLVL - logging level to /dev/kmsg (only for boot-time)
-#
-# In the second kernel, kdump will use the rd.kdumploglvl option to set the
-# log level in the above KDUMP_COMMANDLINE_APPEND.
-# - @var rd.kdumploglvl - logging level to syslog (by logger command)
-# - for example: add the rd.kdumploglvl=3 option to KDUMP_COMMANDLINE_APPEND
-#
-# Logging levels: no logging(0), error(1),warn(2),info(3),debug(4)
-#
-# KDUMP_STDLOGLVL=3
-# KDUMP_SYSLOGLVL=0
-# KDUMP_KMSGLOGLVL=0
diff --git a/kdump.sysconfig.ppc64le b/kdump.sysconfig.ppc64le
deleted file mode 100644
index d951def..0000000
--- a/kdump.sysconfig.ppc64le
+++ /dev/null
@@ -1,58 +0,0 @@
-# Kernel Version string for the -kdump kernel, such as 2.6.13-1544.FC5kdump
-# If no version is specified, then the init script will try to find a
-# kdump kernel with the same version number as the running kernel.
-KDUMP_KERNELVER=""
-
-# The kdump commandline is the command line that needs to be passed off to
-# the kdump kernel. This will likely match the contents of the grub kernel
-# line. For example:
-# KDUMP_COMMANDLINE="ro root=LABEL=/"
-# Dracut depends on proper root= options, so please make sure that appropriate
-# root= options are copied from /proc/cmdline. In general it is best to append
-# command line options using "KDUMP_COMMANDLINE_APPEND=".
-# If a command line is not specified, the default will be taken from
-# /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 quiet log_buf_len swiotlb hugetlb_cma ignition.firstboot"
-
-# 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 kvm_cma_resv_ratio=0 transparent_hugepage=never novmcoredd hugetlb_cma=0"
-
-# Any additional kexec arguments required. In most situations, this should
-# be left empty
-#
-# Example:
-# KEXEC_ARGS="--elf32-core-headers"
-KEXEC_ARGS="--dt-no-old-root -s"
-
-#Where to find the boot image
-#KDUMP_BOOTDIR="/boot"
-
-#What is the image type used for kdump
-KDUMP_IMG="vmlinuz"
-
-#What is the images extension. Relocatable kernels don't have one
-KDUMP_IMG_EXT=""
-
-#Specify the action after failure
-
-# Logging is controlled by following variables in the first kernel:
-# - @var KDUMP_STDLOGLVL - logging level to standard error (console output)
-# - @var KDUMP_SYSLOGLVL - logging level to syslog (by logger command)
-# - @var KDUMP_KMSGLOGLVL - logging level to /dev/kmsg (only for boot-time)
-#
-# In the second kernel, kdump will use the rd.kdumploglvl option to set the
-# log level in the above KDUMP_COMMANDLINE_APPEND.
-# - @var rd.kdumploglvl - logging level to syslog (by logger command)
-# - for example: add the rd.kdumploglvl=3 option to KDUMP_COMMANDLINE_APPEND
-#
-# Logging levels: no logging(0), error(1),warn(2),info(3),debug(4)
-#
-# KDUMP_STDLOGLVL=3
-# KDUMP_SYSLOGLVL=0
-# KDUMP_KMSGLOGLVL=0
diff --git a/kdump.sysconfig.s390x b/kdump.sysconfig.s390x
deleted file mode 100644
index 2971ae7..0000000
--- a/kdump.sysconfig.s390x
+++ /dev/null
@@ -1,59 +0,0 @@
-# Kernel Version string for the -kdump kernel, such as 2.6.13-1544.FC5kdump
-# If no version is specified, then the init script will try to find a
-# kdump kernel with the same version number as the running kernel.
-KDUMP_KERNELVER=""
-
-# The kdump commandline is the command line that needs to be passed off to
-# the kdump kernel. This will likely match the contents of the grub kernel
-# line. For example:
-# KDUMP_COMMANDLINE="ro root=LABEL=/"
-# Dracut depends on proper root= options, so please make sure that appropriate
-# root= options are copied from /proc/cmdline. In general it is best to append
-# command line options using "KDUMP_COMMANDLINE_APPEND=".
-# If a command line is not specified, the default will be taken from
-# /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 quiet log_buf_len swiotlb vmcp_cma cma hugetlb_cma prot_virt ignition.firstboot"
-
-# 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 transparent_hugepage=never novmcoredd vmcp_cma=0 cma=0 hugetlb_cma=0"
-
-# Any additional /sbin/mkdumprd arguments required.
-MKDUMPRD_ARGS=""
-
-# Any additional kexec arguments required. In most situations, this should
-# be left empty
-#
-# Example:
-# KEXEC_ARGS="--elf32-core-headers"
-KEXEC_ARGS="-s"
-
-#Where to find the boot image
-#KDUMP_BOOTDIR="/boot"
-
-#What is the image type used for kdump
-KDUMP_IMG="vmlinuz"
-
-#What is the images extension. Relocatable kernels don't have one
-KDUMP_IMG_EXT=""
-
-# Logging is controlled by following variables in the first kernel:
-# - @var KDUMP_STDLOGLVL - logging level to standard error (console output)
-# - @var KDUMP_SYSLOGLVL - logging level to syslog (by logger command)
-# - @var KDUMP_KMSGLOGLVL - logging level to /dev/kmsg (only for boot-time)
-#
-# In the second kernel, kdump will use the rd.kdumploglvl option to set the
-# log level in the above KDUMP_COMMANDLINE_APPEND.
-# - @var rd.kdumploglvl - logging level to syslog (by logger command)
-# - for example: add the rd.kdumploglvl=3 option to KDUMP_COMMANDLINE_APPEND
-#
-# Logging levels: no logging(0), error(1),warn(2),info(3),debug(4)
-#
-# KDUMP_STDLOGLVL=3
-# KDUMP_SYSLOGLVL=0
-# KDUMP_KMSGLOGLVL=0
diff --git a/kdump.sysconfig.x86_64 b/kdump.sysconfig.x86_64
deleted file mode 100644
index 6a3ba6e..0000000
--- a/kdump.sysconfig.x86_64
+++ /dev/null
@@ -1,56 +0,0 @@
-# Kernel Version string for the -kdump kernel, such as 2.6.13-1544.FC5kdump
-# If no version is specified, then the init script will try to find a
-# kdump kernel with the same version number as the running kernel.
-KDUMP_KERNELVER=""
-
-# The kdump commandline is the command line that needs to be passed off to
-# the kdump kernel. This will likely match the contents of the grub kernel
-# line. For example:
-# KDUMP_COMMANDLINE="ro root=LABEL=/"
-# Dracut depends on proper root= options, so please make sure that appropriate
-# root= options are copied from /proc/cmdline. In general it is best to append
-# command line options using "KDUMP_COMMANDLINE_APPEND=".
-# If a command line is not specified, the default will be taken from
-# /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 quiet log_buf_len swiotlb cma hugetlb_cma ignition.firstboot"
-
-# 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 acpi_no_memhotplug transparent_hugepage=never nokaslr hest_disable novmcoredd cma=0 hugetlb_cma=0"
-
-# Any additional kexec arguments required. In most situations, this should
-# be left empty
-#
-# Example:
-# KEXEC_ARGS="--elf32-core-headers"
-KEXEC_ARGS="-s"
-
-#Where to find the boot image
-#KDUMP_BOOTDIR="/boot"
-
-#What is the image type used for kdump
-KDUMP_IMG="vmlinuz"
-
-#What is the images extension. Relocatable kernels don't have one
-KDUMP_IMG_EXT=""
-
-# Logging is controlled by following variables in the first kernel:
-# - @var KDUMP_STDLOGLVL - logging level to standard error (console output)
-# - @var KDUMP_SYSLOGLVL - logging level to syslog (by logger command)
-# - @var KDUMP_KMSGLOGLVL - logging level to /dev/kmsg (only for boot-time)
-#
-# In the second kernel, kdump will use the rd.kdumploglvl option to set the
-# log level in the above KDUMP_COMMANDLINE_APPEND.
-# - @var rd.kdumploglvl - logging level to syslog (by logger command)
-# - for example: add the rd.kdumploglvl=3 option to KDUMP_COMMANDLINE_APPEND
-#
-# Logging levels: no logging(0), error(1),warn(2),info(3),debug(4)
-#
-# KDUMP_STDLOGLVL=3
-# KDUMP_SYSLOGLVL=0
-# KDUMP_KMSGLOGLVL=0
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 9c6ea8d..0dd08ec 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -11,10 +11,7 @@ Summary: The kexec/kdump userspace component
Source0: http://kernel.org/pub/linux/utils/kernel/kexec/%{name}-%{version}.tar.xz
Source1: kdumpctl
-Source2: kdump.sysconfig
-Source3: kdump.sysconfig.x86_64
-Source4: kdump.sysconfig.i386
-Source5: kdump.sysconfig.ppc64
+Source3: gen-kdump-sysconfig.sh
Source7: mkdumprd
Source8: kdump.conf
Source9: https://github.com/makedumpfile/makedumpfile/archive/%{mkdf_ver}/makedump...
@@ -25,18 +22,15 @@ Source13: 98-kexec.rules
Source14: 98-kexec.rules.ppc64
Source15: kdump.conf.5
Source16: kdump.service
-Source18: kdump.sysconfig.s390x
Source19: https://github.com/lucchouina/eppic/archive/%{eppic_ver}/eppic-%{eppic_sh...
Source20: kdump-lib.sh
Source21: kdump-in-cluster-environment.txt
Source22: kdump-dep-generator.sh
Source23: kdump-lib-initramfs.sh
-Source24: kdump.sysconfig.ppc64le
Source25: kdumpctl.8
Source26: live-image-kdump-howto.txt
Source27: early-kdump-howto.txt
Source28: kdump-udev-throttler
-Source29: kdump.sysconfig.aarch64
Source30: 60-kdump.install
Source31: kdump-logger.sh
Source32: mkfadumprd
@@ -152,6 +146,9 @@ cp %{SOURCE26} .
cp %{SOURCE27} .
cp %{SOURCE34} .
+# Generate sysconfig file
+%{SOURCE3} %{_target_cpu} > kdump.sysconfig
+
make
%ifarch %{ix86} x86_64 ppc64 s390x ppc64le aarch64
make -C eppic-%{eppic_ver}/libeppic
@@ -183,13 +180,9 @@ install -m 755 build/sbin/vmcore-dmesg $RPM_BUILD_ROOT/usr/sbin/vmcore-dmesg
install -m 644 build/man/man8/kexec.8 $RPM_BUILD_ROOT%{_mandir}/man8/
install -m 644 build/man/man8/vmcore-dmesg.8 $RPM_BUILD_ROOT%{_mandir}/man8/
-SYSCONFIG=$RPM_SOURCE_DIR/kdump.sysconfig.%{_target_cpu}
-[ -f $SYSCONFIG ] || SYSCONFIG=$RPM_SOURCE_DIR/kdump.sysconfig.%{_arch}
-[ -f $SYSCONFIG ] || SYSCONFIG=$RPM_SOURCE_DIR/kdump.sysconfig
-install -m 644 $SYSCONFIG $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/kdump
-
install -m 755 %{SOURCE7} $RPM_BUILD_ROOT/usr/sbin/mkdumprd
install -m 644 %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/kdump.conf
+install -m 644 kdump.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/kdump
install -m 644 kexec/kexec.8 $RPM_BUILD_ROOT%{_mandir}/man8/kexec.8
install -m 644 %{SOURCE12} $RPM_BUILD_ROOT%{_mandir}/man8/mkdumprd.8
install -m 644 %{SOURCE25} $RPM_BUILD_ROOT%{_mandir}/man8/kdumpctl.8
--
2.35.2
1 year, 4 months
[PATCH 1/3] skip updating /etc/default/grub for s390x
by Coiby Xu
Resolves: bz2104534
When running "kdumpctl reset-crashkernel --kernel=ALL" on s390x,
sed: can't read /etc/default/grub: No such file or directory
sed: can't read /etc/default/grub: No such file or directory
This happens because s390x doesn't use the grub bootloader and
/etc/default/grub doesn't exist.
Reported-by: smitterl(a)redhat.com
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
---
kdumpctl | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kdumpctl b/kdumpctl
index 2157371..10e3429 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1405,6 +1405,10 @@ _update_kernel_arg_in_grub_etc_default()
{
local _para=$1 _val=$2 _para_val
+ if [[ $(uname -m) = s390x ]]; then
+ return
+ fi
+
if [[ -n $_val ]]; then
_para_val="$_para=$_val"
fi
--
2.35.3
1 year, 4 months
[PATCH] KDUMP_COMMANDLINE: remove irqpoll parameter on aws aarch64 platform
by Pingfan Liu
Currently, kdump may experience failure on some aws aarch64 platform.
The final scenario is:
[ 79.145089] printk: console [ttyS0] disabled
Then the system has no response any more. And after reboot, there is no
vmcore generated under /var/crash/. More detail [1].
In a short word, it is caused by the irqpoll policy and some unknown
acpi issue. The serial device is hot-removed as a pci device.
More detailed, the irqpoll policy demands to iterate over all interrupt
handler, if the interrupt line is shared, then the handler is
dispatched. And acpi handler acpi_irq() is on a shared interrupt line,
so it is called. But for some unknown reason, the acpi hardware regs
hold wrong state, and the acpi driver decides that a hot-removed event
happens on a pci slot, which finally removes the pci serial device.
To tackle this issue by removing the irqpoll parameter on aws aarch64
platform, until the real root cause in acpi is found and resolved.
[1]: https://bugzilla.redhat.com/show_bug.cgi?id=2080468#c0
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
---
kdumpctl | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/kdumpctl b/kdumpctl
index 6188d47..3eb57e3 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -641,6 +641,18 @@ function remove_kdump_kernel_key()
keyctl unlink "$KDUMP_KEY_ID" %:.ima
}
+function is_aws_aarch64()
+{
+ local _bios_model;
+
+ _bios_model=$(lscpu | grep "BIOS Model name")
+ if [[ "${_bios_model}" =~ "AWS Graviton" ]]; then
+ return 0
+ fi
+
+ return 1
+}
+
# Load the kdump kernel specified in /etc/sysconfig/kdump
# If none is specified, try to load a kdump kernel with the same version
# as the currently running kernel.
@@ -650,6 +662,9 @@ load_kdump()
KEXEC_ARGS=$(prepare_kexec_args "${KEXEC_ARGS}")
KDUMP_COMMANDLINE=$(prepare_cmdline "${KDUMP_COMMANDLINE}" "${KDUMP_COMMANDLINE_REMOVE}" "${KDUMP_COMMANDLINE_APPEND}")
+ if is_aws_aarch64; then
+ KDUMP_COMMANDLINE=$(echo ${KDUMP_COMMANDLINE} | sed 's/irqpoll//' )
+ fi
# For secureboot enabled machines, use new kexec file based syscall.
# Old syscall will always fail as it does not have capability to
--
2.31.1
1 year, 4 months
[PATCH] Revert "ppc64/ppc64le: drop cpu online rule in 40-redhat.rules in kdump initramfs"
by Baoquan He
Resolves: bz2106645
This reverts commit 163c02970e4ddcf238b2ac09eadf380744e01ba2.
The code of commit 163c02970e4ddc takes effect in rhel firstly, later
pulled to Fedora. However, Fedora OS doesn't have 40-redhat.rules
in systemd-udev package. With this commit applied, a warning message
can always been seen as below. So reverting commit 163c02970e4ddc
to remove the unnecessary warning message.
[root@ ~]# kdumpctl restart
kdump: kexec: unloaded kdump kernel
kdump: Stopping kdump: [OK]
kdump: No kdump initial ramdisk found.
kdump: Rebuilding /boot/initramfs-5.19.0-rc6+kdump.img
sed: can't read /var/tmp/dracut.NnAV2g/initramfs/usr/lib/udev/rules.d/40-redhat.rules: No such file or directory
kdump: kexec: loaded kdump kernel
kdump: Starting kdump: [OK]
Signed-off-by: Baoquan He <bhe(a)redhat.com>
---
dracut-module-setup.sh | 18 ------------------
1 file changed, 18 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index c319fc2db7aa..1ea0d9596f9c 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -1010,29 +1010,11 @@ kdump_install_systemd_conf() {
echo "ForwardToConsole=yes" >> "${initdir}/etc/systemd/journald.conf.d/kdump.conf"
}
-remove_cpu_online_rule() {
- local file=${initdir}/usr/lib/udev/rules.d/40-redhat.rules
-
- sed -i '/SUBSYSTEM=="cpu"/d' "$file"
-}
-
install() {
- local arch
-
kdump_module_init
kdump_install_conf
remove_sysctl_conf
- # Onlining secondary cpus breaks kdump completely on KVM on Power hosts
- # Though we use maxcpus=1 by default but 40-redhat.rules will bring up all
- # possible cpus by default. (rhbz1270174 rhbz1266322)
- # Thus before we get the kernel fix and the systemd rule fix let's remove
- # the cpu online rule in kdump initramfs.
- arch=$(uname -m)
- if [[ "$arch" = "ppc64le" ]] || [[ "$arch" = "ppc64" ]]; then
- remove_cpu_online_rule
- fi
-
if is_ssh_dump_target; then
kdump_install_random_seed
fi
--
2.34.1
1 year, 4 months