From 6af317f7daf0eeefd6bebf1fad23401786a05dad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Tue, 15 Sep 2026 00:10:12 -0300 Subject: [PATCH] feat(openeuler): resolve native provisioning profiles --- perl-xCAT/xCAT/Utils.pm | 4 ++-- xCAT-server/lib/perl/xCAT/SvrUtils.pm | 20 +++++++++++++++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index 9a2541604..d7d22179b 100644 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -3804,7 +3804,7 @@ sub filter_nostatusupdate { #filter out the nodes which support the node provision status feedback my @nodesfiltered = (); if (exists $inref->{$::STATUS_INSTALLING}) { - map { if ($nttabdata->{$_}->[0]->{os} !~ /(fedora|rh|centos|alma|rocky|sles|ubuntu)/) { push @nodesfiltered, $_; } } @{ $inref->{$::STATUS_INSTALLING} }; + map { if ($nttabdata->{$_}->[0]->{os} !~ /(fedora|rh|centos|alma|rocky|sles|ubuntu|^openeuler[0-9])/) { push @nodesfiltered, $_; } } @{ $inref->{$::STATUS_INSTALLING} }; delete $inref->{$::STATUS_INSTALLING}; if (@nodesfiltered) { @{ $inref->{$::STATUS_INSTALLING} } = @nodesfiltered; @@ -3813,7 +3813,7 @@ sub filter_nostatusupdate { @nodesfiltered = (); if (exists $inref->{$::STATUS_NETBOOTING}) { - map { if ($nttabdata->{$_}->[0]->{os} !~ /(fedora|rh|centos|alma|rocky|sles|ubuntu)/) { push @nodesfiltered, $_; } } @{ $inref->{$::STATUS_NETBOOTING} }; + map { if ($nttabdata->{$_}->[0]->{os} !~ /(fedora|rh|centos|alma|rocky|sles|ubuntu|^openeuler[0-9])/) { push @nodesfiltered, $_; } } @{ $inref->{$::STATUS_NETBOOTING} }; delete $inref->{$::STATUS_NETBOOTING}; if (@nodesfiltered) { @{ $inref->{$::STATUS_NETBOOTING} } = @nodesfiltered; diff --git a/xCAT-server/lib/perl/xCAT/SvrUtils.pm b/xCAT-server/lib/perl/xCAT/SvrUtils.pm index b15aa3002..46d226df0 100644 --- a/xCAT-server/lib/perl/xCAT/SvrUtils.pm +++ b/xCAT-server/lib/perl/xCAT/SvrUtils.pm @@ -403,6 +403,7 @@ sub getsynclistfile() elsif ($os =~ /centos.*/) { $platform = "centos"; } elsif ($os =~ /alma.*/) { $platform = "alma"; } elsif ($os =~ /rocky.*/) { $platform = "rocky"; } + elsif ($os =~ /^openeuler/) { $platform = "openeuler"; } elsif ($os =~ /fedora.*/) { $platform = "fedora"; } elsif ($os =~ /sles.*/) { $platform = "sles"; } elsif ($os =~ /SL.*/) { $platform = "SL"; } @@ -435,6 +436,7 @@ sub getsynclistfile() elsif ($os =~ /centos.*/) { $platform = "centos"; } elsif ($os =~ /alma.*/) { $platform = "alma"; } elsif ($os =~ /rocky.*/) { $platform = "rocky"; } + elsif ($os =~ /^openeuler/) { $platform = "openeuler"; } elsif ($os =~ /fedora.*/) { $platform = "fedora"; } elsif ($os =~ /sles.*/) { $platform = "sles"; } elsif ($os =~ /SL.*/) { $platform = "SL"; } @@ -486,6 +488,9 @@ sub getsynclistfile() sub get_os_search_list { my $os = shift; + if ($os =~ /^(openeuler(?:20|22|24)\.03)(sp[1-9][0-9]*)?$/) { + return defined($2) ? ($os, $1, 'openeuler') : ($os, 'openeuler'); + } #example: for os=rhels7.6-alternate my ($baseos, $alter) = split(/\-/, $os); my @word = split(/\./, $baseos); @@ -542,7 +547,7 @@ sub _profile_file_matches { } my %valid_os_suffix = map { $_ => 1 } xCAT::SvrUtils::get_os_search_list($osver); - $valid_os_suffix{$genos} = 1 if $genos; + $valid_os_suffix{$genos} = 1 if $genos && $osver !~ /^openeuler/; if ($valid_os_suffix{$suffix}) { return 1; @@ -559,6 +564,7 @@ sub _profile_file_matches { sub get_file_name { my ($searchpath, $extension, $profile, $os, $arch, $genos) = @_; + $genos = undef if $os =~ /^openeuler/; #usally there're only 4 arguments passed for this function #the $genos is only used for the Redhat family @@ -634,6 +640,10 @@ sub get_postinstall_file_name { my $arch = shift; my $genos = shift; my $extension = "postinstall"; + if ($os =~ /^openeuler/) { + my $file = get_file_name($searchpath, $extension, $profile, $os, $arch, undef); + return defined($file) && -x $file ? $file : undef; + } my $dotpos = rindex($os, "."); my $osbase = substr($os, 0, $dotpos); @@ -2148,6 +2158,10 @@ sub parseosver { my $osver = shift; + if ($osver =~ /^(openeuler)(20|22|24)\.(03(?:sp[1-9][0-9]*)?)$/) { + return ($1, $2, $3); + } + if ($osver =~ (/(\D+)(\d*)\.*(\d*)/)) { return ($1, $2, $3); @@ -2367,6 +2381,10 @@ sub getplatform { { $platform = "rocky"; } + elsif ($os =~ /^openeuler/) + { + $platform = "openeuler"; + } elsif ($os =~ /fedora.*/) { $platform = "fedora";