ubuntu_netboot_initqueue.bats captures two defects in the Ubuntu dracut
module. The boot NIC gets no DHCPv4 lease, because nothing turns on
DHCP for the 70-BOOTIF.network file that systemd-network-generator
writes from BOOTIF=. And xcat-cmdline.sh writes its finished condition
outside $hookdir, so dracut-initqueue ends before the settled hook
that fetches the root runs. Both new cases fail on this tree.
imgutils_ubuntu_dracut_module.t now also checks the inst_simple
sources of the install script.
ubuntu_netboot_root_handler.bats sourced the online hook from sh. On
an Ubuntu host sh is dash, whose "." passes no arguments, so two cases
failed there. The initramfs sh is bash, so the cases now use bash.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit 22cf6d78573f3df38c5d395dde4f50fc5c7a3640)
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
"the online hook calls the handler with dracut's three arguments" and
"a second interface does not fetch the image again" fail in the GitHub
CI with "called: No such file or directory". Both cases source
xcat-online.sh from sh. On Ubuntu sh is dash, and the dash "." builtin
passes no arguments, so the hook sees no interface and returns before
it calls the stub handler.
The initramfs links sh to bash, so the cases now source the hook from
bash. Run on an Ubuntu host, both cases fail before this change and
pass after it.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
dracut SOURCES a hook: source_all runs `. "$f" "$@"`. An `exit` in the hook
therefore ends networkd-run.sh, which is the script bringing the network up, so
the early return path would stop network setup on the second interface. A compute
node with three nics on the provisioning network reaches that path.
The hook leaves with `return` now. A case sources it with the marker already
present and asserts the caller still runs; putting `exit` back fails only that
case. Two cases drove the hook with `sh hook.sh` and now source it, which is both
what dracut does and what `return` requires.
dracut's own 98syslog/rsyslogd-start.sh uses `exit` in an online hook, so the
convention is not uniform. `return` is correct for a sourced script and says what
is meant: end this hook, not its caller.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
dracut dispatches a netroot= handler from network-legacy's ifup. Ubuntu 25.10 and
later ship no network-legacy, so network resolves through systemd-networkd and
nothing calls /sbin/netroot. install.netboot already says so in a comment, and
treats the dispatcher as optional.
Measured on xcat32-cn with the 26.04 netboot image: the initramfs does no DHCP of
its own, the management node logs no request for rootimg.cpio.gz, and dracut
enters emergency mode 3.3 seconds in. Under quiet that surfaces as "Failed to
isolate default target". The initrd is complete: modules.txt lists network,
systemd-networkd, net-lib, nfs and xcat, and both /sbin/netroot and
/sbin/xcatroot are present. Nothing calls them.
The cases run install.netboot the way dracut does, with its helpers stubbed, and
assert what it registers. They also drive the new hook with a stub handler.
Deleting the registration fails only "the root handler is registered on an
interface coming online".
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>