Skip to content

Commit

Permalink
fix(load_fstype): use $1 if $2 is missing
Browse files Browse the repository at this point in the history
Use parameter expansion default value if the second argument is missing.
The current code mistakenly reuses the null second argument.
  • Loading branch information
FGrose authored and johannbg committed Sep 26, 2022
1 parent 481b87f commit 401158e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions modules.d/99base/dracut-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

0 comments on commit 401158e

Please sign in to comment.