mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-11-24 11:22:18 +00:00
1361288dd2
With the initramfs network fixed, xcatroot still printed "Failed to download image". It then failed name resolution, and the booted node called itself localhost, so the postscripts did not identify it. Under initramfs-tools the kernel arguments reached xcatroot as variables, and dhclient wrote resolv.conf and set the hostname. Under systemd, dracut-initqueue runs xcatroot without the arguments, and systemd-networkd keeps DNS and the hostname in its lease files. The image also links resolv.conf to the systemd-resolved stub, which does not resolve a short name, and the copy of resolv.conf went through that link. xcatroot now reads the arguments with getarg, writes resolv.conf from the lease when it names no server, replaces the stub link in the new root, and writes the hostname from the lease when the image has none. xcatroot_rootimg_checksum.bats fails without this change. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> (cherry picked from commit 426a522879f380979d026d22798f4072c285cd2e) Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>