Skip to content

Commit

Permalink
Merge pull request #374 from aafeijoo-suse/059-bsc1230468
Browse files Browse the repository at this point in the history
fix(nvmf): require NVMeoF modules (bsc#1230468)
  • Loading branch information
aafeijoo-suse authored Sep 13, 2024
2 parents acb9ef9 + 80ec0b7 commit 91732c0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
24 changes: 17 additions & 7 deletions modules.d/95nvmf/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

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

require_binaries nvme jq || return 1
[ -f /etc/nvme/hostnqn ] || return 255
[ -f /etc/nvme/hostid ] || return 255
require_kernel_modules nvme_fabrics || return 1

is_nvmf() {
local _dev=$1
Expand All @@ -22,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 @@ -36,11 +42,14 @@ check() {
}

[[ $hostonly ]] || [[ $mount_needs ]] && {
[ -f /etc/nvme/hostnqn ] || return 255
[ -f /etc/nvme/hostid ] || return 255
pushd . > /dev/null
for_each_host_dev_and_slaves is_nvmf
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 All @@ -59,8 +68,9 @@ depends() {

# called by dracut
installkernel() {
instmods nvme_fc lpfc qla2xxx
hostonly="" instmods nvme_tcp nvme_fabrics 8021q
instmods nvme_fc nvme_tcp nvme_rdma lpfc qla2xxx
# 802.1q VLAN may be set up in Firmware later. Include the module always.
hostonly="" instmods 8021q
}

# called by dracut
Expand Down Expand Up @@ -130,8 +140,8 @@ install() {
_nvmf_args=$(cmdline)
[[ "$_nvmf_args" ]] && printf "%s" "$_nvmf_args" >> "${initdir}/etc/cmdline.d/95nvmf-args.conf"
fi
inst_simple "/etc/nvme/hostnqn"
inst_simple "/etc/nvme/hostid"
inst_simple -H "/etc/nvme/hostnqn"
inst_simple -H "/etc/nvme/hostid"

inst_multiple ip sed

Expand Down
3 changes: 3 additions & 0 deletions suse/README.susemaint
Original file line number Diff line number Diff line change
Expand Up @@ -379,3 +379,6 @@ b5a35f9d feat(zfcp_rules): remove zfcp handling consolidated in s390-tools
e0b87682 fix(dracut): ldd output borked with `--sysroot`
d0c82322 fix(dracut): do not add all lib subdirs to `LD_LIBRARY_PATH` with `--sysroot`
921792f2 feat(systemd): always install libsystemd libraries
54cd6479 fix(nvmf): move /etc/nvme/host{nqn,id} requirement to hostonly
41332702 fix(nvmf): require NVMeoF modules
3748ed4d fix(nvmf): install (only) required nvmf modules

0 comments on commit 91732c0

Please sign in to comment.