From: Harald Hoyer Date: Wed, 31 Mar 2021 09:11:00 +0000 (+0200) Subject: fix(lunmask): shellcheck regression X-Git-Tag: 054~133 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56606b0a1b0b3ff58e6d8a7e216c9b55ecb35057;p=thirdparty%2Fdracut.git fix(lunmask): shellcheck regression `parse-lunmask.sh` is not a bash script and dash doesn't understand `read -a`. Revert to the initial code. Fixes: https://github.com/dracutdevs/dracut/issues/1271 --- diff --git a/modules.d/95lunmask/parse-lunmask.sh b/modules.d/95lunmask/parse-lunmask.sh index 033572524..504c76d86 100755 --- a/modules.d/95lunmask/parse-lunmask.sh +++ b/modules.d/95lunmask/parse-lunmask.sh @@ -24,11 +24,17 @@ EOF } for lunmask_arg in $(getargs rd.lunmask); do - IFS="," read -r -a _args <<< "$lunmask_arg" - if [ -d /sys/module/scsi_mod ]; then - printf "manual" > /sys/module/scsi_mod/parameters/scan - elif [ ! -f /etc/modprobe.d/95lunmask.conf ]; then - echo "options scsi_mod scan=manual" > /etc/modprobe.d/95lunmask.conf - fi - create_udev_rule "${_args[@]}" + ( + local OLDIFS="$IFS" + local IFS="," + # shellcheck disable=SC2086 + set $lunmask_arg + IFS="$OLDIFS" + if [ -d /sys/module/scsi_mod ]; then + printf "manual" > /sys/module/scsi_mod/parameters/scan + elif [ ! -f /etc/modprobe.d/95lunmask.conf ]; then + echo "options scsi_mod scan=manual" > /etc/modprobe.d/95lunmask.conf + fi + create_udev_rule "$1" "$2" "$3" + ) done