From e72c1310fa5eb879972805123fee2a09ac685cc2 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 26 Mar 2021 10:29:30 +0100 Subject: [PATCH] fix(virtfs): shellcheck for modules.d/95virtfs --- modules.d/95virtfs/.shchkdir | 0 modules.d/95virtfs/mount-virtfs.sh | 9 ++++----- modules.d/95virtfs/parse-virtfs.sh | 1 + 3 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 modules.d/95virtfs/.shchkdir diff --git a/modules.d/95virtfs/.shchkdir b/modules.d/95virtfs/.shchkdir new file mode 100644 index 000000000..e69de29bb diff --git a/modules.d/95virtfs/mount-virtfs.sh b/modules.d/95virtfs/mount-virtfs.sh index f64ad97dc..e52c752da 100755 --- a/modules.d/95virtfs/mount-virtfs.sh +++ b/modules.d/95virtfs/mount-virtfs.sh @@ -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 diff --git a/modules.d/95virtfs/parse-virtfs.sh b/modules.d/95virtfs/parse-virtfs.sh index 7a2465622..9f67123dc 100755 --- a/modules.d/95virtfs/parse-virtfs.sh +++ b/modules.d/95virtfs/parse-virtfs.sh @@ -3,5 +3,6 @@ if [ "${root%%:*}" = "virtfs" ]; then modprobe 9pnet_virtio + # shellcheck disable=SC2034 rootok=1 fi -- 2.47.3