Skip to content

Commit

Permalink
fix(nvmf): support /etc/nvme/config.json
Browse files Browse the repository at this point in the history
Since nvme-cli 2.0, configuration of subsystems to connect to is
stored under `/etc/nvme` in either `discovery.conf` or `config.json`.
Attempt discovery also if the latter exists, but not the former.
Also, install "config.json" if it's present on the root FS.

As before, "rd.nvmf.discover=fc,auto" will force either file to be ignored,
and NBFT-defined targets take precedence if found.
  • Loading branch information
mwilck authored and aafeijoo-suse committed Jun 26, 2023
1 parent 902f3a8 commit f07117d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions modules.d/95nvmf/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ install() {
inst_multiple nvme
inst_hook cmdline 92 "$moddir/parse-nvmf-boot-connections.sh"
inst_simple "/etc/nvme/discovery.conf"
inst_simple "/etc/nvme/config.json"
inst_rules /usr/lib/udev/rules.d/71-nvmf-iopolicy-netapp.rules
inst_rules "$moddir/95-nvmf-initqueue.rules"
dracut_need_initqueue
Expand Down
2 changes: 1 addition & 1 deletion modules.d/95nvmf/parse-nvmf-boot-connections.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ parse_nvmf_discover() {
: > /tmp/nvmf_needs_network
elif [ "$trtype" = "fc" ]; then
if [ "$traddr" = "auto" ]; then
rm /etc/nvme/discovery.conf
rm -f /etc/nvme/discovery.conf /etc/nvme/config.json
return 1
fi
if [ "$hosttraddr" = "none" ]; then
Expand Down

0 comments on commit f07117d

Please sign in to comment.