diff --git a/modules.d/98usrmount/.shchkdir b/modules.d/98usrmount/.shchkdir new file mode 100644 index 0000000000..e69de29bb2 diff --git a/modules.d/98usrmount/mount-usr.sh b/modules.d/98usrmount/mount-usr.sh index 7c8fa63142..23ed06aa2e 100755 --- a/modules.d/98usrmount/mount-usr.sh +++ b/modules.d/98usrmount/mount-usr.sh @@ -6,12 +6,13 @@ type fsck_single > /dev/null 2>&1 || . /lib/fs-lib.sh filtersubvol() { local _oldifs _oldifs="$IFS" - IFS="," - set $* + local IFS="," + # shellcheck disable=SC2086 + set -- $1 IFS="$_oldifs" while [ $# -gt 0 ]; do case $1 in - subvol\=*) : ;; + 'subvol='*) : ;; *) printf '%s' "${1}," ;; esac shift @@ -31,6 +32,7 @@ fsck_usr() { if [ -f "$NEWROOT"/forcefsck ] || getargbool 0 forcefsck; then _fsckoptions="-f $_fsckoptions" elif [ -f "$NEWROOT"/.autofsck ]; then + # shellcheck disable=SC1090 [ -f "$NEWROOT"/etc/sysconfig/autofsck ] && . "$NEWROOT"/etc/sysconfig/autofsck if [ "$AUTOFSCK_DEF_CHECK" = "yes" ]; then AUTOFSCK_OPT="$AUTOFSCK_OPT -f" @@ -48,15 +50,15 @@ fsck_usr() { } mount_usr() { - local _dev _mp _fs _opts _rest _usr_found _ret _freq _passno + local _dev _mp _fs _opts _ _usr_found _ _freq _passno # check, if we have to mount the /usr filesystem - while read _dev _mp _fs _opts _freq _passno || [ -n "$_dev" ]; do + while read -r _dev _mp _fs _opts _freq _passno || [ -n "$_dev" ]; do [ "${_dev%%#*}" != "$_dev" ] && continue if [ "$_mp" = "/usr" ]; then _dev="$(label_uuid_to_dev "$_dev")" if strstr "$_opts" "subvol=" \ - && [ "${root#block:}" -ef $_dev ] \ + && [ "${root#block:}" -ef "$_dev" ] \ && [ -n "$rflags" ]; then # for btrfs subvolumes we have to mount /usr with the same rflags rflags=$(filtersubvol "$rflags")