Skip to content

Commit

Permalink
fix(nvmf): require NVMeoF modules
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Wilck <mwilck@suse.com>
  • Loading branch information
mwilck authored and LaszloGombos committed Sep 11, 2024
1 parent 921792f commit 4133270
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion modules.d/95nvmf/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

# called by dracut
check() {
local -A nvmf_trtypes

require_binaries nvme jq || return 1
require_kernel_modules nvme_fabrics || return 1

# shellcheck disable=SC2317 # called later by for_each_host_dev_and_slaves
is_nvmf() {
Expand All @@ -21,7 +24,12 @@ check() {
break
fi
done
[[ $trtype == "fc" ]] || [[ $trtype == "tcp" ]] || [[ $trtype == "rdma" ]]
if [[ $trtype == "fc" ]] || [[ $trtype == "tcp" ]] || [[ $trtype == "rdma" ]]; then
nvmf_trtypes["nvme_${trtype}"]=1
return 0
else
return 1
fi
}

has_nbft() {
Expand All @@ -42,6 +50,7 @@ check() {
local _is_nvmf=$?
popd > /dev/null || exit
[[ $_is_nvmf == 0 ]] || return 255
require_kernel_modules "${!nvmf_trtypes[@]}" || return 1
if [ ! -f /sys/class/fc/fc_udev_device/nvme_discovery ] \
&& [ ! -f /etc/nvme/discovery.conf ] \
&& [ ! -f /etc/nvme/config.json ] && ! has_nbft; then
Expand Down

0 comments on commit 4133270

Please sign in to comment.