Fix missing online hook

This commit is contained in:
Audiobuzz
2026-06-14 21:50:38 +00:00
parent a508dce5cf
commit 2eefd97c50
5 changed files with 63 additions and 25 deletions
+6 -19
View File
@@ -59,25 +59,12 @@ if [ "$(getarg rd.dot1x=)" = "0" ]; then
info "dot1x-macsec: test hostnqn $(cat /etc/nvme/hostnqn)"
fi
# Drive the NVMe-oF connect ourselves. This distro's dracut `nvmf` module
# parses rd.nvmf.discover into /etc/nvme/discovery.conf but registers NO
# initqueue/online autoconnect hook (that hook dir is empty), so
# `nvme connect-all` is never run, the root namespace never appears, and the
# boot spins on /dev/mapper/root forever. Queue connect-all on the main
# initqueue so it retries each loop until the namespace shows up (the link
# is already up via ip=dhcp; connect-all is idempotent once connected).
_disc=$(getarg rd.nvmf.discover=) # e.g. tcp,192.168.50.10,4420
if [ -n "$_disc" ]; then
_trtype=${_disc%%,*} # tcp
_rest=${_disc#*,} # 192.168.50.10,4420
_traddr=${_rest%%,*} # 192.168.50.10
_trsvcid=${_rest##*,} # 4420
info "dot1x-macsec: queueing nvme connect-all ${_trtype}/${_traddr}/${_trsvcid}"
/sbin/initqueue --unique --name nvmf-connect-all \
nvme connect-all -t "$_trtype" -a "$_traddr" -s "$_trsvcid"
else
warn "dot1x-macsec: rd.nvmf.discover not set — cannot connect NVMe root"
fi
# The NVMe-oF connect is driven by the initqueue/online hook
# (nvmf-connect.sh), which fires when the ip=dhcp link comes online — the
# correct event-driven place. (A job queued on the MAIN initqueue from here
# is registered but never re-executed once the loop blocks on events, so it
# never connected; and this distro's nvmf module registers no online
# autoconnect of its own.)
: > "$STAMP"
exit 0
fi