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 <[email protected]>
(cherry picked from commit dracut-ng/dracut-ng@4133270)

bsc#1230468
  • Loading branch information
mwilck authored and aafeijoo-suse committed Sep 12, 2024
1 parent fec8514 commit 82efc91
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

is_nvmf() {
local _dev=$1
Expand All @@ -20,7 +23,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 @@ -41,6 +49,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 82efc91

Please sign in to comment.