From 2ef44d5d7f7553b7c0a7bf3d93da27e1a1a0180a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Thu, 20 Aug 2026 16:42:19 -0300 Subject: [PATCH] feat(xCAT-server): install and netboot EL10 riscv64 nodes EL riscv64 media lay out the installer kernel and initrd under images/pxeboot exactly like x86 and aarch64 media, but anaconda.pm only looked there for those two families and geninitrd.pm refused riscv64 outright ("unknow arch"). Treat riscv64 like x86/aarch64 in both places and recognise riscv64 kernels when a driver disk updates the installer kernel. There is no riscv64 SUSE media, so geninitrd keeps the unsupported-architecture error for sles/suse rather than reading the x86 SUSE layout. Diskless images get a riscv64 default network driver list (virtio, Intel, Realtek, Broadcom and Mellanox) and take the resolver libraries from lib64, which is where riscv64 EL puts them. --- xCAT-server/lib/xcat/plugins/anaconda.pm | 4 ++-- xCAT-server/lib/xcat/plugins/geninitrd.pm | 4 +++- xCAT-server/share/xcat/netboot/imgutils/imgutils.pm | 1 + xCAT-server/share/xcat/netboot/rh/genimage | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 9107f26ed..334f17108 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -1342,7 +1342,7 @@ sub mkinstall if ( ( - ( $arch =~ /x86/ or $arch =~ /aarch64/ ) and + ( $arch =~ /x86/ or $arch =~ /aarch64/ or $arch =~ /riscv64/ ) and ( -r "$pkgdir/images/pxeboot/vmlinuz" and $kernpath = "$pkgdir/images/pxeboot/vmlinuz" @@ -2798,7 +2798,7 @@ sub insert_dd { # and copy it to the /tftpboot my @new_kernels = <$dd_dir/rpm/boot/vmlinuz*>; foreach my $new_kernel (@new_kernels) { - if (-r $new_kernel && $new_kernel =~ /\/vmlinuz-(.*(x86_64|ppc64|el\d+|ppc64le|aarch64))$/) { + if (-r $new_kernel && $new_kernel =~ /\/vmlinuz-(.*(x86_64|ppc64|el\d+|ppc64le|aarch64|riscv64))$/) { $new_kernel_ver = $1; $cmd = "/bin/mv -f $new_kernel $kernelpath"; xCAT::Utils->runcmd($cmd, -1); diff --git a/xCAT-server/lib/xcat/plugins/geninitrd.pm b/xCAT-server/lib/xcat/plugins/geninitrd.pm index 157280ee7..47b07e883 100644 --- a/xCAT-server/lib/xcat/plugins/geninitrd.pm +++ b/xCAT-server/lib/xcat/plugins/geninitrd.pm @@ -189,7 +189,9 @@ sub geninitrd { unless (-d $tftppath) { mkpath $tftppath; } - if ($arch =~ /x86/) { + # riscv64 installation media exist for the EL family only; leave any other + # distribution to the "unknow arch" error below instead of reading it as x86 + if ($arch =~ /x86/ or ($arch =~ /riscv64/ and $osvers !~ /sles|suse/)) { if ($osvers =~ /(^ol[0-9].*)|(centos.*)|(alma.*)|(rocky.*)|(rh.*)|(fedora.*)|(SL.*)/) { $kernelpath = "$tftppath/vmlinuz"; copy("$pkgdir/images/pxeboot/vmlinuz", $kernelpath); diff --git a/xCAT-server/share/xcat/netboot/imgutils/imgutils.pm b/xCAT-server/share/xcat/netboot/imgutils/imgutils.pm index ea01a75ff..a5881c984 100644 --- a/xCAT-server/share/xcat/netboot/imgutils/imgutils.pm +++ b/xCAT-server/share/xcat/netboot/imgutils/imgutils.pm @@ -256,6 +256,7 @@ sub default_net_drivers { x86 => [qw(tg3 bnx2 bnx2x e1000 e1000e igb mlx_en mlx5_core virtio_net be2net)], x86_64 => [qw(tg3 bnx2 bnx2x e1000 e1000e igb mlx_en mlx5_core virtio_net be2net)], aarch64 => [qw(tg3 bnx2 bnx2x e1000e igb mlx_en mlx5_core virtio_net)], + riscv64 => [qw(e1000 e1000e igb ixgbe r8169 tg3 bnx2x mlx5_core virtio_net)], ppc64 => [qw(e1000 e1000e igb ibmveth ehea)], s390x => [qw(qdio ccwgroup)], }, diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index 20424cd82..3dc1c392d 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -1924,7 +1924,7 @@ EOMS } } - if ($arch =~ /x86_64/ or $arch =~ /aarch64/) { + if ($arch =~ /x86_64/ or $arch =~ /aarch64/ or $arch =~ /riscv64/) { push @filestoadd, "lib64/libnss_dns.so.2"; push @filestoadd, "lib64/libresolv.so.2"; } else {