From 401158e58c47b2e1278a47b9cd236f501cfe2732 Mon Sep 17 00:00:00 2001 From: Frederick Grose <4335897+FGrose@users.noreply.github.com> Date: Fri, 9 Sep 2022 23:46:29 -0400 Subject: [PATCH] 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. --- modules.d/99base/dracut-lib.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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" } -- 2.47.3