]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(dracut-init.sh): use the local _ret variable
authorFrederick Grose <fgrose@sugarlabs.org>
Sun, 23 Jul 2023 17:25:52 +0000 (13:25 -0400)
committerLaszlo Gombos <laszlo.gombos@gmail.com>
Mon, 24 Jul 2023 11:40:40 +0000 (07:40 -0400)
Use the local _ret variable when declared.

dracut-init.sh

index 41445bb3689786db31fbc0be39f9f29b45f8c9dd..7294eabb734fbf965eeed7c9f855202488826c11 100755 (executable)
@@ -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