From e268210244d360bc86bbe0b60f4909a88cebd2cb Mon Sep 17 00:00:00 2001 From: Tao Liu Date: Wed, 3 Nov 2021 19:07:43 +0800 Subject: [PATCH] dracut-kdump.sh: remove add_dump_code upstream: fedora resolves: bz2003832 conflict: none commit 8f89e890713c382c88a7e00420ef3b98c2dc708d Author: Kairui Song Date: Mon Aug 2 01:25:17 2021 +0800 dracut-kdump.sh: remove add_dump_code `add_dump_code ""` is just `DUMP_INSTRUCTION=""`, no need a extra wrapper for that. Signed-off-by: Kairui Song Acked-by: Philipp Rudo Signed-off-by: Tao Liu --- dracut-kdump.sh | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/dracut-kdump.sh b/dracut-kdump.sh index 54e9713..7cfa31b 100755 --- a/dracut-kdump.sh +++ b/dracut-kdump.sh @@ -36,9 +36,7 @@ DUMP_RETVAL=0 get_kdump_confs() { - local config_opt config_val - - while read config_opt config_val; + while read -r config_opt config_val; do # remove inline comments after the end of a directive. case "$config_opt" in @@ -359,11 +357,6 @@ do_kdump_post() fi } -add_dump_code() -{ - DUMP_INSTRUCTION=$1 -} - dump_raw() { local _raw=$1 @@ -547,18 +540,18 @@ read_kdump_confs() config_val=$(get_dracut_args_target "$config_val") if [ -n "$config_val" ]; then config_val=$(get_mntpoint_from_target "$config_val") - add_dump_code "dump_fs $config_val" + DUMP_INSTRUCTION="dump_fs $config_val" fi ;; ext[234]|xfs|btrfs|minix|nfs) config_val=$(get_mntpoint_from_target "$config_val") - add_dump_code "dump_fs $config_val" + DUMP_INSTRUCTION="dump_fs $config_val" ;; raw) - add_dump_code "dump_raw $config_val" + DUMP_INSTRUCTION="dump_raw $config_val" ;; ssh) - add_dump_code "dump_ssh $SSH_KEY_LOCATION $config_val" + DUMP_INSTRUCTION="dump_ssh $SSH_KEY_LOCATION $config_val" ;; esac done <<< "$(kdump_read_conf)" @@ -594,7 +587,7 @@ if [ $? -ne 0 ]; then fi if [ -z "$DUMP_INSTRUCTION" ]; then - add_dump_code "dump_fs $NEWROOT" + DUMP_INSTRUCTION="dump_fs $NEWROOT" fi do_kdump_pre