]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(virtfs): shellcheck for modules.d/95virtfs
authorHarald Hoyer <harald@redhat.com>
Fri, 26 Mar 2021 09:29:30 +0000 (10:29 +0100)
committerHarald Hoyer <harald@hoyer.xyz>
Mon, 29 Mar 2021 09:34:13 +0000 (11:34 +0200)
modules.d/95virtfs/.shchkdir [new file with mode: 0644]
modules.d/95virtfs/mount-virtfs.sh
modules.d/95virtfs/parse-virtfs.sh

diff --git a/modules.d/95virtfs/.shchkdir b/modules.d/95virtfs/.shchkdir
new file mode 100644 (file)
index 0000000..e69de29
index f64ad97dcb3e98091c567cb7f6d8a0e5dae948d9..e52c752da88432979386dcc5e9ea59d99b56e24b 100755 (executable)
@@ -7,6 +7,7 @@ filter_rootopts() {
     # strip ro and rw options
     local OLDIFS="$IFS"
     IFS=,
+    # shellcheck disable=SC2086
     set -- $rootopts
     IFS="$OLDIFS"
     local v
@@ -21,12 +22,10 @@ filter_rootopts() {
         shift
     done
     rootopts=${v#,}
-    echo $rootopts
+    echo "$rootopts"
 }
 
 mount_root() {
-    local _ret
-
     rootfs="9p"
     rflags="trans=virtio,version=9p2000.L"
 
@@ -43,7 +42,7 @@ mount_root() {
         # the root filesystem,
         # remount it with the proper options
         rootopts="defaults"
-        while read dev mp fs opts rest || [ -n "$dev" ]; do
+        while read -r dev mp _ opts rest || [ -n "$dev" ]; do
             # skip comments
             [ "${dev%%#*}" != "$dev" ] && continue
 
@@ -53,7 +52,7 @@ mount_root() {
             fi
         done < "$NEWROOT/etc/fstab"
 
-        rootopts=$(filter_rootopts $rootopts)
+        rootopts=$(filter_rootopts "$rootopts")
     fi
 
     # we want rootflags (rflags) to take precedence so prepend rootopts to
index 7a24656226f69a57c9ba36aba41db00633b2a6ef..9f67123dc0d652cd7c8fab34a084b4e773630010 100755 (executable)
@@ -3,5 +3,6 @@
 if [ "${root%%:*}" = "virtfs" ]; then
     modprobe 9pnet_virtio
 
+    # shellcheck disable=SC2034
     rootok=1
 fi