2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-24 11:22:18 +00:00

fix(netboot): keep EL10 diskless nodes from DHCP on every port

NetworkManager in an EL10 diskless image made a DHCP profile for every
Ethernet port without one. A port with a link but no DHCP server kept
NetworkManager-wait-online from finishing, so the node booted degraded.
Diskful nodes are not affected, because anaconda writes a profile for
every port.

genimage now sets no-auto-default=* in the NetworkManager configuration
of EL10 images. The boot interface keeps the profile from the initial
ramdisk. The other interfaces get only the profiles that the image or
the xCAT network configuration gives them.
This commit is contained in:
Vinícius Ferrão
2026-10-30 16:50:31 -03:00
parent 5609c8f811
commit 9da20e00cd
2 changed files with 14 additions and 0 deletions
@@ -223,6 +223,19 @@ sub write_nic_profiles {
return;
}
# NetworkManager otherwise makes a DHCP profile for every Ethernet port without one.
sub disable_auto_profiles {
my ($rootimg_dir, $osver) = @_;
my $major = el_major_version($osver);
my $confdir = "$rootimg_dir/etc/NetworkManager/conf.d";
return unless defined($major) && $major >= 10 && -d $confdir;
my $file = "$confdir/xcat.conf";
my $fh;
open($fh, '>', $file) && print($fh "[main]\nno-auto-default=*\n") && close($fh)
or die("Error: cannot write $file: $!\n");
return;
}
sub varsubinline{
my $line=shift;
my $refvardict=shift;
@@ -2167,6 +2167,7 @@ sub generic_post { #This function is meant to leave the image in a state approxi
close($cfgfile);
imgutils::write_nic_profiles($rootimg_dir, $osver, $prinic, $othernics);
imgutils::disable_auto_profiles($rootimg_dir, $osver);
# securetty not needed on s390x
if ($arch ne "s390x") {