Fix stuff

This commit is contained in:
Audiobuzz
2026-06-15 10:52:43 +00:00
parent 62e49e6b42
commit e44dd15267
2 changed files with 20 additions and 4 deletions
+15 -4
View File
@@ -51,11 +51,22 @@ install() {
# 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"
# systemdsystemunitdir is normally /usr/lib/systemd/system, but dracut does
# not reliably export it into module-setup context here — when empty,
# inst_simple's dir handling silently DROPS the unit (the bug that left the
# initramfs without nvmf-connect.service). Fall back to the canonical path.
local _unitdir="${systemdsystemunitdir:-/usr/lib/systemd/system}"
inst_simple "$moddir/nvmf-connect.service" "${_unitdir}/nvmf-connect.service"
mkdir -p "${initdir}${_unitdir}/initrd-root-device.target.wants"
ln -sf ../nvmf-connect.service \
"${initdir}${systemdsystemunitdir}/initrd-root-device.target.wants/nvmf-connect.service"
"${initdir}${_unitdir}/initrd-root-device.target.wants/nvmf-connect.service"
# Hard-fail the dracut build if the unit didn't land — never ship a UKI that
# silently can't connect its NVMe-oF root in test mode.
if [ ! -e "${initdir}${_unitdir}/nvmf-connect.service" ]; then
derror "95dot1x-macsec: nvmf-connect.service not installed into ${_unitdir}"
return 1
fi
dracut_need_initqueue
}