kdumpctl: fix check_config error when kdump.conf is empty
Resolves: bz1975632
Upstream: Fedora
Conflict: None
commit 6137956f79
Author: Kairui Song <kasong@redhat.com>
Date: Wed Apr 14 13:41:19 2021 +0800
kdumpctl: fix check_config error when kdump.conf is empty
Kdump scirpt already have default values for core_collector, path in
many other place. Empty kdump.conf still works. Fix this corner case and
fix the error message.
Signed-off-by: Kairui Song <kasong@redhat.com>
Acked-by: Pingfan Liu <piliu@redhat.com>
Signed-off-by: Tao Liu <ltao@redhat.com>
This commit is contained in:
parent
8ce1f3c1df
commit
ba2668b537
15
kdumpctl
15
kdumpctl
@ -237,12 +237,7 @@ restore_default_initrd()
|
|||||||
check_config()
|
check_config()
|
||||||
{
|
{
|
||||||
local -A _opt_rec
|
local -A _opt_rec
|
||||||
while read config_opt config_val; do
|
while read -r config_opt config_val; do
|
||||||
if [ -z "$config_val" ]; then
|
|
||||||
derror "Invalid kdump config value for option $config_opt"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$config_opt" in
|
case "$config_opt" in
|
||||||
dracut_args)
|
dracut_args)
|
||||||
if [[ $config_val == *--mount* ]]; then
|
if [[ $config_val == *--mount* ]]; then
|
||||||
@ -268,12 +263,20 @@ check_config()
|
|||||||
derror "Deprecated kdump config option: $config_opt. Refer to kdump.conf manpage for alternatives."
|
derror "Deprecated kdump config option: $config_opt. Refer to kdump.conf manpage for alternatives."
|
||||||
return 1
|
return 1
|
||||||
;;
|
;;
|
||||||
|
'')
|
||||||
|
continue
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
derror "Invalid kdump config option $config_opt"
|
derror "Invalid kdump config option $config_opt"
|
||||||
return 1
|
return 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
if [[ -z "$config_val" ]]; then
|
||||||
|
derror "Invalid kdump config value for option '$config_opt'"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${_opt_rec[$config_opt]}" ]; then
|
if [ -n "${_opt_rec[$config_opt]}" ]; then
|
||||||
if [ $config_opt == _target ]; then
|
if [ $config_opt == _target ]; then
|
||||||
derror "More than one dump targets specified"
|
derror "More than one dump targets specified"
|
||||||
|
Loading…
Reference in New Issue
Block a user