pivot to a systemd unit for the online hook
This commit is contained in:
@@ -42,10 +42,20 @@ install() {
|
||||
# Hook: runs from the initqueue once the NIC exists, before netroot
|
||||
inst_hook initqueue/settled 30 "$moddir/dot1x-macsec-up.sh"
|
||||
|
||||
# Test-mode (rd.dot1x=0) NVMe-oF connect, driven event-wise on link-up.
|
||||
# This distro's nvmf module registers no autoconnect, and a main-initqueue
|
||||
# job isn't re-run once the loop waits on events — so connect here instead.
|
||||
inst_hook initqueue/online 90 "$moddir/nvmf-connect.sh"
|
||||
# Test-mode (rd.dot1x=0) NVMe-oF connect as a systemd unit. This initramfs
|
||||
# is systemd-driven and does NOT source dracut initqueue/online hooks when
|
||||
# the ip=dhcp link comes up (verified: the hook installs but never fires),
|
||||
# and the nvmf module registers no autoconnect — so a dracut hook never
|
||||
# runs. A oneshot unit ordered Before=initrd-root-device.target, with its
|
||||
# own wait-for-network + connect loop, connects the namespace
|
||||
# deterministically. ConditionKernelCommandLine=rd.dot1x=0 makes it a no-op
|
||||
# on the secure path.
|
||||
inst_simple "$moddir/nvmf-connect.sh" /usr/sbin/nvmf-connect
|
||||
inst_simple "$moddir/nvmf-connect.service" \
|
||||
"$systemdsystemunitdir/nvmf-connect.service"
|
||||
mkdir -p "${initdir}${systemdsystemunitdir}/initrd-root-device.target.wants"
|
||||
ln -sf ../nvmf-connect.service \
|
||||
"${initdir}${systemdsystemunitdir}/initrd-root-device.target.wants/nvmf-connect.service"
|
||||
|
||||
dracut_need_initqueue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user