From: Frederick Grose <4335897+FGrose@users.noreply.github.com> Date: Sat, 10 Sep 2022 03:46:29 +0000 (-0400) Subject: fix(load_fstype): use $1 if $2 is missing X-Git-Tag: 058~161 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=401158e58c47b2e1278a47b9cd236f501cfe2732;p=thirdparty%2Fdracut.git fix(load_fstype): use $1 if $2 is missing Use parameter expansion default value if the second argument is missing. The current code mistakenly reuses the null second argument. --- diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh index 2cebbc8ad..44dd0178a 100755 --- a/modules.d/99base/dracut-lib.sh +++ b/modules.d/99base/dracut-lib.sh @@ -1157,8 +1157,5 @@ remove_hostonly_files() { # returns OK if kernel_module is loaded # modprobe fails if /lib/modules is not available (--no-kernel use case) load_fstype() { - if [ -z "$2" ]; then - set -- "$1" "$2" - fi - strstr "$(cat /proc/filesystems)" "$2" || modprobe "$1" + strstr "$(cat /proc/filesystems)" "${2:-$1}" || modprobe "$1" }