dracut-kdump.sh: remove add_dump_code

`add_dump_code "<op>"` is just `DUMP_INSTRUCTION="<op>"`, no need a
extra wrapper for that.

Signed-off-by: Kairui Song <kasong@redhat.com>
Acked-by: Philipp Rudo <prudo@redhat.com>
This commit is contained in:
Kairui Song 2021-08-02 01:25:17 +08:00
parent 0675edbadb
commit 8f89e89071
1 changed files with 6 additions and 13 deletions

View File

@ -36,9 +36,7 @@ DUMP_RETVAL=0
get_kdump_confs() get_kdump_confs()
{ {
local config_opt config_val while read -r config_opt config_val;
while read config_opt config_val;
do do
# remove inline comments after the end of a directive. # remove inline comments after the end of a directive.
case "$config_opt" in case "$config_opt" in
@ -359,11 +357,6 @@ do_kdump_post()
fi fi
} }
add_dump_code()
{
DUMP_INSTRUCTION=$1
}
dump_raw() dump_raw()
{ {
local _raw=$1 local _raw=$1
@ -547,18 +540,18 @@ read_kdump_confs()
config_val=$(get_dracut_args_target "$config_val") config_val=$(get_dracut_args_target "$config_val")
if [ -n "$config_val" ]; then if [ -n "$config_val" ]; then
config_val=$(get_mntpoint_from_target "$config_val") config_val=$(get_mntpoint_from_target "$config_val")
add_dump_code "dump_fs $config_val" DUMP_INSTRUCTION="dump_fs $config_val"
fi fi
;; ;;
ext[234]|xfs|btrfs|minix|nfs) ext[234]|xfs|btrfs|minix|nfs)
config_val=$(get_mntpoint_from_target "$config_val") config_val=$(get_mntpoint_from_target "$config_val")
add_dump_code "dump_fs $config_val" DUMP_INSTRUCTION="dump_fs $config_val"
;; ;;
raw) raw)
add_dump_code "dump_raw $config_val" DUMP_INSTRUCTION="dump_raw $config_val"
;; ;;
ssh) ssh)
add_dump_code "dump_ssh $SSH_KEY_LOCATION $config_val" DUMP_INSTRUCTION="dump_ssh $SSH_KEY_LOCATION $config_val"
;; ;;
esac esac
done <<< "$(kdump_read_conf)" done <<< "$(kdump_read_conf)"
@ -594,7 +587,7 @@ if [ $? -ne 0 ]; then
fi fi
if [ -z "$DUMP_INSTRUCTION" ]; then if [ -z "$DUMP_INSTRUCTION" ]; then
add_dump_code "dump_fs $NEWROOT" DUMP_INSTRUCTION="dump_fs $NEWROOT"
fi fi
do_kdump_pre do_kdump_pre