From 9cb5b5989d2cb8caaadb519001394ee528b786bf Mon Sep 17 00:00:00 2001 From: Lichen Liu Date: Thu, 2 Apr 2026 12:04:47 +0800 Subject: [PATCH] Rebase to upstream 1.0.61 Resolves: RHEL-83890, RHEL-120738, RHEL-137603, RHEL-145107, RHEL-152452 Upstream: kdump-utils Conflict: None Signed-off-by: Lichen Liu --- .gitignore | 2 + ...ing-quotes-from-configuration-values.patch | 77 -------- ...case-for-quoted-configuration-values.patch | 45 ----- ...p.service-to-access-LUKS-volume-keys.patch | 43 ---- ...store-SELinux-label-of-crypttab-file.patch | 80 -------- ...w-sudo-kdumpctl-for-LUKS-dump-target.patch | 131 ------------ ...rounding-quotes-from-configuration-v.patch | 63 ------ ...initramfs-rewrite-kdump_get_conf_val.patch | 123 ------------ ...-persisent-device-if-FIPS-is-enabled.patch | 39 ---- ...-Centralize-the-F-suboption-handling.patch | 61 ------ ...ize-the-num-threads-sub-option-handl.patch | 61 ------ ...m-threads-when-E-and-F-option-is-pre.patch | 49 ----- ...-CPU-count-while-calculating-crashke.patch | 82 -------- ...erpc-Set-nr_cpus-16-for-kdump-kernel.patch | 26 --- ...o.txt-update-paragraphs-related-to-d.patch | 73 ------- ...mfs-Fix-performance-regression-in-kd.patch | 131 ------------ ...itramfs_options-to-reduce-memory-usa.patch | 80 -------- ...an-up-backup-restore-_default_initrd.patch | 103 ---------- ...mments-to-different-initrd-variables.patch | 93 --------- 0019-spec-drop-dependency-for-binutils.patch | 186 ------------------ ...s-disable-systemd-gpt-auto-generator.patch | 53 ----- 0021-kdump-lib-use-EFI-var-to-find-UKI.patch | 46 ----- kdump-utils.spec | 24 +-- sources | 2 + 24 files changed, 5 insertions(+), 1668 deletions(-) delete mode 100644 0001-Strip-surrounding-quotes-from-configuration-values.patch delete mode 100644 0002-unit-tests-Add-case-for-quoted-configuration-values.patch delete mode 100644 0003-Allow-kdump.service-to-access-LUKS-volume-keys.patch delete mode 100644 0004-Restore-SELinux-label-of-crypttab-file.patch delete mode 100644 0005-Allow-sudo-kdumpctl-for-LUKS-dump-target.patch delete mode 100644 0006-Revert-Strip-surrounding-quotes-from-configuration-v.patch delete mode 100644 0007-kdump-lib-initramfs-rewrite-kdump_get_conf_val.patch delete mode 100644 0008-Add-persisent-device-if-FIPS-is-enabled.patch delete mode 100644 0009-kdump.sh-Centralize-the-F-suboption-handling.patch delete mode 100644 0010-kdump.sh-Centralize-the-num-threads-sub-option-handl.patch delete mode 100644 0011-kdump.sh-Skip-num-threads-when-E-and-F-option-is-pre.patch delete mode 100644 0012-powerpc-consider-CPU-count-while-calculating-crashke.patch delete mode 100644 0013-powerpc-Set-nr_cpus-16-for-kdump-kernel.patch delete mode 100644 0014-kexec-kdump-howto.txt-update-paragraphs-related-to-d.patch delete mode 100644 0015-kdump-lib-initramfs-Fix-performance-regression-in-kd.patch delete mode 100644 0016-sysconfig-use-initramfs_options-to-reduce-memory-usa.patch delete mode 100644 0017-kdumpctl-clean-up-backup-restore-_default_initrd.patch delete mode 100644 0018-kdumpctl-add-comments-to-different-initrd-variables.patch delete mode 100644 0019-spec-drop-dependency-for-binutils.patch delete mode 100644 0020-kdump-lib-always-disable-systemd-gpt-auto-generator.patch delete mode 100644 0021-kdump-lib-use-EFI-var-to-find-UKI.patch diff --git a/.gitignore b/.gitignore index 096a325..337fbca 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ /kdump-utils-1.0.51.tar.gz /kdump-utils-1.0.54.tar.gz /kdump-utils-1.0.58.tar.gz +/kdump-utils-1.0.60.tar.gz +/kdump-utils-1.0.61.tar.gz diff --git a/0001-Strip-surrounding-quotes-from-configuration-values.patch b/0001-Strip-surrounding-quotes-from-configuration-values.patch deleted file mode 100644 index 4582341..0000000 --- a/0001-Strip-surrounding-quotes-from-configuration-values.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 1a733872aeab1d1dcc0b063cd05afe61bbeb1c33 Mon Sep 17 00:00:00 2001 -From: Lichen Liu -Date: Tue, 14 Oct 2025 11:30:29 +0800 -Subject: [PATCH 1/2] Strip surrounding quotes from configuration values - -The documentation for kdump.conf suggests values can be enclosed in -double quotes, as in 'core_collector "makedumpfile -l --message-level 7 -d 31"'. - -However, the parsing logic did not strip these quotes, causing the -system to treat them as part of the value. This led to errors, such -as attempting to execute the command '"makedumpfile', which would -fail with a "command not found" error. - -``` -kdump.sh[599]: /lib/kdump-lib-initramfs.sh: line 145: "makedumpfile: command not found -kdump[601]: saving vmcore failed, _exitcode:127 -kdump[603]: saving the /run/initramfs/kexec-dmesg.log to /sysroot//var/crash/127.0.0.1-2025-09-17-19:25:10/ -kdump[609]: saving vmcore failed -[FAILED] Failed to start Kdump Vmcore Save Service. -``` - -This patch fixes the issue by removing surrounding double quotes from -configuration values when they are read. This ensures that quoted -values are handled correctly and behave as documented. - -Signed-off-by: Lichen Liu ---- - dracut/99kdumpbase/module-setup.sh | 2 +- - kdump-lib-initramfs.sh | 5 +++-- - kdumpctl | 1 + - 3 files changed, 5 insertions(+), 3 deletions(-) - -diff --git a/dracut/99kdumpbase/module-setup.sh b/dracut/99kdumpbase/module-setup.sh -index 1c223ed..4dc11ac 100755 ---- a/dracut/99kdumpbase/module-setup.sh -+++ b/dracut/99kdumpbase/module-setup.sh -@@ -719,7 +719,7 @@ kdump_install_conf() { - kdump_read_conf > "${initdir}/tmp/$$-kdump.conf" - - while read -r _opt _val; do -- # remove inline comments after the end of a directive. -+ [[ $_val == \"*\" ]] && _val=${_val:1:-1} - case "$_opt" in - raw) - _pdev=$(persistent_policy="by-id" kdump_get_persistent_dev "$_val") -diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh -index 558295a..c4bc6d2 100755 ---- a/kdump-lib-initramfs.sh -+++ b/kdump-lib-initramfs.sh -@@ -29,9 +29,10 @@ kdump_read_conf() - kdump_get_conf_val() - { - # For lines matching "^\s*$1\s+", remove matched part (config name including space), -- # remove tailing comment, space, then store in hold space. Print out the hold buffer on last line. -+ # remove tailing comment, space and the surrounding quotes, then store in hold space. -+ # Print out the hold buffer on last line. - [ -f "$KDUMP_CONFIG_FILE" ] && -- sed -n -e "/^\s*\($1\)\s\+/{s/^\s*\($1\)\s\+//;s/#.*//;s/\s*$//;h};\${x;p}" $KDUMP_CONFIG_FILE -+ sed -n -e "/^\s*\($1\)\s\+/{s/^\s*\($1\)\s\+//;s/#.*//;s/\s*$//;s/^\"\(.*\)\"$/\1/;h};\${x;p}" $KDUMP_CONFIG_FILE - } - - is_mounted() -diff --git a/kdumpctl b/kdumpctl -index dd69318..6375efa 100755 ---- a/kdumpctl -+++ b/kdumpctl -@@ -324,6 +324,7 @@ _set_config() - fi - return 1 - fi -+ [[ $_val == \"*\" ]] && _val=${_val:1:-1} - OPT[$opt]="$val" - } - --- -2.51.1 - diff --git a/0002-unit-tests-Add-case-for-quoted-configuration-values.patch b/0002-unit-tests-Add-case-for-quoted-configuration-values.patch deleted file mode 100644 index 9a91d62..0000000 --- a/0002-unit-tests-Add-case-for-quoted-configuration-values.patch +++ /dev/null @@ -1,45 +0,0 @@ -From e44958cad8bd997322b213a88881fe874641050d Mon Sep 17 00:00:00 2001 -From: Lichen Liu -Date: Tue, 14 Oct 2025 11:43:04 +0800 -Subject: [PATCH 2/2] unit tests: Add case for quoted configuration values - -This adds a unit test to ensure `kdump_get_conf_val` correctly strips -surrounding quotes from configuration options. This test case covers the -bug fixed in the previous commit. - -Signed-off-by: Lichen Liu ---- - spec/kdump-lib-initramfs_spec.sh | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/spec/kdump-lib-initramfs_spec.sh b/spec/kdump-lib-initramfs_spec.sh -index 2cb85bb..acabc2f 100644 ---- a/spec/kdump-lib-initramfs_spec.sh -+++ b/spec/kdump-lib-initramfs_spec.sh -@@ -12,6 +12,7 @@ Describe 'kdump-lib-initramfs' - #|dracut_args --omit-drivers "cfg80211 snd" --add-drivers "ext2 ext3" - #|sshkey /root/.ssh/kdump_id_rsa - #|ssh user@my.server.com -+ #|core_collector "makedumpfile -l --message-level 7 -d 31" - } - kdump_config >$KDUMP_CONFIG_FILE - Context 'Given different cases' -@@ -21,6 +22,7 @@ Describe 'kdump-lib-initramfs' - # - complicate value for dracut_args - # - Given two parameters, retrive one parameter that has value specified - # - Given two parameters (in reverse order), retrive one parameter that has value specified -+ # - values are enclosed in quotes - Parameters - "#1" nfs my.server.com:/export/tmp - "#2" ssh user@my.server.com -@@ -28,6 +30,7 @@ Describe 'kdump-lib-initramfs' - "#4" dracut_args '--omit-drivers "cfg80211 snd" --add-drivers "ext2 ext3"' - "#5" 'ssh\|aaa' user@my.server.com - "#6" 'aaa\|ssh' user@my.server.com -+ "#7" core_collector "makedumpfile -l --message-level 7 -d 31" - End - - It 'should handle all cases correctly' --- -2.51.1 - diff --git a/0003-Allow-kdump.service-to-access-LUKS-volume-keys.patch b/0003-Allow-kdump.service-to-access-LUKS-volume-keys.patch deleted file mode 100644 index 7688b5a..0000000 --- a/0003-Allow-kdump.service-to-access-LUKS-volume-keys.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 280d4b6237b1f3bcad9cfba5e51b4f55d8b718c9 Mon Sep 17 00:00:00 2001 -From: Coiby Xu -Date: Mon, 3 Nov 2025 09:26:21 +0800 -Subject: [PATCH 3/5] Allow kdump.service to access LUKS volume keys - -Resoles: https://issues.redhat.com/browse/RHEL-124989 - -Currently kdump.service fails to read LUKS volume keys, - - kdumpctl[4001]: Nothing to read on input. - kdumpctl[3624]: kdump: Error: Could not unlock the LUKS device. - kdumpctl[3624]: kdump: Failed to get logon key kdump-cryptsetup:vk-eed43d84-d79f-4b6d-8159-c859bb1915ee. Run 'kdumpctl restart' manually to start kdump. - kdumpctl[3624]: kdump: kexec: failed to prepare for a LUKS target - kdumpctl[3624]: kdump: Starting kdump: [FAILED] - systemd[1]: kdump.service: Main process exited, code=exited, status=1/FAILURE - systemd[1]: kdump.service: Failed with result 'exit-code'. - systemd[1]: Failed to start kdump.service - Crash recovery kernel arming. - -Use KeyringMode=shared to link the user keyring of root to the session -keyring so kdump.service can access the LUKS volume keys stored in -root's user keyring. For more details on KeyringMode, man systemd.exec. - -Fixes: d9677e17 ("Support dumping to a LUKS-encrypted target") -Signed-off-by: Coiby Xu ---- - kdump.service | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/kdump.service b/kdump.service -index 84de7af2..a8771a81 100644 ---- a/kdump.service -+++ b/kdump.service -@@ -11,6 +11,7 @@ ExecStop=/usr/bin/kdumpctl stop - ExecReload=/usr/bin/kdumpctl reload - RemainAfterExit=yes - StartLimitInterval=0 -+KeyringMode=shared - - [Install] - WantedBy=multi-user.target --- -2.51.1 - diff --git a/0004-Restore-SELinux-label-of-crypttab-file.patch b/0004-Restore-SELinux-label-of-crypttab-file.patch deleted file mode 100644 index 5decd92..0000000 --- a/0004-Restore-SELinux-label-of-crypttab-file.patch +++ /dev/null @@ -1,80 +0,0 @@ -From fe2891da11ce088ce14f7b2913bd3123b8f7c727 Mon Sep 17 00:00:00 2001 -From: Coiby Xu -Date: Mon, 3 Nov 2025 09:55:07 +0800 -Subject: [PATCH 4/5] Restore SELinux label of crypttab file -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Currently, for LUKS encrypted dump target, the system can have booting -problem with relatively older selinux-policy e.g. 40.13.21-1.el10 or -38.1.65-1.el9.noarch, - - [*** ] Job dev-disk-by\x2duuid-55f4fce1\x2…tart running (1min 21s / 1min 30s) - ... - [ TIME ] Timed out waiting for device dev-d…f4fce1-cd7f-43a6-8729-f0edcd048d73. - [DEPEND] Dependency failed for luks.mount - /luks. - [DEPEND] Dependency failed for local-fs.target - Local File Systems. - [DEPEND] Dependency failed for selinux-auto…k the need to relabel after reboot. - ... - [FAILED] Failed to start kdump.service - Crash recovery kernel arming. - See 'systemctl status kdump.service' for details. - You are in emergency mode. After logging in, type "journalctl -xb" to view - system logs, "systemctl reboot" to reboot, or "exit" - to continue bootup. - [ 4.375155] systemd-cryptsetup-generator[690]: Failed to open /etc/crypttab: Permission denied - [ 4.376555] audit: type=1400 audit(1762134586.538:4): avc: denied { open } for pid=690 comm="systemd-cryptse" path="/etc/crypttab" dev="vda3" ino=16916076 scontext=system_u:system_r:init_t:s0 tcontext=unconfined_u:object_r:user_tmp_t:s0 tclass=file permissive=0 - -This happens because the updated crypttab file for LUKS dump target has -incorrect SELinux label as it's created by mktemp. As a result, SELinux -will prevent systemd-cryptsetup-generator from accessing crypttab and -the encrypted dump target can fail to mount, - - # ls -Z /etc/crypttab - unconfined_u:object_r:user_tmp_t:s0 /etc/crypttab - -Restore the SELinux label of crypttab to fix this issue, - # ls -Z /etc/crypttab - unconfined_u:object_r:etc_t:s0 /etc/crypttab - -Although this issue no longer happens to newer selinux-policy like -policy-42.1.9-1.el10.noarch, it's better to restore the SELinux label of -crypttab file. - -Fixes: 4e0d4cae ("Add kdumpctl setup-crypttab subcommand") -Signed-off-by: Coiby Xu ---- - kdumpctl | 1 + - spec/kdumpctl_setup_crypttab_spec.sh | 4 ++++ - 2 files changed, 5 insertions(+) - -diff --git a/kdumpctl b/kdumpctl -index 6988ace1..e0aca1a6 100755 ---- a/kdumpctl -+++ b/kdumpctl -@@ -1316,6 +1316,7 @@ setup_crypttab() - return 0 - else - mv "$temp_file" "$CRYPTTAB_FILE" -+ restorecon "$CRYPTTAB_FILE" - dinfo "Success! $CRYPTTAB_FILE has been updated." - - # Parse status updates and report on each changed UUID -diff --git a/spec/kdumpctl_setup_crypttab_spec.sh b/spec/kdumpctl_setup_crypttab_spec.sh -index bfcd8dc6..0250e02b 100644 ---- a/spec/kdumpctl_setup_crypttab_spec.sh -+++ b/spec/kdumpctl_setup_crypttab_spec.sh -@@ -5,6 +5,10 @@ Describe "kdumpctl " - dinfo() { - echo "$1" - } -+ restorecon() { -+ : -+ } -+ - Describe "setup_crypttab()" - # Set up global variables and mocks for each test - # shellcheck disable=SC2016 # expand expression later --- -2.51.1 - diff --git a/0005-Allow-sudo-kdumpctl-for-LUKS-dump-target.patch b/0005-Allow-sudo-kdumpctl-for-LUKS-dump-target.patch deleted file mode 100644 index 0235d71..0000000 --- a/0005-Allow-sudo-kdumpctl-for-LUKS-dump-target.patch +++ /dev/null @@ -1,131 +0,0 @@ -From c08d151016ab4d62addc2ec8089a756c0d89d583 Mon Sep 17 00:00:00 2001 -From: Coiby Xu -Date: Wed, 5 Nov 2025 10:14:28 +0800 -Subject: [PATCH 5/5] Allow "sudo kdumpctl" for LUKS dump target - -Some users may run kdumcptl after "sudo su" or use "sudo kdumpctl". And -kdump will fail, - # sudo kdumcptl restart - request_key: Required key not available - keyctl_set_timeout: Invalid argument - kexec_file_load failed: Required key not available - kdump: kexec: failed to load kdump kernel - -This happens because the LUKS keys is can only be searched (keyctl request) -by the process but not by the user and sudo process inherits the session -keyring (@s) of the original user (test in the following example), - - [test@localhost ~]$ sudo keyctl add user testkey testdata @u - 711801750 - [test@localhost ~]$ sudo grep testkey /proc/keys - 2a6d3b96 I--Q--- 1 perm 3f010000 0 0 user testkey: 8 - [test@localhost ~]$ sudo keyctl show 711801750 - Keyring - Unable to dump key: Permission denied - -The permission "3f010000" means the process has all the permissions but -user only has the view permission i.e. "sudo keyctl show/list @u" will list -all the keys but "sudo keyctl show KEY_ID" won't work. - -Automatically use "sudo -i" which will use the session keyring (@s) of -the root to support "sudo kdumpctl". Note "sudo -i kexec" is also -needed in order for the process to read the keys in the kernel space. - -Reported-by: Li Tian -Signed-off-by: Coiby Xu ---- - kdumpctl | 29 ++++++++++++++++++++++++----- - 1 file changed, 24 insertions(+), 5 deletions(-) - -diff --git a/kdumpctl b/kdumpctl -index e0aca1a6..cb10f5bd 100755 ---- a/kdumpctl -+++ b/kdumpctl -@@ -737,7 +737,8 @@ function load_kdump_kernel_key() - if ! [[ -f /proc/device-tree/ibm,secure-boot ]]; then - return - fi -- -+ # %.ima keyring is writable to the user, no need to use -+ # "sudo -i keyctl" - keyctl padd asymmetric "" %:.ima < "/usr/share/doc/kernel-keys/$KDUMP_KERNELVER/kernel-signing-ppc.cer" - } - -@@ -760,6 +761,7 @@ load_kdump() - return 1 - fi - -+ [[ ${KEYCTL_CMD[0]} == sudo ]] && KEXEC="sudo -i $KEXEC" - ddebug "$KEXEC ${args[*]}" - if $KEXEC "${args[@]}"; then - dinfo "kexec: loaded kdump kernel" -@@ -1084,6 +1086,9 @@ remove_luks_vol_keys() - local _key_line _key_id _key_desc _status=1 - - # Get all keys from @u keyring and process each line -+ # sudo process by default only has the permission to list the keys -+ # stored in user keyring i.e. "sudo keyctl list" can work not -+ # "sudo keyctl unlink/show" - while read -r _key_line; do - # Skip header lines and empty lines - [[ $_key_line =~ ^[0-9]+: ]] || continue -@@ -1100,7 +1105,7 @@ remove_luks_vol_keys() - - # Check if key description starts with LUKS_KEY_PRFIX - if [[ $_key_desc == "$LUKS_KEY_PRFIX"* ]]; then -- keyctl unlink "$_key_id" -+ "${KEYCTL_CMD[@]}" unlink "$_key_id" - _status=0 - fi - done < <(keyctl list @u 2> /dev/null || true) -@@ -1142,11 +1147,22 @@ _get_luks_key_by_unlock() - return 1 - } - -+# Some users may use "sudo kdumpctl". sudo process by default inherits the -+# session keyring (@s) of the original user which means it can't read LUKS keys -+# stored in root's user (@u) which is only linked to root's session keyring. -+# So use "sudo -i keyctl" and "sudo kexec" automatically in order to be able to -+# search and read the LUKS key(s). -+KEYCTL_CMD=(keyctl) - prepare_luks() - { - local _key_id _key_des _luks_unlock_cmd - declare -a _luks_devs - -+ # Use "sudo -i" to use the root's session keyring to access LUKS keys -+ if ! keyctl show @s | grep -qs "_uid.0$"; then -+ KEYCTL_CMD=(sudo -i keyctl) -+ fi -+ - mapfile -t _luks_devs < <(get_all_kdump_crypt_dev) - - if [[ ${#_luks_devs[@]} -lt 1 ]]; then -@@ -1174,10 +1190,13 @@ prepare_luks() - for _devuuid in "${_luks_devs[@]}"; do - _key_dir=$LUKS_CONFIGFS/$_devuuid - _key_des=$LUKS_KEY_PRFIX$_devuuid -- if _key_id=$(keyctl request logon "$_key_des" 2> /dev/null); then -+ if _key_id=$("${KEYCTL_CMD[@]}" request logon "$_key_des" 2> /dev/null); then - ddebug "Succesfully get @u::%logon:$_key_des" - elif _get_luks_key_by_unlock "$_devuuid" "$_key_des"; then -- _key_id=$(keyctl request logon "$_key_des") -+ if ! _key_id=$("${KEYCTL_CMD[@]}" request logon "$_key_des"); then -+ derror "Probably you are using 'sudo kdumpctl' or 'sudo su', please retry with 'sudo -i kdumpctl'" -+ return 1 -+ fi - ddebug "Succesfully get @u::%logon:$_key_des after cryptsetup" - else - derror "Failed to get logon key $_key_des. Run 'kdumpctl restart' manually to start kdump." -@@ -1185,7 +1204,7 @@ prepare_luks() - fi - - # Let the key expire after 300 seconds -- keyctl timeout "$_key_id" 300 -+ "${KEYCTL_CMD[@]}" timeout "$_key_id" 300 - mkdir "$_key_dir" - printf "%s" "$_key_des" > "$_key_dir"/description - done --- -2.51.1 - diff --git a/0006-Revert-Strip-surrounding-quotes-from-configuration-v.patch b/0006-Revert-Strip-surrounding-quotes-from-configuration-v.patch deleted file mode 100644 index e25f999..0000000 --- a/0006-Revert-Strip-surrounding-quotes-from-configuration-v.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 8062d687ef56d61d2b9a581e0fd6f291466d5dfa Mon Sep 17 00:00:00 2001 -From: Lichen Liu -Date: Tue, 25 Nov 2025 12:08:00 +0800 -Subject: [PATCH 6/7] Revert "Strip surrounding quotes from configuration - values" - -This reverts commit 1a733872aeab1d1dcc0b063cd05afe61bbeb1c33. - -kdump_get_conf_val() will be rewritten so this commit is not -needed at all. - -Signed-off-by: Lichen Liu ---- - dracut/99kdumpbase/module-setup.sh | 2 +- - kdump-lib-initramfs.sh | 5 ++--- - kdumpctl | 1 - - 3 files changed, 3 insertions(+), 5 deletions(-) - -diff --git a/dracut/99kdumpbase/module-setup.sh b/dracut/99kdumpbase/module-setup.sh -index 32819ab..313d74e 100755 ---- a/dracut/99kdumpbase/module-setup.sh -+++ b/dracut/99kdumpbase/module-setup.sh -@@ -724,7 +724,7 @@ kdump_install_conf() { - kdump_read_conf > "${initdir}/tmp/$$-kdump.conf" - - while read -r _opt _val; do -- [[ $_val == \"*\" ]] && _val=${_val:1:-1} -+ # remove inline comments after the end of a directive. - case "$_opt" in - raw) - _pdev=$(persistent_policy="by-id" kdump_get_persistent_dev "$_val") -diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh -index 39e52a6..97760bf 100755 ---- a/kdump-lib-initramfs.sh -+++ b/kdump-lib-initramfs.sh -@@ -29,10 +29,9 @@ kdump_read_conf() - kdump_get_conf_val() - { - # For lines matching "^\s*$1\s+", remove matched part (config name including space), -- # remove tailing comment, space and the surrounding quotes, then store in hold space. -- # Print out the hold buffer on last line. -+ # remove tailing comment, space, then store in hold space. Print out the hold buffer on last line. - [ -f "$KDUMP_CONFIG_FILE" ] && -- sed -n -e "/^\s*\($1\)\s\+/{s/^\s*\($1\)\s\+//;s/#.*//;s/\s*$//;s/^\"\(.*\)\"$/\1/;h};\${x;p}" $KDUMP_CONFIG_FILE -+ sed -n -e "/^\s*\($1\)\s\+/{s/^\s*\($1\)\s\+//;s/#.*//;s/\s*$//;h};\${x;p}" $KDUMP_CONFIG_FILE - } - - is_mounted() -diff --git a/kdumpctl b/kdumpctl -index d630820..e47396e 100755 ---- a/kdumpctl -+++ b/kdumpctl -@@ -324,7 +324,6 @@ _set_config() - fi - return 1 - fi -- [[ $_val == \"*\" ]] && _val=${_val:1:-1} - OPT[$opt]="$val" - } - --- -2.51.1 - diff --git a/0007-kdump-lib-initramfs-rewrite-kdump_get_conf_val.patch b/0007-kdump-lib-initramfs-rewrite-kdump_get_conf_val.patch deleted file mode 100644 index 53c54f6..0000000 --- a/0007-kdump-lib-initramfs-rewrite-kdump_get_conf_val.patch +++ /dev/null @@ -1,123 +0,0 @@ -From d81109cf9291250b42434fc51798c93b613c4ee2 Mon Sep 17 00:00:00 2001 -From: Philipp Rudo -Date: Thu, 6 Nov 2025 15:07:42 +0100 -Subject: [PATCH 7/7] kdump-lib-initramfs: rewrite kdump_get_conf_val - -Previously, kdump_get_conf_val() relied on a "magic" regular -expression to parse kdump.conf, making maintenance and -extension difficult. This patch rewrites the parsing logic -to be more human-readable. - -The '\|' needs to be changed to a single '|' because after -the rewrite we will use another tool to parse the options to -find. - -Furthermore, kdump_read_conf() has been refactored to invoke -kdump_get_conf_val(), as their logic is functionally identical. - -Signed-off-by: Philipp Rudo -Signed-off-by: Lichen Liu ---- - kdump-lib-initramfs.sh | 49 +++++++++++++++++++++++++++++++++++------- - kdump-lib.sh | 6 +++--- - 2 files changed, 44 insertions(+), 11 deletions(-) - -diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh -index 97760bf..6f5d6db 100755 ---- a/kdump-lib-initramfs.sh -+++ b/kdump-lib-initramfs.sh -@@ -19,19 +19,52 @@ LUKS_KEY_PRFIX="kdump-cryptsetup:vk-" - # Read kdump config in well formated style - kdump_read_conf() - { -- # Following steps are applied in order: strip trailing comment, strip trailing space, -- # strip heading space, match non-empty line, remove duplicated spaces between conf name and value -- [ -f "$KDUMP_CONFIG_FILE" ] && sed -n -e "s/#.*//;s/\s*$//;s/^\s*//;s/\(\S\+\)\s*\(.*\)/\1 \2/p" $KDUMP_CONFIG_FILE -+ kdump_get_conf_val "" - } - - # Retrieves config value defined in kdump.conf --# $1: config name, sed regexp compatible -+# $1: config name, if empty print full config - kdump_get_conf_val() - { -- # For lines matching "^\s*$1\s+", remove matched part (config name including space), -- # remove tailing comment, space, then store in hold space. Print out the hold buffer on last line. -- [ -f "$KDUMP_CONFIG_FILE" ] && -- sed -n -e "/^\s*\($1\)\s\+/{s/^\s*\($1\)\s\+//;s/#.*//;s/\s*$//;h};\${x;p}" $KDUMP_CONFIG_FILE -+ _to_find="$1" -+ _found="" -+ -+ [ -f "$KDUMP_CONFIG_FILE" ] || return -+ while read -r _line; do -+ _line="$(echo "$_line" | tr -s "[:blank:]" " ")" -+ case "$_line" in -+ "" | \#*) -+ continue -+ ;; -+ *\#*) -+ _line="${_line%%\#*}" -+ _line="${_line% }" -+ ;; -+ esac -+ -+ _opt=${_line%% *} -+ _val=${_line#* } -+ -+ case "$_val" in -+ \"*\") -+ # Remove quotes -+ _val="${_val#\"}" -+ _val="${_val%\"}" -+ ;; -+ esac -+ -+ if [ -z "$_to_find" ]; then -+ echo "$_opt $_val" -+ elif echo "$_opt" | grep -q -E "^($_to_find)$"; then -+ # make sure to only return the last match to mirror the -+ # old behavior -+ _found="$_val" -+ fi -+ done < "$KDUMP_CONFIG_FILE" -+ [ -n "$_found" ] && echo "$_found" -+ -+ # make sure we return 0 even when a option isn't set -+ return 0 - } - - is_mounted() -diff --git a/kdump-lib.sh b/kdump-lib.sh -index 4196b0e..61da1f7 100755 ---- a/kdump-lib.sh -+++ b/kdump-lib.sh -@@ -87,7 +87,7 @@ to_dev_name() - - is_user_configured_dump_target() - { -- [[ $(kdump_get_conf_val "ext[234]\|xfs\|btrfs\|minix\|raw\|nfs\|ssh\|virtiofs") ]] || is_mount_in_dracut_args -+ [[ $(kdump_get_conf_val "ext[234]|xfs|btrfs|minix|raw|nfs|ssh|virtiofs") ]] || is_mount_in_dracut_args - } - - get_block_dump_target() -@@ -98,7 +98,7 @@ get_block_dump_target() - return - fi - -- _target=$(kdump_get_conf_val "ext[234]\|xfs\|btrfs\|minix\|raw\|virtiofs") -+ _target=$(kdump_get_conf_val "ext[234]|xfs|btrfs|minix|raw|virtiofs") - [[ -n $_target ]] && to_dev_name "$_target" && return - - _target=$(get_dracut_args_target "$(kdump_get_conf_val "dracut_args")") -@@ -116,7 +116,7 @@ get_block_dump_target() - - is_dump_to_rootfs() - { -- [[ $(kdump_get_conf_val 'failure_action\|default') == dump_to_rootfs ]] -+ [[ $(kdump_get_conf_val 'failure_action|default') == dump_to_rootfs ]] - } - - is_lvm2_thinp_dump_target() --- -2.51.1 - diff --git a/0008-Add-persisent-device-if-FIPS-is-enabled.patch b/0008-Add-persisent-device-if-FIPS-is-enabled.patch deleted file mode 100644 index 2333624..0000000 --- a/0008-Add-persisent-device-if-FIPS-is-enabled.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 2de96daa10a7e30a7b1a6bb4331e831a8f794c4a Mon Sep 17 00:00:00 2001 -From: Harshvardhan Jha -Date: Thu, 30 Oct 2025 00:59:17 -0700 -Subject: [PATCH] Add persisent device if FIPS is enabled - -mkdumprd has a code to add a disk to kdump initramfs, in case FIPS is -enabled and /boot is on a separate partition. This code used to work, -since dracut was not force checking that added disk is in fact -available. Since dracut commit c79fc8f dracut in fact checks for added -device, and since disk name could have been changed between live system -and kdump initramfs, kdump can fail. -To resolve this problem we re-use get_persistent_dev from -dracut-functions.sh which will be sourced by mkdrumpd to get persistent -device name. - -Signed-off-by: Alex Burmashev -Signed-off-by: Harshvardhan Jha ---- - mkdumprd | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/mkdumprd b/mkdumprd -index caca83b..f1116d1 100644 ---- a/mkdumprd -+++ b/mkdumprd -@@ -433,8 +433,9 @@ if ! is_fadump_capable; then - # to /sysroot beforehand. - if [[ $(cat /proc/sys/crypto/fips_enabled 2> /dev/null) == 1 ]]; then - _boot_source=$(findmnt -n -o SOURCE --target /boot) -+ _disk_persistent=$(get_persistent_dev "$_boot_source") - if mountpoint -q /boot; then -- dracut_args+=(--add-device "$_boot_source") -+ dracut_args+=(--add-device "$_disk_persistent") - else - add_mount "$_boot_source" - fi --- -2.52.0 - diff --git a/0009-kdump.sh-Centralize-the-F-suboption-handling.patch b/0009-kdump.sh-Centralize-the-F-suboption-handling.patch deleted file mode 100644 index 04a8b25..0000000 --- a/0009-kdump.sh-Centralize-the-F-suboption-handling.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 837f1c9a8bd7fd898eb848bd473a32d8eee30307 Mon Sep 17 00:00:00 2001 -From: Pingfan Liu -Date: Fri, 28 Nov 2025 09:49:35 +0800 -Subject: [PATCH 1/3] kdump.sh: Centralize the -F suboption handling - -Signed-off-by: Pingfan Liu ---- - dracut/99kdumpbase/kdump.sh | 21 +++++++++++---------- - 1 file changed, 11 insertions(+), 10 deletions(-) - -diff --git a/dracut/99kdumpbase/kdump.sh b/dracut/99kdumpbase/kdump.sh -index 7c4c71c..0fd94c0 100755 ---- a/dracut/99kdumpbase/kdump.sh -+++ b/dracut/99kdumpbase/kdump.sh -@@ -22,8 +22,7 @@ KDUMP_LOG_DEST="" - KDUMP_LOG_OP="" - KDUMP_TEST_ID="" - KDUMP_TEST_STATUS="" --CORE_COLLECTOR="" --DEFAULT_CORE_COLLECTOR="makedumpfile -l --message-level 7 -d 31" -+CORE_COLLECTOR="makedumpfile -l --message-level 7 -d 31" - DMESG_COLLECTOR="/sbin/vmcore-dmesg" - FAILURE_ACTION="systemctl reboot -f" - DATEDIR=$(date +%Y-%m-%d-%T) -@@ -108,12 +107,16 @@ get_kdump_confs() { - esac - done < "$KDUMP_CONF_PARSED" - -- if [ -z "$CORE_COLLECTOR" ]; then -- CORE_COLLECTOR="$DEFAULT_CORE_COLLECTOR" -- if is_ssh_dump_target || is_raw_dump_target; then -- CORE_COLLECTOR="$CORE_COLLECTOR -F" -- fi -- fi -+ case $CORE_COLLECTOR in -+ *makedumpfile*) -+ # Ensure no -F in makedumpfile by default. -+ CORE_COLLECTOR=$(echo "$CORE_COLLECTOR" | sed -e "s/-F//g") -+ if is_ssh_dump_target || is_raw_dump_target; then -+ CORE_COLLECTOR="$CORE_COLLECTOR -F" -+ fi -+ ;; -+ esac -+ - } - - # store the kexec kernel log to a file. -@@ -145,10 +148,8 @@ dump_fs() { - fi - fi - -- # Remove -F in makedumpfile case. We don't want a flat format dump here. - case $CORE_COLLECTOR in - *makedumpfile*) -- CORE_COLLECTOR=$(echo "$CORE_COLLECTOR" | sed -e "s/-F//g") - THREADS=$(nproc) - if [ "$THREADS" -gt 1 ]; then - CORE_COLLECTOR="$CORE_COLLECTOR --num-threads=$THREADS" --- -2.49.0 - diff --git a/0010-kdump.sh-Centralize-the-num-threads-sub-option-handl.patch b/0010-kdump.sh-Centralize-the-num-threads-sub-option-handl.patch deleted file mode 100644 index 6c56e36..0000000 --- a/0010-kdump.sh-Centralize-the-num-threads-sub-option-handl.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 23bbb1156fe6fc03a3744ce538d908ad9cb0b694 Mon Sep 17 00:00:00 2001 -From: Pingfan Liu -Date: Thu, 27 Nov 2025 15:24:18 +0800 -Subject: [PATCH 2/3] kdump.sh: Centralize the num-threads sub-option handling - -The handling of num-threads is duplicated in dump_fs() and dump_raw(). -Centralize them into get_kdump_confs() - -Signed-off-by: Pingfan Liu ---- - dracut/99kdumpbase/kdump.sh | 20 ++++---------------- - 1 file changed, 4 insertions(+), 16 deletions(-) - -diff --git a/dracut/99kdumpbase/kdump.sh b/dracut/99kdumpbase/kdump.sh -index 0fd94c0..656911f 100755 ---- a/dracut/99kdumpbase/kdump.sh -+++ b/dracut/99kdumpbase/kdump.sh -@@ -114,6 +114,10 @@ get_kdump_confs() { - if is_ssh_dump_target || is_raw_dump_target; then - CORE_COLLECTOR="$CORE_COLLECTOR -F" - fi -+ THREADS=$(nproc) -+ if [ "$THREADS" -gt 1 ]; then -+ CORE_COLLECTOR="$CORE_COLLECTOR --num-threads=$THREADS" -+ fi - ;; - esac - -@@ -148,15 +152,6 @@ dump_fs() { - fi - fi - -- case $CORE_COLLECTOR in -- *makedumpfile*) -- THREADS=$(nproc) -- if [ "$THREADS" -gt 1 ]; then -- CORE_COLLECTOR="$CORE_COLLECTOR --num-threads=$THREADS" -- fi -- ;; -- esac -- - if [ -z "$KDUMP_TEST_ID" ]; then - _dump_fs_path=$(echo "$1/$KDUMP_PATH/$HOST_IP-$DATEDIR/" | tr -s /) - else -@@ -385,13 +380,6 @@ dump_raw() { - /kdumpscripts/monitor_dd_progress.sh $_src_size_mb & - fi - -- if echo "$CORE_COLLECTOR" | grep -q makedumpfile; then -- THREADS=$(nproc) -- if [ "$THREADS" -gt 1 ]; then -- CORE_COLLECTOR="$CORE_COLLECTOR --num-threads=$THREADS" -- fi -- fi -- - dinfo "saving vmcore" - $CORE_COLLECTOR /proc/vmcore | dd of="$1" bs=$DD_BLKSIZE >> /tmp/dd_progress_file 2>&1 || return 1 - sync --- -2.49.0 - diff --git a/0011-kdump.sh-Skip-num-threads-when-E-and-F-option-is-pre.patch b/0011-kdump.sh-Skip-num-threads-when-E-and-F-option-is-pre.patch deleted file mode 100644 index 9e8aafd..0000000 --- a/0011-kdump.sh-Skip-num-threads-when-E-and-F-option-is-pre.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 9a51c4b4742b7bf778e2dc32cff24d94bb2a5cd1 Mon Sep 17 00:00:00 2001 -From: Pingfan Liu -Date: Fri, 28 Nov 2025 13:51:21 +0800 -Subject: [PATCH 3/3] kdump.sh: Skip num-threads when -E and -F option is - present - -Resolves: https://issues.redhat.com/browse/RHEL-75537 - -Configure "makedumpfile -E -d 31" in kdump.conf, and panic the system, kdump will fail with the error as: - -[ 41.891856] kdump.sh[724]: --num-threads cannot used with ELF format. -[ 41.897104] kdump.sh[724]: Commandline parameter is invalid. -[ 41.897290] kdump.sh[724]: Try `makedumpfile --help' for more information. -[ 41.897435] kdump.sh[724]: makedumpfile Failed. -[ 41.898804] kdump[726]: -saving vmcore failed, exitcode:1 - -Skip --num-threads when -E option is given. - -As for the -F option, it is meaningless to sequentially access linear -addresses with multiple threads Skip --num-threads too in that case. - -Signed-off-by: Pingfan Liu ---- - dracut/99kdumpbase/kdump.sh | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/dracut/99kdumpbase/kdump.sh b/dracut/99kdumpbase/kdump.sh -index 656911f..5155453 100755 ---- a/dracut/99kdumpbase/kdump.sh -+++ b/dracut/99kdumpbase/kdump.sh -@@ -116,7 +116,13 @@ get_kdump_confs() { - fi - THREADS=$(nproc) - if [ "$THREADS" -gt 1 ]; then -- CORE_COLLECTOR="$CORE_COLLECTOR --num-threads=$THREADS" -+ case "$CORE_COLLECTOR" in -+ *-F* | *-E*) ;; -+ -+ *) -+ CORE_COLLECTOR="$CORE_COLLECTOR --num-threads=$THREADS" -+ ;; -+ esac - fi - ;; - esac --- -2.49.0 - diff --git a/0012-powerpc-consider-CPU-count-while-calculating-crashke.patch b/0012-powerpc-consider-CPU-count-while-calculating-crashke.patch deleted file mode 100644 index 8ef1840..0000000 --- a/0012-powerpc-consider-CPU-count-while-calculating-crashke.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 0d389855086ca3f1de8421c540ade79d403e1abd Mon Sep 17 00:00:00 2001 -From: Sourabh Jain -Date: Sat, 23 Aug 2025 22:29:10 +0530 -Subject: [PATCH 1/2] powerpc: consider CPU count while calculating crashkernel - value - -The next patch in the series adds more CPUs to the capture kernel, -which increases the memory requirement for the capture kernel. -Experiments show that powerpc needs 1 MB of additional memory for every -CPU added. - -Therefore, while calculating the crashkernel size, make sure to include -an additional 1 MB for every CPU configured in the capture kernel. - -The changes are implemented in such a way that if the user changes the -nr_cpus value in the kdump configuration, the script will adapt -accordingly. - -Signed-off-by: Sourabh Jain ---- - kdump-lib.sh | 38 ++++++++++++++++++++++++++++++++++++++ - 1 file changed, 38 insertions(+) - -diff --git a/kdump-lib.sh b/kdump-lib.sh -index 61da1f7..816a6ff 100755 ---- a/kdump-lib.sh -+++ b/kdump-lib.sh -@@ -974,6 +974,36 @@ _crashkernel_add() - echo "${ret%,}" - } - -+# Parses the kdump or fadump command line to extract a valid -+# positive nr_cpus= value, defaulting to 1 if none is found. -+find_nr_cpus() -+{ -+ local _cmdline_append -+ local _nr_cpus=1 -+ -+ # shellcheck disable=SC2153 -+ if [[ $DEFAULT_DUMP_MODE == "fadump" ]]; then -+ _cmdline_append="$FADUMP_COMMANDLINE_APPEND" -+ else -+ _cmdline_append="$KDUMP_COMMANDLINE_APPEND" -+ fi -+ -+ for arg in $_cmdline_append; do -+ case $arg in -+ nr_cpus=[0-9]*) -+ # Only accept if it's strictly digits after '=' -+ value=${arg#nr_cpus=} -+ if [[ $value =~ ^[1-9][0-9]*$ ]]; then -+ _nr_cpus=$value -+ fi -+ ;; -+ esac -+ done -+ -+ ddebug "Configured nr_cpus=$_nr_cpus" -+ echo "$_nr_cpus" -+} -+ - # get default crashkernel - # $1 dump mode, if not specified, dump_mode will be judged by is_fadump_capable - # $2 kernel-release, if not specified, got by _get_kdump_kernel_version -@@ -1024,6 +1054,14 @@ kdump_get_arch_recommend_crashkernel() - has_mlx5 && ((_delta += 150)) - fi - elif [[ $_arch == "ppc64le" ]]; then -+ local _per_cpu_area -+ local _nr_cpus -+ -+ # 1MB per CPU -+ _per_cpu_area=1 -+ _nr_cpus=$(find_nr_cpus) -+ -+ _delta=$((_delta + _per_cpu_area * _nr_cpus)) - if [[ $_dump_mode == "fadump" ]]; then - _ck_cmdline="4G-16G:768M,16G-64G:1G,64G-128G:2G,128G-1T:4G,1T-2T:6G,2T-4T:12G,4T-8T:20G,8T-16T:36G,16T-32T:64G,32T-64T:128G,64T-:180G" - else --- -2.49.0 - diff --git a/0013-powerpc-Set-nr_cpus-16-for-kdump-kernel.patch b/0013-powerpc-Set-nr_cpus-16-for-kdump-kernel.patch deleted file mode 100644 index 0b68548..0000000 --- a/0013-powerpc-Set-nr_cpus-16-for-kdump-kernel.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 2f360e819ae7b80347c567c29a9ead979edb6ed3 Mon Sep 17 00:00:00 2001 -From: Pingfan Liu -Date: Tue, 16 Dec 2025 11:02:33 +0800 -Subject: [PATCH] powerpc: Set nr_cpus=16 for kdump kernel - -Signed-off-by: Pingfan Liu ---- - 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 eb5287b..53115c1 100755 ---- a/gen-kdump-sysconfig.sh -+++ b/gen-kdump-sysconfig.sh -@@ -100,7 +100,7 @@ ppc64le) - update_param KDUMP_COMMANDLINE_REMOVE \ - "hugepages hugepagesz slub_debug quiet log_buf_len swiotlb hugetlb_cma ignition.firstboot" - update_param KDUMP_COMMANDLINE_APPEND \ -- "irqpoll nr_cpus=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 kfence.sample_interval=0" -+ "irqpoll nr_cpus=16 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 kfence.sample_interval=0" - update_param FADUMP_COMMANDLINE_APPEND \ - "nr_cpus=16 numa=off cgroup_disable=memory cma=0 kvm_cma_resv_ratio=0 hugetlb_cma=0 transparent_hugepage=never novmcoredd udev.children-max=2" - ;; --- -2.49.0 - diff --git a/0014-kexec-kdump-howto.txt-update-paragraphs-related-to-d.patch b/0014-kexec-kdump-howto.txt-update-paragraphs-related-to-d.patch deleted file mode 100644 index af41cd4..0000000 --- a/0014-kexec-kdump-howto.txt-update-paragraphs-related-to-d.patch +++ /dev/null @@ -1,73 +0,0 @@ -From e22ca9248de44a71cdd51e0630456e53fe2554c1 Mon Sep 17 00:00:00 2001 -From: Baoquan He -Date: Thu, 11 Dec 2025 16:56:15 +0800 -Subject: [PATCH] kexec-kdump-howto.txt: update paragraphs related to - disable_cpu_apicid -Content-type: text/plain - -Long before, to support multiple CPUs on x86_64, 'disable_cpu_apicid=' -was introduced. It's to avoid the case when nr_cpus=xx is added, while -crashed cpu is not BSP cpu, then the crashed CPU will send INIT to BSP -cpu in kdump kernel. While the BSP cpu being reinitialized when -receiving INIT in the 2nd time will cause kdump kernel collapsing. - -Now, in kernel commit 5c5682b9f87a ("x86/cpu: Detect real BSP on crash -kernels"), the requirement of disable_cpu_apicid has been taken off by -detecting real BSP on crashed kernel and not sending INIT to it. -Now testing passed on x86_64 system w/ or w/o disable_cpu_apicid and the -kernel message can be seen as below. - -=============== -CPU topo: Boot CPU APIC ID not the first enumerated APIC ID: 1e != 0 -CPU topo: Crash kernel detected. Disabling real BSP to prevent machine INIT -=============== - -However, sometime older kernels which don't contain commit 5c5682b9f87a -are still loaded in newer OS. To keep good back compatibility, still -adding disable_cpu_apicid to capture kernel. It's not harmful on newer -kernels containing commit 5c5682b9f87a. - -Signed-off-by: Baoquan He ---- - kexec-kdump-howto.txt | 18 +++++++++++------- - 1 file changed, 11 insertions(+), 7 deletions(-) - -diff --git a/kexec-kdump-howto.txt b/kexec-kdump-howto.txt -index ba617aeeeb39..5d205a5cb6fc 100644 ---- a/kexec-kdump-howto.txt -+++ b/kexec-kdump-howto.txt -@@ -935,10 +935,14 @@ For example: - - Notes on how to use multiple cpus on a capture kernel on x86 system: - --Make sure that you are using a kernel that supports disable_cpu_apicid --kernel option as a capture kernel, which is needed to avoid x86 specific --hardware issue (*). The disable_cpu_apicid kernel option is automatically --appended by kdumpctl script and is ignored if the kernel doesn't support it. -+The disable_cpu_apicid kernel option is automatically appended by kdumpctl -+script to capture kernel to avoid x86 specific hardware issue and is ignored -+if the kernel doesn't support it. For newer kernels that contain commit -+5c5682b9f87a ("x86/cpu: Detect real BSP on crash kernels"), this hardware -+issue on x86 has been fixed in the kernel. However, adding disable_cpu_apicid -+is not harmful for newer kernels, and it is still added to the capture kernel -+to maintain backward compatibility with older kernels that do not contain -+commit 5c5682b9f87a. - - You need to specify how many cpus to be used in a capture kernel by specifying - the number of cpus in nr_cpus kernel option in /etc/sysconfig/kdump. nr_cpus -@@ -948,9 +952,9 @@ You should use necessary and sufficient number of cpus on a capture kernel. - Warning: Don't use too many cpus on a capture kernel, or the capture kernel - may lead to panic due to Out Of Memory. - --(*) Without disable_cpu_apicid kernel option, capture kernel may lead to --hang, system reset or power-off at boot, depending on your system and runtime --situation at the time of crash. -+(*) Without the disable_cpu_apicid kernel option, a capture kernel that does -+not contain commit 5c5682b9f87a may hang, reset, or power-off at boot, -+depending on your system and runtime situation at the time of the crash. - - - Debugging Tips --- -2.41.0 - diff --git a/0015-kdump-lib-initramfs-Fix-performance-regression-in-kd.patch b/0015-kdump-lib-initramfs-Fix-performance-regression-in-kd.patch deleted file mode 100644 index cb528ac..0000000 --- a/0015-kdump-lib-initramfs-Fix-performance-regression-in-kd.patch +++ /dev/null @@ -1,131 +0,0 @@ -From b43908c20f5a028c60b0096006a26a6e52a01279 Mon Sep 17 00:00:00 2001 -From: Philipp Rudo -Date: Wed, 14 Jan 2026 15:54:25 +0100 -Subject: [PATCH] kdump-lib-initramfs: Fix performance regression in - kdump_get_conf_val - -Rewriting kdump_get_conf_val in Bash lead to a massive performance -regression. On my test system starting the kdump service took - -$ time kdumpctl start -real 0m13.134s -user 0m8.828s -sys 0m7.450s - -which is ~20 times slower compared to kdump-utils-1.0.59-1.fc44 with - -$ time kdumpctl start -real 0m0.641s -user 0m0.208s -sys 0m0.538s - -Looking at the traces shows that this is caused because Bash now has to -handle the whole kdump.conf, including the extensive comment at the -start, every time kdump_get_conf_val is called. This is done multiple -times when starting the kdump service and is often cloaked by other -functions, e.g. is_ssh_dump_target() or get_save_path(). - -To fix the issue remove comments and empty lines in a regex again so -that the Bash code only has to handle valid config entries. With this -change alone the performance is almost as good as the original version -with - -$ time kdumpctl start -real 0m0.780s -user 0m0.330s -sys 0m0.604s - -In the long run it would make sense to also reduce the number of calls -to kdump_get_conf_val. - -This patch also fixes the issue that subsequent blanks are replaced by a -single space. Usually this is not an issue but there are corner cases, -e.g. in printf-like format strings passed as an argument, where the new -behaviour is undesirable. - -Fixes: d81109c ("kdump-lib-initramfs: rewrite kdump_get_conf_val") -Signed-off-by: Philipp Rudo ---- - kdump-lib-initramfs.sh | 66 ++++++++++++++++++++++-------------------- - 1 file changed, 34 insertions(+), 32 deletions(-) - -diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh -index 6f5d6db..6c64106 100755 ---- a/kdump-lib-initramfs.sh -+++ b/kdump-lib-initramfs.sh -@@ -30,38 +30,40 @@ kdump_get_conf_val() - _found="" - - [ -f "$KDUMP_CONFIG_FILE" ] || return -- while read -r _line; do -- _line="$(echo "$_line" | tr -s "[:blank:]" " ")" -- case "$_line" in -- "" | \#*) -- continue -- ;; -- *\#*) -- _line="${_line%%\#*}" -- _line="${_line% }" -- ;; -- esac -- -- _opt=${_line%% *} -- _val=${_line#* } -- -- case "$_val" in -- \"*\") -- # Remove quotes -- _val="${_val#\"}" -- _val="${_val%\"}" -- ;; -- esac -- -- if [ -z "$_to_find" ]; then -- echo "$_opt $_val" -- elif echo "$_opt" | grep -q -E "^($_to_find)$"; then -- # make sure to only return the last match to mirror the -- # old behavior -- _found="$_val" -- fi -- done < "$KDUMP_CONFIG_FILE" -- [ -n "$_found" ] && echo "$_found" -+ -+ # On lines that are _not_ comments or empty remove... -+ # Note: The additional braces {} are required as piping into a while -+ # loop creates a sub-shell. So without the braces $_found would only be -+ # set inside the loop but empty outside of it. -+ grep -Ev -e '^\s*#' -e '^\s*$' "$KDUMP_CONFIG_FILE" | { -+ while read -r _opt _val; do -+ # ...trailing comments... -+ case "$_val" in -+ *\#*) -+ _val="${_val%%#*}" -+ _val="${_val%"${_val##*[![:space:]]}"}" -+ ;; -+ esac -+ -+ # ...quotes -+ case "$_val" in -+ \"*\") -+ _val="${_val#\"}" -+ _val="${_val%\"}" -+ ;; -+ esac -+ -+ if [ -z "$_to_find" ]; then -+ echo "$_opt $_val" -+ elif echo "$_opt" | grep -q -E "^($_to_find)$"; then -+ # make sure to only return the last match to -+ # mirror the old behavior -+ _found="$_val" -+ fi -+ done -+ -+ [ -n "$_found" ] && echo "$_found" -+ } - - # make sure we return 0 even when a option isn't set - return 0 --- -2.52.0 - diff --git a/0016-sysconfig-use-initramfs_options-to-reduce-memory-usa.patch b/0016-sysconfig-use-initramfs_options-to-reduce-memory-usa.patch deleted file mode 100644 index 05acaf5..0000000 --- a/0016-sysconfig-use-initramfs_options-to-reduce-memory-usa.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 1bfd6e6fe97cd8497bbfb1e1ba76929bd87a9553 Mon Sep 17 00:00:00 2001 -From: Lichen Liu -Date: Thu, 4 Dec 2025 13:37:26 +0800 -Subject: [PATCH] sysconfig: use initramfs_options to reduce memory usage - -Starting with Linux 6.18, Fedora 42, RHEL 10.2, and RHEL 9.8, the -kernel supports the `initramfs_options` boot parameter. - -Sets `initramfs_options=size=90%` can increase the size of the tmpfs -used for initramfs decompression from the default 50% to 90% of memory. - -This change greatly reduces memory pressure during decompression, -allowing for a reduction in the memory reserved for the crashkernel. - -Signed-off-by: Lichen Liu ---- - gen-kdump-sysconfig.sh | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/gen-kdump-sysconfig.sh b/gen-kdump-sysconfig.sh -index 53115c1..164fff5 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 initramfs_options=size=90%" - - # This variable lets us append arguments to fadump (powerpc) capture kernel, - # further to the parameters passed via the bootloader. -@@ -82,25 +82,25 @@ 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 kfence.sample_interval=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 initramfs_options=size=90%" - ;; - 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 kfence.sample_interval=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 initramfs_options=size=90%" - ;; - 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 kfence.sample_interval=0" -+ "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 kfence.sample_interval=0 initramfs_options=size=90%" - ;; - ppc64le) - update_param KEXEC_ARGS "-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 nr_cpus=16 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 kfence.sample_interval=0" -+ "irqpoll nr_cpus=16 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 kfence.sample_interval=0 initramfs_options=size=90%" - update_param FADUMP_COMMANDLINE_APPEND \ - "nr_cpus=16 numa=off cgroup_disable=memory cma=0 kvm_cma_resv_ratio=0 hugetlb_cma=0 transparent_hugepage=never novmcoredd udev.children-max=2" - ;; -@@ -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 kfence.sample_interval=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 initramfs_options=size=90%" - ;; - 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 kfence.sample_interval=0" -+ "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 initramfs_options=size=90%" - ;; - *) - echo "Warning: Unknown architecture '$1', using default sysconfig template." >&2 --- -2.52.0 - diff --git a/0017-kdumpctl-clean-up-backup-restore-_default_initrd.patch b/0017-kdumpctl-clean-up-backup-restore-_default_initrd.patch deleted file mode 100644 index d75e64e..0000000 --- a/0017-kdumpctl-clean-up-backup-restore-_default_initrd.patch +++ /dev/null @@ -1,103 +0,0 @@ -From 9d716888ac9b0a2e47bc6728a74013ade0da072e Mon Sep 17 00:00:00 2001 -From: Philipp Rudo -Date: Tue, 19 Aug 2025 12:13:40 +0200 -Subject: [PATCH] kdumpctl: clean up {backup,restore}_default_initrd - -The sha1 algorithm used is no longer considered secure. In addition the -shaXsum commands have a --check option that reads checksums stored in a -file and verifies them. So there is no need for the home grown -verification in restore_default_initrd. - -While at it refractor the two functions slightly to increase their -readability and add additional debug messages. - -Signed-off-by: Philipp Rudo -Signed-off-by: Coiby Xu ---- - kdumpctl | 54 ++++++++++++++++++++++++++++++++---------------------- - 1 file changed, 32 insertions(+), 22 deletions(-) - -diff --git a/kdumpctl b/kdumpctl -index 13f341f..2d2c81a 100755 ---- a/kdumpctl -+++ b/kdumpctl -@@ -243,19 +243,22 @@ backup_default_initrd() - ddebug "backup default initrd: $DEFAULT_INITRD" - - if [[ ! -f $DEFAULT_INITRD ]]; then -+ ddebug "\$DEFAULT_INITRD=$DEFAULT_INITRD does not exist" - return - fi - -- if [[ ! -e $DEFAULT_INITRD_BAK ]]; then -- dinfo "Backing up $DEFAULT_INITRD before rebuild." -- # save checksum to verify before restoring -- sha1sum "$DEFAULT_INITRD" > "$INITRD_CHECKSUM_LOCATION" -- if ! cp "$DEFAULT_INITRD" "$DEFAULT_INITRD_BAK"; then -- dwarn "WARNING: failed to backup $DEFAULT_INITRD." -- rm -f -- "$INITRD_CHECKSUM_LOCATION" -- rm -f -- "$DEFAULT_INITRD_BAK" -- fi -+ if [[ -f $DEFAULT_INITRD_BAK ]]; then -+ ddebug "\$DEFAULT_INITRD_BAK=$DEFAULT_INITRD_BAK already exist" -+ return -+ fi -+ -+ dinfo "Backing up $DEFAULT_INITRD before rebuild." -+ if ! cp "$DEFAULT_INITRD" "$DEFAULT_INITRD_BAK"; then -+ dwarn "WARNING: failed to backup $DEFAULT_INITRD." -+ rm -f -- "$DEFAULT_INITRD_BAK" -+ return - fi -+ sha512sum "$DEFAULT_INITRD_BAK" > "$INITRD_CHECKSUM_LOCATION" - } - - restore_default_initrd() -@@ -263,24 +266,31 @@ restore_default_initrd() - ddebug "restore default initrd: $DEFAULT_INITRD" - - if [[ ! -f $DEFAULT_INITRD ]]; then -+ ddebug "\$DEFAULT_INITRD=$DEFAULT_INITRD does not exist" -+ return -+ fi -+ -+ if [[ ! -f $DEFAULT_INITRD_BAK ]]; then -+ ddebug "\$DEFAULT_INITRD_BAK=$DEFAULT_INITRD_BAK does not exist" -+ return -+ fi -+ -+ if [[ ! -f $INITRD_CHECKSUM_LOCATION ]]; then -+ ddebug "\$INITRD_CHECKSUM_LOCATION=$INITRD_CHECKSUM_LOCATION does not exist" - return - fi - - # If a backup initrd exists, we must be switching back from - # fadump to kdump. Restore the original default initrd. -- if [[ -f $DEFAULT_INITRD_BAK ]] && [[ -f $INITRD_CHECKSUM_LOCATION ]]; then -- # verify checksum before restoring -- backup_checksum=$(sha1sum "$DEFAULT_INITRD_BAK" | awk '{ print $1 }') -- default_checksum=$(awk '{ print $1 }' "$INITRD_CHECKSUM_LOCATION") -- if [[ $default_checksum != "$backup_checksum" ]]; then -- dwarn "WARNING: checksum mismatch! Can't restore original initrd.." -- else -- rm -f "$INITRD_CHECKSUM_LOCATION" -- if mv "$DEFAULT_INITRD_BAK" "$DEFAULT_INITRD"; then -- derror "Restoring original initrd as fadump mode is disabled." -- sync -f "$DEFAULT_INITRD" -- fi -- fi -+ if ! sha512sum --status --check "$INITRD_CHECKSUM_LOCATION"; then -+ dwarn "WARNING: checksum mismatch! Can't restore original initrd." -+ return -+ fi -+ -+ rm -f "$INITRD_CHECKSUM_LOCATION" -+ if mv "$DEFAULT_INITRD_BAK" "$DEFAULT_INITRD"; then -+ derror "Restoring original initrd as fadump mode is disabled." -+ sync -f "$DEFAULT_INITRD" - fi - } - --- -2.52.0 - diff --git a/0018-kdumpctl-add-comments-to-different-initrd-variables.patch b/0018-kdumpctl-add-comments-to-different-initrd-variables.patch deleted file mode 100644 index 7483743..0000000 --- a/0018-kdumpctl-add-comments-to-different-initrd-variables.patch +++ /dev/null @@ -1,93 +0,0 @@ -From db47f86cf273a539d803bacc22a9fc825ef5af93 Mon Sep 17 00:00:00 2001 -From: Philipp Rudo -Date: Tue, 19 Aug 2025 12:44:30 +0200 -Subject: [PATCH] kdumpctl: add comments to different initrd variables - -kdumpctl has multiple variables for different initrds it is using. From -the variable names it is not always clear what the difference of those -initrds are. Thus add some comments to describe the differences and what -the initrds are used for. - -While at it rename INITRD_CHECKSUM_LOCATION to DEFAULT_INITRD_CHECKSUM -so it aligns better with the naming convention. - -Signed-off-by: Philipp Rudo -Signed-off-by: Coiby Xu ---- - kdumpctl | 26 +++++++++++++++++++------- - 1 file changed, 19 insertions(+), 7 deletions(-) - -diff --git a/kdumpctl b/kdumpctl -index 2d2c81a..dd69318 100755 ---- a/kdumpctl -+++ b/kdumpctl -@@ -7,11 +7,23 @@ KEXEC_ARGS="" - MKDUMPRD="/sbin/mkdumprd -f" - MKFADUMPRD="/sbin/mkfadumprd" - DRACUT_MODULES_FILE="/usr/lib/dracut/modules.txt" -+ -+# Path to the initrd used for normal boot. Used to determine the naming -+# convention and in case for fadump (and earlykdump) gets rebuild. - DEFAULT_INITRD="" -+ -+# Path to backup and checksum of the default initrd. Used to backup/restore the -+# default initrd for fadump. - DEFAULT_INITRD_BAK="" --INITRD_CHECKSUM_LOCATION="" -+DEFAULT_INITRD_CHECKSUM="" -+ -+# Path to the initrd used for kdump - KDUMP_INITRD="" -+ -+# Path to the initrd depending on the dump mode. Identical to KDUMP_INITRD for -+# kdump and DEFAULT_INITRD for fadump - TARGET_INITRD="" -+ - #kdump shall be the default dump mode - DEFAULT_DUMP_MODE="kdump" - VMCORE_CREATION_STATUS="/var/lib/kdump/vmcore-creation.status" -@@ -258,7 +270,7 @@ backup_default_initrd() - rm -f -- "$DEFAULT_INITRD_BAK" - return - fi -- sha512sum "$DEFAULT_INITRD_BAK" > "$INITRD_CHECKSUM_LOCATION" -+ sha512sum "$DEFAULT_INITRD_BAK" > "$DEFAULT_INITRD_CHECKSUM" - } - - restore_default_initrd() -@@ -275,19 +287,19 @@ restore_default_initrd() - return - fi - -- if [[ ! -f $INITRD_CHECKSUM_LOCATION ]]; then -- ddebug "\$INITRD_CHECKSUM_LOCATION=$INITRD_CHECKSUM_LOCATION does not exist" -+ if [[ ! -f $DEFAULT_INITRD_CHECKSUM ]]; then -+ ddebug "\$DEFAULT_INITRD_CHECKSUM=$DEFAULT_INITRD_CHECKSUM does not exist" - return - fi - - # If a backup initrd exists, we must be switching back from - # fadump to kdump. Restore the original default initrd. -- if ! sha512sum --status --check "$INITRD_CHECKSUM_LOCATION"; then -+ if ! sha512sum --status --check "$DEFAULT_INITRD_CHECKSUM"; then - dwarn "WARNING: checksum mismatch! Can't restore original initrd." - return - fi - -- rm -f "$INITRD_CHECKSUM_LOCATION" -+ rm -f "$DEFAULT_INITRD_CHECKSUM" - if mv "$DEFAULT_INITRD_BAK" "$DEFAULT_INITRD"; then - derror "Restoring original initrd as fadump mode is disabled." - sync -f "$DEFAULT_INITRD" -@@ -421,7 +433,7 @@ setup_initrd() - fi - - DEFAULT_INITRD_BAK="$KDUMP_BOOTDIR/.$(basename "$DEFAULT_INITRD").default" -- INITRD_CHECKSUM_LOCATION="$DEFAULT_INITRD_BAK.checksum" -+ DEFAULT_INITRD_CHECKSUM="$DEFAULT_INITRD_BAK.checksum" - if [[ $DEFAULT_DUMP_MODE == "fadump" ]]; then - TARGET_INITRD="$DEFAULT_INITRD" - --- -2.52.0 - diff --git a/0019-spec-drop-dependency-for-binutils.patch b/0019-spec-drop-dependency-for-binutils.patch deleted file mode 100644 index 1931020..0000000 --- a/0019-spec-drop-dependency-for-binutils.patch +++ /dev/null @@ -1,186 +0,0 @@ -From 48dd252bf8cc75c696d5d7e9a07efc838e3aad66 Mon Sep 17 00:00:00 2001 -From: Philipp Rudo -Date: Tue, 2 Sep 2025 13:28:32 +0200 -Subject: [PATCH] spec: drop dependency for binutils - -The binutils were added as dependency to support UKIs. With the main -part of the UKI support been moved to kexec-tools only one spot remains -in prepare_kdump_bootinfo where they are used. Refractor -prepare_kdump_bootinfo to get rid of the dependency. - -This slightly changes the behavior for UKIs. In particular the kdump -initrd is moved from /boot to /var/lib/kdump. - -While at it also simplify the logic in prepare_kdump_bootinfo as it is -unnecessarily complex and can lead to weird corner cases. For example if -the default initrd is located at /boot/$machine_id/$kernel_version/initrd -and the directory is not writable, then the kdump initrd would be stored -at /var/lib/kdump/initrdkdump without any information about the kernel -version. This can lead to all sorts of problems when multiple kernel -versions are installed. Thus always use -initramfs-${kernel_version}kdump.img when the initrd is stored at -/var/lib/kdump. Update 60-kdump.install accordingly. - -Signed-off-by: Philipp Rudo -Signed-off-by: Coiby Xu ---- - 60-kdump.install | 24 ++++++++++-------- - kdump-lib.sh | 64 +++++++++++++----------------------------------- - kdump-utils.spec | 2 -- - 3 files changed, 31 insertions(+), 59 deletions(-) - -diff --git a/60-kdump.install b/60-kdump.install -index 458adb6..7272a79 100755 ---- a/60-kdump.install -+++ b/60-kdump.install -@@ -10,16 +10,19 @@ if ! [[ ${KERNEL_INSTALL_MACHINE_ID-x} ]]; then - fi - - if [[ -d "$KDUMP_INITRD_DIR_ABS" ]]; then -- KDUMP_INITRD="initrdkdump" -+ KDUMP_INITRD="$KDUMP_INITRD_DIR_ABS/initrdkdump" - else -- # If `KDUMP_BOOTDIR` is not writable, then the kdump -- # initrd must have been placed at `/var/lib/kdump` -- if [[ ! -w "/boot" ]]; then -- KDUMP_INITRD_DIR_ABS="/var/lib/kdump" -- else -- KDUMP_INITRD_DIR_ABS="/boot" -- fi -- KDUMP_INITRD="initramfs-${KERNEL_VERSION}kdump.img" -+ # Usually the initrd is stored besides the kernel image in /boot. But there -+ # are some exceptions when /boot isn't writable or there is no "normal" -+ # initrd, e.g. for UKIs. In those cases the KDUMP_INITRD is stored in -+ # /var/lib/kdump. -+ -+ _initrd="initramfs-${KERNEL_VERSION}kdump.img" -+ for dir in "/boot" "/var/lib/kdump"; do -+ [[ -f "$dir/$_initrd" ]] || continue -+ KDUMP_INITRD="$dir/$_initrd" -+ break -+ done - fi - - ret=0 -@@ -34,7 +37,8 @@ case "$COMMAND" in - echo "Multiple entry types may exist, not removing kdump initrd." - exit 0 - fi -- rm -f -- "$KDUMP_INITRD_DIR_ABS/$KDUMP_INITRD" -+ [[ -n "$KDUMP_INITRD" ]] || exit 0 -+ rm -f -- "$KDUMP_INITRD" - ret=$? - ;; - esac -diff --git a/kdump-lib.sh b/kdump-lib.sh -index 32e43c6..639256c 100755 ---- a/kdump-lib.sh -+++ b/kdump-lib.sh -@@ -17,17 +17,6 @@ FADUMP_APPEND_ARGS_SYS_NODE="/sys/kernel/fadump/bootargs_append" - # shellcheck disable=SC2034 - FENCE_KDUMP_CONFIG_FILE="/etc/sysconfig/fence_kdump" - --is_uki() --{ -- local img -- -- img="$1" -- -- [[ -f $img ]] || return -- [[ "$(objdump -a "$img" 2> /dev/null)" =~ pei-(x86-64|aarch64-little) ]] || return -- objdump -h -j .linux "$img" &> /dev/null --} -- - is_fadump_capable() - { - # Check if firmware-assisted dump is enabled -@@ -621,7 +610,7 @@ _get_kdump_kernel_version() - # - prepare_kdump_bootinfo() - { -- local boot_initrdlist default_initrd_base var_target_initrd_dir -+ local _initrd - - KDUMP_KERNELVER=$(_get_kdump_kernel_version) - KDUMP_KERNEL=$(prepare_kdump_kernel "$KDUMP_KERNELVER") -@@ -632,48 +621,29 @@ prepare_kdump_bootinfo() - fi - - # For 64k variant, e.g. vmlinuz-5.14.0-327.el9.aarch64+64k-debug -- if [[ $KDUMP_KERNEL == *"+debug" || $KDUMP_KERNEL == *"64k-debug" ]]; then -+ if [[ ${KDUMP_KERNEL##*+} == ?(64k-)debug ]]; then - dwarn "Using debug kernel, you may need to set a larger crashkernel than the default value." - fi - -- # Set KDUMP_BOOTDIR to where kernel image is stored -- if is_uki "$KDUMP_KERNEL"; then -- KDUMP_BOOTDIR=/boot -- else -- KDUMP_BOOTDIR=$(dirname "$KDUMP_KERNEL") -- fi -- -- # Default initrd should just stay aside of kernel image, try to find it in KDUMP_BOOTDIR -- boot_initrdlist="initramfs-$KDUMP_KERNELVER.img initrd" -- for initrd in $boot_initrdlist; do -- if [[ -f "$KDUMP_BOOTDIR/$initrd" ]]; then -- default_initrd_base="$initrd" -- DEFAULT_INITRD="$KDUMP_BOOTDIR/$default_initrd_base" -- break -- fi -+ KDUMP_BOOTDIR="$(dirname "$KDUMP_KERNEL")" -+ for _initrd in "initramfs-$KDUMP_KERNELVER.img" "initrd"; do -+ [[ -f "$KDUMP_BOOTDIR/$_initrd" ]] || continue -+ DEFAULT_INITRD="$KDUMP_BOOTDIR/$_initrd" -+ break - done - -- # Create kdump initrd basename from default initrd basename -- # initramfs-5.7.9-200.fc32.x86_64.img => initramfs-5.7.9-200.fc32.x86_64kdump.img -- # initrd => initrdkdump -- if [[ -z $default_initrd_base ]]; then -- kdump_initrd_base=initramfs-${KDUMP_KERNELVER}kdump.img -- elif [[ $default_initrd_base == *.* ]]; then -- kdump_initrd_base=${default_initrd_base%.*}kdump.${DEFAULT_INITRD##*.} -- else -- kdump_initrd_base=${default_initrd_base}kdump -- fi -- -- # Place kdump initrd in $(/var/lib/kdump) if $(KDUMP_BOOTDIR) not writable -- if [[ ! -w $KDUMP_BOOTDIR ]]; then -- var_target_initrd_dir="/var/lib/kdump" -- mkdir -p "$var_target_initrd_dir" -- # shellcheck disable=SC2034 # KDUMP_INITRD is used by kdumpctl -- KDUMP_INITRD="$var_target_initrd_dir/$kdump_initrd_base" -+ # There are cases where $DEFAULT_INITRD can be empty, e.g. for UKIs. -+ if [[ -z $DEFAULT_INITRD ]] || [[ ! -w $KDUMP_BOOTDIR ]]; then -+ local statedir="/var/lib/kdump" -+ mkdir -p "$statedir" -+ _initrd="$statedir/initramfs-${KDUMP_KERNELVER}kdump.img" -+ elif [[ $DEFAULT_INITRD == *.img ]]; then -+ _initrd="${DEFAULT_INITRD/%.img/kdump.img}" - else -- # shellcheck disable=SC2034 # KDUMP_INITRD is used by kdumpctl -- KDUMP_INITRD="$KDUMP_BOOTDIR/$kdump_initrd_base" -+ _initrd="${DEFAULT_INITRD}kdump" - fi -+ # shellcheck disable=SC2034 # KDUMP_INITRD is used by kdumpctl -+ KDUMP_INITRD="$_initrd" - } - - get_watchdog_drvs() -diff --git a/kdump-utils.spec b/kdump-utils.spec -index 1d78127..2bfb217 100644 ---- a/kdump-utils.spec -+++ b/kdump-utils.spec -@@ -23,8 +23,6 @@ Requires: dracut-squash >= 058 - Requires: ethtool - Requires: gawk - Requires: util-linux --# Needed for UKI support --Recommends: binutils - Recommends: grubby - Recommends: hostname - BuildRequires: make --- -2.52.0 - diff --git a/0020-kdump-lib-always-disable-systemd-gpt-auto-generator.patch b/0020-kdump-lib-always-disable-systemd-gpt-auto-generator.patch deleted file mode 100644 index 0ac7ba3..0000000 --- a/0020-kdump-lib-always-disable-systemd-gpt-auto-generator.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 3985d49be06faca6120c6fc10687dc295a46f201 Mon Sep 17 00:00:00 2001 -From: Philipp Rudo -Date: Tue, 2 Sep 2025 16:15:02 +0200 -Subject: [PATCH] kdump-lib: always disable systemd-gpt-auto-generator - -Resolves: KEX-330 - -The systemd-gpt-auto-generator automatically discovers and mounts -various partitions, e.g. the root partition, based on the GPT partition -type GUIDs. So far anaconda hasn't set the GUIDs during an installation -and users relying on it, e.g. for UKIs where the root= parameter cannot -be passed on the kernel command line, had to set them manually. This -seems to have changed and causes the kdump kernel to hang. In addition -we know which disk/partition shall be used as dump target and add it -explicitly to the kdump initrd. So it is save to always disable the -gpt-auto-generator for the kdump kernel. - -Signed-off-by: Philipp Rudo -Signed-off-by: Coiby Xu ---- - kdump-lib.sh | 2 +- - spec/kdump-lib_spec.sh | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/kdump-lib.sh b/kdump-lib.sh -index 7d3ec9b..32e43c6 100755 ---- a/kdump-lib.sh -+++ b/kdump-lib.sh -@@ -799,7 +799,7 @@ prepare_cmdline() - # Always disable gpt-auto-generator as it hangs during boot of the - # crash kernel. Furthermore we know which disk will be used for dumping - # (if at all) and add it explicitly. -- is_uki "$KDUMP_KERNEL" && out+="rd.systemd.gpt_auto=no " -+ out+="rd.systemd.gpt_auto=no " - - # Trim unnecessary whitespaces - echo "$out" | sed -e "s/^ *//g" -e "s/ *$//g" -e "s/ \+/ /g" -diff --git a/spec/kdump-lib_spec.sh b/spec/kdump-lib_spec.sh -index ec7294d..41755a4 100644 ---- a/spec/kdump-lib_spec.sh -+++ b/spec/kdump-lib_spec.sh -@@ -97,7 +97,7 @@ Describe 'kdump-lib' - echo foo - } - -- add="disable_cpu_apicid=1 foo.pretimeout=0" -+ add="disable_cpu_apicid=1 foo.pretimeout=0 rd.systemd.gpt_auto=no" - - Parameters - #test cmdline remove add result --- -2.52.0 - diff --git a/0021-kdump-lib-use-EFI-var-to-find-UKI.patch b/0021-kdump-lib-use-EFI-var-to-find-UKI.patch deleted file mode 100644 index f206b35..0000000 --- a/0021-kdump-lib-use-EFI-var-to-find-UKI.patch +++ /dev/null @@ -1,46 +0,0 @@ -From edb8363d7efedfdc964576e4e30bc67c8fbeb941 Mon Sep 17 00:00:00 2001 -From: Li Tian -Date: Wed, 24 Sep 2025 17:29:56 +0800 -Subject: [PATCH] kdump-lib: use EFI var to find UKI - -The UKI in ESP is not guaranteed to be named after machine ID. -Machine ID is unknown at the time image is built. Thus -builders like Image Builder names UKI 'fff...f-$(uname -r).efi'. -The StubImageIdentifier points the true loaded UKI. - -Signed-off-by: Li Tian ---- - kdump-lib.sh | 12 ++++++++++-- - 1 file changed, 10 insertions(+), 2 deletions(-) - -diff --git a/kdump-lib.sh b/kdump-lib.sh -index 639256c..232d065 100755 ---- a/kdump-lib.sh -+++ b/kdump-lib.sh -@@ -502,13 +502,21 @@ prepare_kexec_args() - prepare_kdump_kernel() - { - local kdump_kernelver=$1 -- local dir img boot_dirlist boot_imglist kdump_kernel machine_id -+ local dir img boot_dirlist boot_imglist kdump_kernel machine_id uki_img -+ local img_identifier_path="/sys/firmware/efi/efivars/StubImageIdentifier-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f" - read -r machine_id < /etc/machine-id - -+ # UKI is not guaranteed named after machine ID. Use EFI var as reference. -+ if [[ -f $img_identifier_path ]]; then -+ uki_img=$(tr -cd '[:print:]/' < "$img_identifier_path" | sed 's/\\/\//g') -+ else -+ uki_img="EFI/Linux/$machine_id-$kdump_kernelver.efi" -+ fi -+ - boot_dirlist=${KDUMP_BOOTDIR:-"/boot /boot/efi /efi /"} - boot_imglist="$KDUMP_IMG-$kdump_kernelver$KDUMP_IMG_EXT \ - $machine_id/$kdump_kernelver/$KDUMP_IMG \ -- EFI/Linux/$machine_id-$kdump_kernelver.efi" -+ $uki_img" - - # The kernel of OSTree based systems is not in the standard locations. - if is_ostree; then --- -2.52.0 - diff --git a/kdump-utils.spec b/kdump-utils.spec index 6c824e3..b2a3fa8 100644 --- a/kdump-utils.spec +++ b/kdump-utils.spec @@ -1,35 +1,13 @@ # kdump-utils has no debug source %global debug_package %{nil} Name: kdump-utils -Version:1.0.58 +Version:1.0.61 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-Strip-surrounding-quotes-from-configuration-values.patch -Patch02: 0002-unit-tests-Add-case-for-quoted-configuration-values.patch -Patch03: 0003-Allow-kdump.service-to-access-LUKS-volume-keys.patch -Patch04: 0004-Restore-SELinux-label-of-crypttab-file.patch -Patch05: 0005-Allow-sudo-kdumpctl-for-LUKS-dump-target.patch -Patch06: 0006-Revert-Strip-surrounding-quotes-from-configuration-v.patch -Patch07: 0007-kdump-lib-initramfs-rewrite-kdump_get_conf_val.patch -Patch08: 0008-Add-persisent-device-if-FIPS-is-enabled.patch -Patch09: 0009-kdump.sh-Centralize-the-F-suboption-handling.patch -Patch10: 0010-kdump.sh-Centralize-the-num-threads-sub-option-handl.patch -Patch11: 0011-kdump.sh-Skip-num-threads-when-E-and-F-option-is-pre.patch -Patch12: 0012-powerpc-consider-CPU-count-while-calculating-crashke.patch -Patch13: 0013-powerpc-Set-nr_cpus-16-for-kdump-kernel.patch -Patch14: 0014-kexec-kdump-howto.txt-update-paragraphs-related-to-d.patch -Patch15: 0015-kdump-lib-initramfs-Fix-performance-regression-in-kd.patch -Patch16: 0016-sysconfig-use-initramfs_options-to-reduce-memory-usa.patch -Patch17: 0017-kdumpctl-clean-up-backup-restore-_default_initrd.patch -Patch18: 0018-kdumpctl-add-comments-to-different-initrd-variables.patch -Patch19: 0019-spec-drop-dependency-for-binutils.patch -Patch20: 0020-kdump-lib-always-disable-systemd-gpt-auto-generator.patch -Patch21: 0021-kdump-lib-use-EFI-var-to-find-UKI.patch - %ifarch ppc64 ppc64le Requires(post): servicelog diff --git a/sources b/sources index 9998d20..3d8b3ec 100644 --- a/sources +++ b/sources @@ -1,2 +1,4 @@ SHA512 (kdump-utils-1.0.54.tar.gz) = 8eb5b105c5614d2d206151a2261e639fa74958602fb741a725e114f7be87e866910ee530786f6e39988b15b47c477f53d22a7b563ed0aa1a09b9e96f4bb8744c SHA512 (kdump-utils-1.0.58.tar.gz) = b464ff17211eee6b1af795ddcd3497d72653665a888b1905830121a6226fd441ff7ad88336ac08db29453deedb7567d64e447d7ed9c5cdc615a8e85e0e1b46af +SHA512 (kdump-utils-1.0.60.tar.gz) = cd14479d798a6e81dda7ea2ccf6f3078ad920146b60c3d5240e95323b54bb5c2423365d1d2d7ba00480319abdc123aa955bacbb0c5c5526aac221b25e48ce3dd +SHA512 (kdump-utils-1.0.61.tar.gz) = 9d77084026fb7226ec51d2706c5d944026b17dec8d852d239095a43f192e29c591f111727d72f1cdb2e186c25789616806e0abbc8eda377abb32d09589338ea3