From f81e6ca8da7288a65d8bdc307058fe615e6b0dd3 Mon Sep 17 00:00:00 2001 From: Philipp Rudo Date: Mon, 3 Apr 2023 16:55:03 +0200 Subject: [PATCH] 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 Reviewed-by: Coiby Xu --- kdump-lib.sh | 19 ------------------- kdumpctl | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/kdump-lib.sh b/kdump-lib.sh index 722616c..75b31b2 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -307,25 +307,6 @@ get_nmcli_value_by_field() 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() { local active diff --git a/kdumpctl b/kdumpctl index 7c32468..330767b 100755 --- a/kdumpctl +++ b/kdumpctl @@ -45,6 +45,25 @@ if ! dlog_init; then exit 1 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() { local rc timeout=5 lockfile