From 1b53bb6297d83940b52e806c01030e8f5035d9f2 Mon Sep 17 00:00:00 2001 From: Frederick Grose Date: Sun, 23 Jul 2023 13:25:52 -0400 Subject: [PATCH] fix(dracut-init.sh): use the local _ret variable Use the local _ret variable when declared. --- dracut-init.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/dracut-init.sh b/dracut-init.sh index 41445bb368..7294eabb73 100755 --- a/dracut-init.sh +++ b/dracut-init.sh @@ -945,10 +945,10 @@ check_mount() { if [[ " $dracutmodules $add_dracutmodules $force_add_dracutmodules" == *\ $_mod\ * ]]; then module_check_mount "$_mod" "$_moddir" - ret=$? + _ret=$? - # explicit module, so also accept ret=255 - [[ $ret == 0 || $ret == 255 ]] || return 1 + # explicit module, so also accept _ret=255 + [[ $_ret == 0 || $_ret == 255 ]] || return 1 else # module not in our list if [[ $dracutmodules == all ]]; then @@ -1012,22 +1012,22 @@ check_module() { if [[ " $dracutmodules $add_dracutmodules $force_add_dracutmodules" == *\ $_mod\ * ]]; then if [[ " $dracutmodules $force_add_dracutmodules " == *\ $_mod\ * ]]; then module_check "$_mod" 1 "$_moddir" - ret=$? + _ret=$? else module_check "$_mod" 0 "$_moddir" - ret=$? + _ret=$? fi - # explicit module, so also accept ret=255 - [[ $ret == 0 || $ret == 255 ]] || return 1 + # explicit module, so also accept _ret=255 + [[ $_ret == 0 || $_ret == 255 ]] || return 1 else # module not in our list if [[ $dracutmodules == all ]]; then # check, if we can and should install this module module_check "$_mod" 0 "$_moddir" - ret=$? - if [[ $ret != 0 ]]; then + _ret=$? + if [[ $_ret != 0 ]]; then [[ $2 ]] && return 1 - [[ $ret != 255 ]] && return 1 + [[ $_ret != 255 ]] && return 1 fi else # skip this module