2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-27 12:52:16 +00:00

fix(xcat-core): a diskless node has no server in its imgurl

mknetboot in debian.pm builds the imgurl from the image server, which is the
'!myipfn!' placeholder whenever noderes.tftpserver and noderes.xcatmaster are
unset. Commit 7ab362835 wrapped that value in format_host_port so an IPv6
server would be bracketed. format_host_port refuses the placeholder, because
format_uri_host validates it as a host name, so the imgurl lost its server and
its port and read "imgurl=http:////install/netboot/.../rootimg.cpio.gz". The
node then had no address to fetch its root image from. This reached every
Ubuntu diskless node, not only an IPv6 one: upstream interpolated the value
directly and the placeholder survived to be substituted.

format_uri_host now returns the placeholder unchanged, the way uri_authority
already passes it through for the XCAT= parameter. The boot loader plugins
substitute it afterwards, and substitute_facing_address brackets it when the
facing address is IPv6.

Measured on an IPv6-only Ubuntu 24.04 node: the grub2 command line now carries
imgurl=http://[2001:db8:147::1]:80/install/... beside ip=either6.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
This commit is contained in:
Daniel Hilst
2026-10-29 13:49:07 -03:00
parent 5760b73d57
commit 2f6f029382
+6
View File
@@ -3020,6 +3020,12 @@ sub format_uri_host
}
return unless defined($host) && length($host);
# '!myipfn!' is the facing-address placeholder, not a host. pxe.pm, grub2.pm and
# petitboot.pm replace it after the command line is built, and
# substitute_facing_address brackets it there when the address is IPv6.
return $host if $host eq '!myipfn!';
if ($host =~ /^\[([^\]]+)\]$/)
{
my $address = $1;