Rebase to v1.0.58

Resolves: RHEL-113402,RHEL-93334,RHEL-113405,RHEL-29037,RHEL-103590
Upstream: kdump-utils
Conflict: none

Signed-off-by: Lichen Liu <lichliu@redhat.com>
This commit is contained in:
Lichen Liu 2025-09-29 14:10:48 +08:00
parent dfc087bedd
commit c1a7e254e5
No known key found for this signature in database
GPG Key ID: 2ED8215EF57B3D6C
9 changed files with 3 additions and 383 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@
/kdump-utils-1.0.45.tar.gz
/kdump-utils-1.0.51.tar.gz
/kdump-utils-1.0.54.tar.gz
/kdump-utils-1.0.58.tar.gz

View File

@ -1,66 +0,0 @@
From f758448cc7f29a24d8f5ddd7418dc9dd2fc3fd35 Mon Sep 17 00:00:00 2001
From: Lichen Liu <llc123456a@gmail.com>
Date: Thu, 8 May 2025 17:22:17 +0800
Subject: [PATCH] kdumpctl: check and generate /etc/vconsole.conf
For VMs created from KVM Guest images, /etc/vconsole.conf is missing
so that dracut module 10i18n will install all kbd files.
```
# du -sh initramfs/squash/usr/lib/kbd/*
438K initramfs/squash/usr/lib/kbd/consolefonts
340K initramfs/squash/usr/lib/kbd/consoletrans
2.1M initramfs/squash/usr/lib/kbd/keymaps
232K initramfs/squash/usr/lib/kbd/unimaps
```
From man 5 vconsole.conf, KEYMAP= defaults to "us" if not set. We can
safely generate a /etc/vconsole.conf with KEYMAP=us by localectl to
reduce the initramfs size.
```
# du -sh initramfs/squash/usr/lib/kbd/*
11K initramfs/squash/usr/lib/kbd/consolefonts
121K initramfs/squash/usr/lib/kbd/keymaps
```
Signed-off-by: Lichen Liu <lichliu@redhat.com>
---
kdumpctl | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/kdumpctl b/kdumpctl
index 58de8e6..ae541a3 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -174,6 +174,18 @@ rebuild_kdump_initrd()
return 0
}
+check_and_generate_vconsole_conf()
+{
+ if [[ ! -e /etc/vconsole.conf ]]; then
+ dwarn "/etc/vconsole.conf does not exist, trying to set keymap to us to reduce the initramfs size."
+ if has_command localectl; then
+ if localectl list-keymaps | grep -q "^us$"; then
+ localectl set-keymap us 2>/dev/null
+ fi
+ fi
+ fi
+}
+
rebuild_initrd()
{
local _ret
@@ -185,6 +197,8 @@ rebuild_initrd()
return 1
fi
+ check_and_generate_vconsole_conf
+
if [[ $DEFAULT_DUMP_MODE == "fadump" ]]; then
rebuild_fadump_initrd
else
--
2.47.0

View File

@ -1,37 +0,0 @@
From 1d40ea3a186c65e009f8cca775e6bb07c39fd80f Mon Sep 17 00:00:00 2001
From: Lichen Liu <lichliu@redhat.com>
Date: Tue, 27 May 2025 14:04:36 +0800
Subject: [PATCH] mkdumprd: replace lz4hc with lzma for better compression in
squash image
Among the compression algorithms currently enabled in RHEL-10,
erofs+lzma has a higher compression ratio than lz4hc, this patch
will replace it with lzma.
Testing shows when using erofs+lz4hc in RHEL-10, the size of the
initramfs generated for local dump is 47M, and the size for nfs
dump is 57M. After using lzma, the size is reduced to 39M and 45M.
This is very closely compared to the 38M and 44M when using
squashfs+zstd.
Signed-off-by: Lichen Liu <lichliu@redhat.com>
---
mkdumprd | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mkdumprd b/mkdumprd
index 5b6daaa..6881d8a 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -404,7 +404,7 @@ if ! have_compression_in_dracut_args; then
dracut_args+=(--squash-compressor zstd)
elif has_dracut_module squash-erofs && has_command mkfs.erofs; then
dracut_args+=(--add squash-erofs)
- dracut_args+=(--squash-compressor lz4hc)
+ dracut_args+=(--squash-compressor lzma)
elif has_command mksquashfs; then
# only true for dracut <= 103
dracut_args+=(--add squash)
--
2.47.0

View File

@ -1,42 +0,0 @@
From 1d7bdb507217adeaced260b1d11d8dc16146c5cb Mon Sep 17 00:00:00 2001
From: Coiby Xu <coxu@redhat.com>
Date: Fri, 30 May 2025 11:10:44 +0800
Subject: [PATCH] Fix the way to tell if there is a need to set up network
Related: https://issues.redhat.com/browse/RHEL-33413
Currently, dumping vmcore to a NVMe TCP target fails. The dracut nvmf is
supposed to be fully responsible for setting up the network and there is
no need for the involvement of the kdump dracut modle. However currently
_get_kdump_netifs returns " " even there is no NIC to be set up so the
kdump dracut module will be mislead to set up network and even install a
NetworkManager configuration file that stops all NICs from brought up by
NM. Thus NVMe TCP target fails to be set up because of network failure.
Fix _get_kdump_netifs so empty result instead of " " will be returned.
Fixes: 224d3102 ("Support setting up Open vSwitch (Ovs) Bridge network")
Signed-off-by: Coiby Xu <coxu@redhat.com>
---
dracut/99kdumpbase/module-setup.sh | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dracut/99kdumpbase/module-setup.sh b/dracut/99kdumpbase/module-setup.sh
index bd29eaa5..d71b28ce 100755
--- a/dracut/99kdumpbase/module-setup.sh
+++ b/dracut/99kdumpbase/module-setup.sh
@@ -11,7 +11,10 @@ _save_kdump_netifs() {
}
_get_kdump_netifs() {
- echo -n "${!unique_netifs[@]} ${!ovs_unique_netifs[@]}"
+ local -a _all_netifs
+
+ _all_netifs=("${!unique_netifs[@]}" "${!ovs_unique_netifs[@]}")
+ echo -n "${_all_netifs[@]}"
}
kdump_module_init() {
--
2.50.1

View File

@ -1,120 +0,0 @@
From 0678138331f6de43aaee0b7fbacf8adb38e73ff0 Mon Sep 17 00:00:00 2001
From: Coiby Xu <coxu@redhat.com>
Date: Thu, 17 Jul 2025 17:25:38 +0800
Subject: [PATCH] Support dumping to NVMe/TCP configured using NVMe Boot
Firmware Table
Resolves: https://issues.redhat.com/browse/RHEL-100907
Resolves: https://issues.redhat.com/browse/RHEL-33413
The dracut nvmf module can take care of all things. It can parse ACPI
NVMe Boot Firmware Table (NBFT) tables, generate NetworkManager profiles
and discover and connect all subsystems.
Currently, the dracut kdump module will try to bring up the same network
connections as in 1st kernel. But a different set of NVMe connections
and active network interfaces will be used for the case of multipathing.
So the dracut kdump module should let dracut nvmf module do everything.
Note connecting everything and having network redundancy may require extra
memory and the default crashkernel may not work. We'll document this
issue and ask users to increase the crashkernel.
Signed-off-by: Coiby Xu <coxu@redhat.com>
---
dracut/99kdumpbase/module-setup.sh | 37 +++++++++++++++++++++++++-----
supported-kdump-targets.txt | 2 ++
2 files changed, 33 insertions(+), 6 deletions(-)
diff --git a/dracut/99kdumpbase/module-setup.sh b/dracut/99kdumpbase/module-setup.sh
index d71b28ce..f2a8a24f 100755
--- a/dracut/99kdumpbase/module-setup.sh
+++ b/dracut/99kdumpbase/module-setup.sh
@@ -360,11 +360,6 @@ kdump_install_nmconnections() {
exit 1
fi
done <<< "$(nmcli -t -f device,filename connection show --active)"
-
- # Stop dracut 35network-manger to calling nm-initrd-generator.
- # Note this line of code can be removed after NetworkManager >= 1.35.2
- # gets released.
- echo > "${initdir}/usr/libexec/nm-initrd-generator"
}
kdump_install_nm_netif_allowlist() {
@@ -658,7 +653,7 @@ kdump_install_net() {
kdump_install_nmconnections
apply_nm_initrd_generator_timeouts
kdump_setup_znet "$_netifs"
- kdump_install_nm_netif_allowlist "$_netifs"
+ [[ $is_nvmf ]] || kdump_install_nm_netif_allowlist "$_netifs"
kdump_install_nic_driver "$_netifs"
kdump_install_resolv_conf
fi
@@ -915,6 +910,33 @@ kdump_check_iscsi_targets() {
}
}
+# Callback function for for_each_host_dev_and_slaves_all
+#
+# Code adapted from the is_nvmf function of dracut nvmf module
+kdump_nvmf_callback() {
+ local _dev _d _trtype
+
+ _dev=$1
+
+ cd -P "/sys/dev/block/$_dev" || return 1
+ if [ -f partition ]; then
+ cd ..
+ fi
+
+ for _d in device/nvme*; do
+ [ -L "$_d" ] || continue
+ if readlink "$_d" | grep -q nvme-fabrics; then
+ read -r _trtype < "$_d"/transport
+ [[ $_trtype == "fc" || $_trtype == "tcp" || $_trtype == "rdma" ]] && return 0
+ fi
+ done
+ return 1
+}
+
+kdump_check_nvmf_target() {
+ for_each_host_dev_and_slaves_all kdump_nvmf_callback && is_nvmf=1
+}
+
# hostname -a is deprecated, do it by ourself
get_alias() {
local ips
@@ -1074,6 +1096,7 @@ EOF
install() {
declare -A unique_netifs ovs_unique_netifs ipv4_usage ipv6_usage
+ local is_nvmf
kdump_module_init
kdump_install_conf
@@ -1121,6 +1144,8 @@ install() {
# at some point of time.
kdump_check_iscsi_targets
+ kdump_check_nvmf_target
+
kdump_install_systemd_conf
# nfs/ssh dump will need to get host ip in second kernel and need to call 'ip' tool, see get_host_ip for more detail
diff --git a/supported-kdump-targets.txt b/supported-kdump-targets.txt
index 936a42b6..0c7af107 100644
--- a/supported-kdump-targets.txt
+++ b/supported-kdump-targets.txt
@@ -47,6 +47,8 @@ storage:
software FCoE (bnx2fc) (Extra configuration required,
please read "Note on FCoE" section below)
NVMe-FC (qla2xxx, lpfc)
+ NVMe/TCP configured by NVMe Boot Firmware Table (users may need to
+ increase the crashkernel value)
network:
Hardware using kernel modules: (igb, ixgbe, ice, i40e, e1000e, igc,
--
2.50.1

View File

@ -1,47 +0,0 @@
From ddb0bab1f7e1e43a802993aadad03f85a3c045a9 Mon Sep 17 00:00:00 2001
From: Baoquan He <bhe@redhat.com>
Date: Wed, 25 Jun 2025 23:30:24 +0800
Subject: [PATCH] sysconfig: disable kfence in kdump kernel
Content-type: text/plain
In the current fedora and RHEL, below config items related to kfence
feature are set by default:
===
CONFIG_HAVE_ARCH_KFENCE=y
CONFIG_KFENCE=y
CONFIG_KFENCE_SAMPLE_INTERVAL=100
CONFIG_KFENCE_NUM_OBJECTS=255
CONFIG_KFENCE_STRESS_TEST_FAULTS=0
CONFIG_KFENCE_KUNIT_TEST=m
===
With them set, on x86_64, it will cost 2M extra memory used for kfence when
page size if 4K; while on arm64 with 64K page size, it will cost 32M extra
memory. This doesn't take memory cost of initializing and running kfence
itself into account, here only saying the kfence objects and guarded
pages. However, it doesn't make any sense to have kfence in a kdump
kernel. Hence, disable kfence in kdump kernel to save crashkernel
memory.
Signed-off-by: Baoquan He <bhe@redhat.com>
---
gen-kdump-sysconfig.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gen-kdump-sysconfig.sh b/gen-kdump-sysconfig.sh
index 8ed63ba6eb9d..ca2e7610bc59 100755
--- a/gen-kdump-sysconfig.sh
+++ b/gen-kdump-sysconfig.sh
@@ -29,7 +29,7 @@ KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swio
# This variable lets us append arguments to the current kdump commandline
# after processed by KDUMP_COMMANDLINE_REMOVE
-KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 reset_devices novmcoredd cma=0 hugetlb_cma=0"
+KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 reset_devices novmcoredd cma=0 hugetlb_cma=0 kfence.sample_interval=0"
# This variable lets us append arguments to fadump (powerpc) capture kernel,
# further to the parameters passed via the bootloader.
--
2.41.0

View File

@ -1,64 +0,0 @@
From 2ca913e9ccb2b964241e8c885e00d56d54b8fbe1 Mon Sep 17 00:00:00 2001
From: Baoquan He <bhe@redhat.com>
Date: Mon, 11 Aug 2025 17:02:46 +0800
Subject: [PATCH] sysconfig: disable kfence in kdump kernel
Content-type: text/plain
In commit ddb0bab1f7e1, I mistakenly added the 'kfence.sample_interval=0'
into KDUMP_COMMANDLINE_APPEND which is taken as default parameters added
into kdump kernel. The KDUMP_COMMANDLINE_APPEND value is for unsupported
architecuture. We should append wanted kernel parameter to each
supported architecture in "update_param KDUMP_COMMANDLINE_APPEND" place.
Fix it now.
Signed-off-by: Baoquan He <bhe@redhat.com>
---
gen-kdump-sysconfig.sh | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/gen-kdump-sysconfig.sh b/gen-kdump-sysconfig.sh
index ca2e7610bc59..e5afca0a910b 100755
--- a/gen-kdump-sysconfig.sh
+++ b/gen-kdump-sysconfig.sh
@@ -29,7 +29,7 @@ KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swio
# This variable lets us append arguments to the current kdump commandline
# after processed by KDUMP_COMMANDLINE_REMOVE
-KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 reset_devices novmcoredd cma=0 hugetlb_cma=0 kfence.sample_interval=0"
+KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 reset_devices novmcoredd cma=0 hugetlb_cma=0"
# This variable lets us append arguments to fadump (powerpc) capture kernel,
# further to the parameters passed via the bootloader.
@@ -82,11 +82,11 @@ 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"
+ "irqpoll nr_cpus=1 reset_devices cgroup_disable=memory udev.children-max=2 panic=10 swiotlb=noforce novmcoredd cma=0 hugetlb_cma=0 kfence.sample_interval=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"
+ "irqpoll nr_cpus=1 reset_devices numa=off udev.children-max=2 panic=10 transparent_hugepage=never novmcoredd cma=0 hugetlb_cma=0 kfence.sample_interval=0"
;;
ppc64)
update_param KEXEC_ARGS "--dt-no-old-root"
@@ -109,12 +109,12 @@ s390x)
update_param KDUMP_COMMANDLINE_REMOVE \
"hugepages hugepagesz slub_debug quiet log_buf_len swiotlb vmcp_cma cma hugetlb_cma prot_virt ignition.firstboot zfcp.allow_lun_scan"
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"
+ "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 kfence.sample_interval=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 pcie_ports=compat"
+ "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 pcie_ports=compat kfence.sample_interval=0"
;;
*)
echo "Warning: Unknown architecture '$1', using default sysconfig template." >&2
--
2.41.0

View File

@ -1,19 +1,13 @@
# kdump-utils has no debug source
%global debug_package %{nil}
Name: kdump-utils
Version:1.0.54
Version:1.0.58
Release: %autorelease -b 1
Summary: Kernel crash dump collection utilities
License: GPL-2.0-only
URL: https://github.com/rhkdump/kdump-utils
Source0: https://github.com/rhkdump/kdump-utils/archive/v%{version}/%{name}-%{version}.tar.gz
Patch01: 0001-kdumpctl-check-and-generate-etc-vconsole.conf.patch
Patch02: 0002-mkdumprd-replace-lz4hc-with-lzma-for-better-compress.patch
Patch03: 0003-Fix-the-way-to-tell-if-there-is-a-need-to-set-up-net.patch
Patch04: 0004-Support-dumping-to-NVMe-TCP-configured-using-NVMe-Bo.patch
Patch05: 0005-sysconfig-disable-kfence-in-kdump-kernel.patch
Patch06: 0006-sysconfig-disable-kfence-in-kdump-kernel.patch
%ifarch ppc64 ppc64le
Requires(post): servicelog

View File

@ -1 +1,2 @@
SHA512 (kdump-utils-1.0.54.tar.gz) = 8eb5b105c5614d2d206151a2261e639fa74958602fb741a725e114f7be87e866910ee530786f6e39988b15b47c477f53d22a7b563ed0aa1a09b9e96f4bb8744c
SHA512 (kdump-utils-1.0.58.tar.gz) = b464ff17211eee6b1af795ddcd3497d72653665a888b1905830121a6226fd441ff7ad88336ac08db29453deedb7567d64e447d7ed9c5cdc615a8e85e0e1b46af