]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(nvmf): support /etc/nvme/config.json
authorMartin Wilck <mwilck@suse.com>
Thu, 9 Mar 2023 15:55:36 +0000 (16:55 +0100)
committerAntonio Álvarez Feijoo <antonio.feijoo@suse.com>
Mon, 26 Jun 2023 07:45:42 +0000 (09:45 +0200)
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.

modules.d/95nvmf/module-setup.sh
modules.d/95nvmf/parse-nvmf-boot-connections.sh

index 782837a173af7a432bbf00ae19cdc3a5eb0b7faf..3c1bf51150430f09d4a938ed42deb4c3c20c5101 100755 (executable)
@@ -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
index 6b26f7625e5cf387303e08474eb3fa8399b8984a..6c5ef4bc0699586336af7e2816269d1a37f85f92 100755 (executable)
@@ -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