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:
Philipp Rudo 2023-04-03 16:55:03 +02:00 committed by Coiby Xu
parent 9eb39cda3c
commit f81e6ca8da
2 changed files with 19 additions and 19 deletions

View File

@ -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

View File

@ -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