From 1a6c2fdade221e9d69e14e2b6f3386ca8fc4a8b6 Mon Sep 17 00:00:00 2001 From: Martin Wilck Date: Thu, 9 Mar 2023 16:55:36 +0100 Subject: [PATCH] fix(nvmf): support /etc/nvme/config.json 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. Resolves: #1933787 --- modules.d/95nvmf/module-setup.sh | 1 + modules.d/95nvmf/parse-nvmf-boot-connections.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules.d/95nvmf/module-setup.sh b/modules.d/95nvmf/module-setup.sh index f7fd62a0..46ecb38f 100755 --- a/modules.d/95nvmf/module-setup.sh +++ b/modules.d/95nvmf/module-setup.sh @@ -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 diff --git a/modules.d/95nvmf/parse-nvmf-boot-connections.sh b/modules.d/95nvmf/parse-nvmf-boot-connections.sh index 6b26f762..6c5ef4bc 100755 --- a/modules.d/95nvmf/parse-nvmf-boot-connections.sh +++ b/modules.d/95nvmf/parse-nvmf-boot-connections.sh @@ -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