From 755ba199a77c464d4ba301725ba500f8397dfe42 Mon Sep 17 00:00:00 2001 From: Philipp Rudo Date: Wed, 6 Sep 2023 10:49:44 +0200 Subject: [PATCH] kdump.conf: Remove option override_resettable When override_resettable was introduced in 2013 with 4b850d2 ("Check if block device as dump target is resettable") it was forgotten to add the new option to check_config (today the function is called parse_config). So if a user would have set override_resettable check_config would have returned an error ("Invalid kdump config option override_resettable") and starting the kdump service would have failed. As there has been no bug report in the last ~10 years it is safe to assume that the option was never used. Thus simply remove the option. Fixes: 4b850d2 ("Check if block device as dump target is resettable") Signed-off-by: Philipp Rudo Reviewed-by: Pingfan Liu --- gen-kdump-conf.sh | 6 ------ kdump.conf.5 | 8 ------- mkdumprd | 55 ----------------------------------------------- 3 files changed, 69 deletions(-) diff --git a/gen-kdump-conf.sh b/gen-kdump-conf.sh index 4abcd39..a8e7fdd 100755 --- a/gen-kdump-conf.sh +++ b/gen-kdump-conf.sh @@ -157,12 +157,6 @@ generate() # force_no_rebuild and force_rebuild options are mutually # exclusive and they should not be set to 1 simultaneously. # -# override_resettable <0 | 1> -# - Usually an unresettable block device can't be a dump target. -# Specifying 1 when you want to dump even though the block -# target is unresettable -# By default, it is 0, which will not try dumping destined to fail. -# # dracut_args # - Pass extra dracut options when rebuilding kdump initrd. # diff --git a/kdump.conf.5 b/kdump.conf.5 index ec28552..9117aa7 100644 --- a/kdump.conf.5 +++ b/kdump.conf.5 @@ -218,14 +218,6 @@ force_no_rebuild and force_rebuild options are mutually exclusive and they should not be set to 1 simultaneously. .RE -.B override_resettable <0 | 1> -.RS -Usually an unresettable block device can't be a dump target. Specifying 1 means -that even though the block target is unresettable, the user wants to try dumping anyway. -By default, it's set to 0, which will not try something destined to fail. -.RE - - .B dracut_args .RS Kdump uses dracut to generate initramfs for second kernel. This option diff --git a/mkdumprd b/mkdumprd index 4feac28..31c4b76 100644 --- a/mkdumprd +++ b/mkdumprd @@ -24,7 +24,6 @@ fi SSH_KEY_LOCATION=$DEFAULT_SSHKEY SAVE_PATH=$(get_save_path) -OVERRIDE_RESETTABLE=0 extra_modules="" dracut_args=(--add kdumpbase --quiet --hostonly --hostonly-cmdline --hostonly-i18n --hostonly-mode strict --hostonly-nics '' --aggressive-strip -o "plymouth resume ifcfg earlykdump") @@ -309,56 +308,6 @@ handle_default_dump_target() check_size fs "$_target" } -# $1: function name -for_each_block_target() -{ - local dev majmin - - for dev in $(get_kdump_targets); do - [[ -b $dev ]] || continue - majmin=$(get_maj_min "$dev") - check_block_and_slaves "$1" "$majmin" && return 1 - done - - return 0 -} - -#judge if a specific device with $1 is unresettable -#return false if unresettable. -is_unresettable() -{ - local path device resettable=1 - - path="/sys/$(udevadm info --query=all --path="/sys/dev/block/$1" | awk '/^P:/ {print $2}' | sed -e 's/\(cciss[0-9]\+\/\).*/\1/g' -e 's/\/block\/.*$//')/resettable" - if [[ -f $path ]]; then - resettable="$(< "$path")" - [[ $resettable -eq 0 ]] && [[ $OVERRIDE_RESETTABLE -eq 0 ]] && { - device=$(udevadm info --query=all --path="/sys/dev/block/$1" | awk -F= '/DEVNAME/{print $2}') - derror "Error: Can not save vmcore because device $device is unresettable" - return 0 - } - fi - - return 1 -} - -#check if machine is resettable. -#return true if resettable -check_resettable() -{ - local _target _override_resettable - - _override_resettable=$(kdump_get_conf_val override_resettable) - OVERRIDE_RESETTABLE=${_override_resettable:-$OVERRIDE_RESETTABLE} - if [ "$OVERRIDE_RESETTABLE" != "0" ] && [ "$OVERRIDE_RESETTABLE" != "1" ]; then - perror_exit "override_resettable value '$OVERRIDE_RESETTABLE' is invalid" - fi - - for_each_block_target is_unresettable && return - - return 1 -} - check_crypt() { local _dev @@ -370,10 +319,6 @@ check_crypt() done } -if ! check_resettable; then - exit 1 -fi - if ! check_crypt; then dwarn "Warning: Encrypted device is in dump path, which is not recommended, see kexec-kdump-howto.txt for more details." fi