kdump-lib: move is_dracut_mod_omitted to kdumpctl
The function is only used in kdumpctl. Thus move it there to keep kdump-lib small and simple. Signed-off-by: Philipp Rudo <prudo@redhat.com> Reviewed-by: Coiby Xu <coxu@redhat.com>
This commit is contained in:
parent
9eb39cda3c
commit
f81e6ca8da
19
kdump-lib.sh
19
kdump-lib.sh
@ -307,25 +307,6 @@ get_nmcli_value_by_field()
|
|||||||
LANG=C nmcli --get-values "$@"
|
LANG=C nmcli --get-values "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
# returns 0 when omission of a module is desired in dracut_args
|
|
||||||
# returns 1 otherwise
|
|
||||||
is_dracut_mod_omitted()
|
|
||||||
{
|
|
||||||
local dracut_args dracut_mod=$1
|
|
||||||
|
|
||||||
set -- $(kdump_get_conf_val dracut_args)
|
|
||||||
while [ $# -gt 0 ]; do
|
|
||||||
case $1 in
|
|
||||||
-o | --omit)
|
|
||||||
[[ " ${2//[^[:alnum:]]/ } " == *" $dracut_mod "* ]] && return 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
is_wdt_active()
|
is_wdt_active()
|
||||||
{
|
{
|
||||||
local active
|
local active
|
||||||
|
19
kdumpctl
19
kdumpctl
@ -45,6 +45,25 @@ if ! dlog_init; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# returns 0 when omission of a module is desired in dracut_args
|
||||||
|
# returns 1 otherwise
|
||||||
|
is_dracut_mod_omitted()
|
||||||
|
{
|
||||||
|
local dracut_args dracut_mod=$1
|
||||||
|
|
||||||
|
set -- $(kdump_get_conf_val dracut_args)
|
||||||
|
while [ $# -gt 0 ]; do
|
||||||
|
case $1 in
|
||||||
|
-o | --omit)
|
||||||
|
[[ " ${2//[^[:alnum:]]/ } " == *" $dracut_mod "* ]] && return 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
single_instance_lock()
|
single_instance_lock()
|
||||||
{
|
{
|
||||||
local rc timeout=5 lockfile
|
local rc timeout=5 lockfile
|
||||||
|
Loading…
Reference in New Issue
Block a user