From a6e69e88a473a04dd18b8c3aea25382bc3bf5dad 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, 8 Sep 2026 17:00:42 -0300 Subject: [PATCH] fix(debian): stop reporting riscv64 as an unknown install architecture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mkinstall mapped x86_64 and x86 to their Debian names and accepted ppc64le and ppc64el. Every other architecture, riscv64 included, was logged as "Unknown arch" on each diskful install, although the install went on with the name unchanged, which is right for riscv64. Move the mapping into install_darch, which takes the Debian name from xCAT::Utils::debian_arch and knows the architectures xCAT installs Ubuntu on. riscv64 is one of them. Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com> --- xCAT-server/lib/xcat/plugins/debian.pm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/debian.pm b/xCAT-server/lib/xcat/plugins/debian.pm index c84f33638..2a4c2fb39 100644 --- a/xCAT-server/lib/xcat/plugins/debian.pm +++ b/xCAT-server/lib/xcat/plugins/debian.pm @@ -810,6 +810,15 @@ sub subiquity_boot_params { return (subiquity_kcmdline($base, $nfsip, $pkgdir, $instserver, $httpport, $node), undef); } +# The Debian name of an install architecture, and whether xCAT installs Ubuntu +# on it. ppc64le is kept as is: the media paths key on both spellings. +my %INSTALL_ARCH = map { $_ => 1 } qw(x86_64 x86 ppc64le ppc64el riscv64); + +sub install_darch { + my ($arch) = @_; + return ( xCAT::Utils::debian_arch($arch), $INSTALL_ARCH{ $arch // '' } ? 1 : 0 ); +} + sub mkinstall { xCAT::MsgUtils->message("S", "Doing debian mkinstall"); my $request = shift; @@ -1033,18 +1042,9 @@ sub mkinstall { xCAT::MsgUtils->trace($verbose_on_off, "d", "debian->mkinstall: pkgdir=$pkgdir pkglistfile=$pkglistfile tmplfile=$tmplfile"); } - if ($arch eq "x86_64") { - $darch = "amd64"; - } - elsif ($arch eq "x86") { - $darch = "i386"; - } - else { - if ($arch ne "ppc64le" and $arch ne "ppc64el") { - xCAT::MsgUtils->message("S", "debian.pm: Unknown arch ($arch)"); - } - $darch = $arch; - } + my $known; + ($darch, $known) = install_darch($arch); + xCAT::MsgUtils->message("S", "debian.pm: Unknown arch ($arch)") unless $known; my @missingparms; unless ($os) {