Skip to content

Commit

Permalink
fix(nvmf): move /etc/nvme/host{nqn,id} requirement to hostonly
Browse files Browse the repository at this point in the history
When creating initramfs for universal boot image such as an installer,
we can't include any machine-specific IDs. Let's move the check
for /etc/nvme/hostnqn and /etc/nvme/hostid files presence to
the hostonly section to avoid unsatisfied requirements.

Signed-off-by: Tomas Bzatek <[email protected]>
  • Loading branch information
tbzatek authored and LaszloGombos committed Apr 8, 2024
1 parent 1d2f983 commit 54cd647
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules.d/95nvmf/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# called by dracut
check() {
require_binaries nvme jq || return 1
[ -f /etc/nvme/hostnqn ] || return 255
[ -f /etc/nvme/hostid ] || return 255

is_nvmf() {
local _dev=$1
Expand Down Expand Up @@ -36,6 +34,8 @@ 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=$?
Expand Down Expand Up @@ -130,8 +130,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

0 comments on commit 54cd647

Please sign in to comment.