From: Martin Wilck Date: Fri, 16 Sep 2022 22:54:25 +0000 (+0200) Subject: fix(nvmf): avoid calling "exit" in a cmdline hook X-Git-Tag: 058~132 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a93968b07567a654d18b8ef2144337d803186eca;p=thirdparty%2Fdracut.git fix(nvmf): avoid calling "exit" in a cmdline hook "exit" should never be executed in dracut hooks, because the hooks are sourced by the main script. --- diff --git a/modules.d/95nvmf/parse-nvmf-boot-connections.sh b/modules.d/95nvmf/parse-nvmf-boot-connections.sh index c8078a76e..cc545ee0e 100755 --- a/modules.d/95nvmf/parse-nvmf-boot-connections.sh +++ b/modules.d/95nvmf/parse-nvmf-boot-connections.sh @@ -101,12 +101,12 @@ for d in $(getargs rd.nvmf.discover -d nvmf.discover=); do done # Host NQN and host id are mandatory for NVMe-oF -[ -f "/etc/nvme/hostnqn" ] || exit 0 -[ -f "/etc/nvme/hostid" ] || exit 0 +if [ -f "/etc/nvme/hostnqn" ] && [ -f "/etc/nvme/hostid" ]; then -# If no nvme command line arguments present, try autodiscovery -if [ $NVMF_FC_AUTO ] || [ ! -f "/etc/nvme/discovery.conf" ]; then - /sbin/initqueue --settled --onetime --unique --name nvme-fc-autoconnect /sbin/nvmf-autoconnect.sh -else - /sbin/initqueue --settled --onetime --unique --name nvme-discover /usr/sbin/nvme connect-all + # If no nvme command line arguments present, try autodiscovery + if [ $NVMF_FC_AUTO ] || [ ! -f "/etc/nvme/discovery.conf" ]; then + /sbin/initqueue --settled --onetime --unique --name nvme-fc-autoconnect /sbin/nvmf-autoconnect.sh + else + /sbin/initqueue --settled --onetime --unique --name nvme-discover /usr/sbin/nvme connect-all + fi fi