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
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"
}
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")