mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-11-20 17:32:15 +00:00
fix(xcat-core): Ubuntu diskless nodes cannot netboot over IPv6 only
The Ubuntu genimage enters dracut mode only when the rootimg holds /usr/share/dracut or /usr/lib/dracut (netboot/ubuntu/genimage:791). Seven netboot package lists hold no dracut, so genimage writes the legacy /init. That /init waits for an "inet addr" line from ifconfig (genimage:1339) and cuts XCATSERVER at the first colon (genimage:1348). Both steps are IPv4-only, so an IPv6-only diskless node never boots. Ubuntu 26.04 diskless is the row this blocks. Add dracut and dracut-network to the 24.04 ppc64el list, its ppc64le copy, and the five 26.04 netboot lists. Both packages are published for noble (universe, 060+5-1ubuntu3) and resolute (main, 110-11) on amd64, ppc64el and riscv64. dracut-network pulls iproute2 on resolute and iputils-arping on noble, so no other entry is needed. The new xCAT-test/unit/ubuntu_netboot_dracut_pkglists.t reads the seven lists plus the working 24.04 x86_64 reference and asserts both entries. profile_customization.t now expects dracut in the 26.04 riscv64 list. Removing dracut from compute.ubuntu26.04.pkglist fails only that list's assertion; the reference stays green. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
This commit is contained in:
@@ -18,3 +18,5 @@ gzip
|
||||
xz-utils
|
||||
cpio
|
||||
chrony
|
||||
dracut
|
||||
dracut-network
|
||||
|
||||
@@ -18,3 +18,5 @@ gzip
|
||||
xz-utils
|
||||
cpio
|
||||
chrony
|
||||
dracut
|
||||
dracut-network
|
||||
|
||||
@@ -15,3 +15,5 @@ gawk
|
||||
tar
|
||||
gzip
|
||||
xz-utils
|
||||
dracut
|
||||
dracut-network
|
||||
|
||||
@@ -18,3 +18,5 @@ gzip
|
||||
xz-utils
|
||||
cpio
|
||||
chrony
|
||||
dracut
|
||||
dracut-network
|
||||
|
||||
@@ -16,3 +16,5 @@ gzip
|
||||
xz-utils
|
||||
cpio
|
||||
chrony
|
||||
dracut
|
||||
dracut-network
|
||||
|
||||
@@ -70,8 +70,10 @@ for my $release (qw(24.04 26.04)) {
|
||||
my @expected = qw(bash nfs-common openssl isc-dhcp-client libc-bin
|
||||
linux-image-generic openssh-server openssh-client wget rsync
|
||||
busybox-static gawk bind9-dnsutils tar gzip xz-utils cpio chrony);
|
||||
push @expected, qw(util-linux-extra iproute2 dracut dracut-network)
|
||||
if $release eq '24.04';
|
||||
push @expected, qw(util-linux-extra iproute2) if $release eq '24.04';
|
||||
# genimage enters dracut mode only when the rootimg carries dracut. Every release
|
||||
# needs it, because the legacy /init it falls back to is IPv4-only.
|
||||
push @expected, qw(dracut dracut-network);
|
||||
push @cases, ['netboot', 'ubuntu', 'compute', "ubuntu$release", 'riscv64',
|
||||
'pkglist', "compute.ubuntu$release.riscv64.pkglist", \@expected];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
#!/usr/bin/env perl
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use FindBin;
|
||||
use Test::More;
|
||||
|
||||
# genimage enters dracut mode only when the rootimg carries dracut
|
||||
# (xCAT-server/share/xcat/netboot/ubuntu/genimage). A netboot package list with no
|
||||
# dracut falls back to the legacy /init, which waits for an "inet addr" line and cuts
|
||||
# XCATSERVER at the first colon. Both are IPv4-only, so an IPv6-only diskless node
|
||||
# never boots. The package list is the artifact that decides this.
|
||||
#
|
||||
# 24.04 x86_64 is the reference: it already carries the entries and boots IPv6-only.
|
||||
|
||||
use lib "$FindBin::Bin/../lib";
|
||||
use XCAT::Test::File qw(repo_path);
|
||||
use File::Slurper qw(read_lines);
|
||||
|
||||
my $netboot = 'xCAT-server/share/xcat/netboot/ubuntu';
|
||||
|
||||
my @lists = (
|
||||
"compute.ubuntu24.04.x86_64.pkglist", # the working reference
|
||||
"compute.ubuntu24.04.ppc64el.pkglist",
|
||||
"compute.ubuntu24.04.ppc64le.pkglist",
|
||||
"compute.ubuntu26.04.pkglist",
|
||||
"compute.ubuntu26.04.ppc64el.pkglist",
|
||||
"compute.ubuntu26.04.ppc64le.pkglist",
|
||||
"compute.ubuntu26.04.riscv64.pkglist",
|
||||
"compute.ubuntu26.04.x86_64.pkglist",
|
||||
);
|
||||
|
||||
sub packages {
|
||||
my ($name) = @_;
|
||||
my $path = repo_path("$netboot/$name");
|
||||
return unless -r $path;
|
||||
my @packages = grep { length && !/^#/ }
|
||||
map { my $line = $_; $line =~ s/\s+//g; $line } read_lines($path);
|
||||
return \@packages;
|
||||
}
|
||||
|
||||
foreach my $name (@lists) {
|
||||
my $list = packages($name);
|
||||
ok($list, "$name is readable");
|
||||
|
||||
SKIP: {
|
||||
skip "no $name to inspect", 2 unless $list;
|
||||
|
||||
ok(scalar(grep { $_ eq 'dracut' } @{$list}),
|
||||
"$name installs dracut, so genimage enters dracut mode");
|
||||
ok(scalar(grep { $_ eq 'dracut-network' } @{$list}),
|
||||
"$name installs dracut-network, which brings the IPv6 boot modules");
|
||||
}
|
||||
}
|
||||
|
||||
done_testing();
|
||||
Reference in New Issue
Block a user