]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix: shellcheck for modules.d/95dcssblk/module-setup.sh
authorHarald Hoyer <harald@redhat.com>
Fri, 12 Feb 2021 12:26:12 +0000 (13:26 +0100)
committerHarald Hoyer <harald@hoyer.xyz>
Mon, 15 Feb 2021 10:00:37 +0000 (11:00 +0100)
modules.d/95dcssblk/module-setup.sh

index 05c7f5c73424583713032698ff4afa940de4b8eb..bbd045021922bb77521ef83d22182383e066f913 100755 (executable)
@@ -5,14 +5,20 @@
 # called by dracut
 check() {
     local _arch=${DRACUT_ARCH:-$(uname -m)}
-    [ "$_arch" = "s390" -o "$_arch" = "s390x" ] || return 1
+    [[ "$_arch" = "s390" ]] || [[ "$_arch" = "s390x" ]] || return 1
     return 0
 }
 
 # called by dracut
 installkernel() {
-    if [ -e /sys/devices/dcssblk/*/block/dcssblk* ];then
-       hostonly='' instmods dcssblk
+    if [[ $hostonly ]]; then
+        for dev in /sys/devices/dcssblk/*/block/dcssblk* ; do
+            [[ -e $dev ]] || continue
+            hostonly='' instmods dcssblk
+            return $?
+        done
+    else
+        hostonly='' instmods dcssblk
     fi
 }