mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-09-05 04:27:55 +00:00
feat(perl-xCAT): recognize riscv64 as a node and osimage architecture
riscv64 nodes boot through UEFI and grub2 only, like ppc64le PowerKVM guests and aarch64. Teach the three places that declare which noderes.netboot methods an architecture accepts about it: - xCAT::Utils::lookupNetboot returns grub2,grub2-tftp,grub2-http for riscv64 so nodeset and rinstall accept those methods. - the profiled-node rule table in xCAT::ProfiledNodeUtils defaults riscv64 nodes to grub2. - the nodetype.arch, osimage.osarch and noderes.netboot schema descriptions document riscv64. The arch token is riscv64 everywhere (rpm, dpkg and uname -m agree), so no alias handling is added.
This commit is contained in:
@@ -1429,6 +1429,27 @@ sub get_all_vmhosts
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
our %NETBOOT_RULES = (
|
||||
'x86_64' => 'xnba',
|
||||
'riscv64' => 'grub2',
|
||||
'ppc64' => {
|
||||
'rhels' => {
|
||||
'7' => 'grub2',
|
||||
'*' => 'yaboot',
|
||||
},
|
||||
'pkvm' => 'petitboot',
|
||||
'*' => 'yaboot',
|
||||
},
|
||||
'ppc64le' => {
|
||||
'*' => {
|
||||
'*' => {
|
||||
'*' => 'grub2',
|
||||
'ipmi' => 'petitboot',
|
||||
},
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
sub get_netboot_attr {
|
||||
my $class = shift;
|
||||
my $imageprofile = shift;
|
||||
@@ -1502,27 +1523,10 @@ sub get_netboot_attr {
|
||||
# 3 | | * | * | * | yaboot |
|
||||
# 4 | ppc64le/el | * | * | * | grub2
|
||||
# 4 | ppc64le/el | * | * | ipmi | petitboot
|
||||
# 5 | riscv64 | * | * | * | grub2 |
|
||||
# arch osname version hardware netboot
|
||||
my %netboot_dict = ('x86_64' => 'xnba',
|
||||
'ppc64' => {
|
||||
'rhels' => {
|
||||
'7' => 'grub2',
|
||||
'*' => 'yaboot',
|
||||
},
|
||||
'pkvm' => 'petitboot',
|
||||
'*' => 'yaboot',
|
||||
},
|
||||
'ppc64le' => {
|
||||
'*' => {
|
||||
'*' => {
|
||||
'*' => 'grub2',
|
||||
'ipmi' => 'petitboot',
|
||||
},
|
||||
},
|
||||
},
|
||||
);
|
||||
my $condition_array_ref = [ $os_arch, $os_name, $os_major_version, $mgt ];
|
||||
$netboot = cal_netboot(\%netboot_dict, $condition_array_ref);
|
||||
$netboot = cal_netboot(\%NETBOOT_RULES, $condition_array_ref);
|
||||
if ($netboot eq '0')
|
||||
{
|
||||
return 0, "Can not get the netboot attribute";
|
||||
|
||||
@@ -676,6 +676,7 @@ passed as argument rather than by table value',
|
||||
ppc64le NonVirtualize ALL petitboot
|
||||
ppc64le PowerKVM Guest ALL grub2,grub2-http,grub2-tftp
|
||||
aarch64 >=el8 grub2
|
||||
riscv64 >=el10 grub2,grub2-http,grub2-tftp
|
||||
|
||||
',
|
||||
tftpserver => 'The TFTP server for this node (as known by this node). If not set, it defaults to networks.tftpserver.',
|
||||
@@ -750,7 +751,7 @@ passed as argument rather than by table value',
|
||||
descriptions => {
|
||||
node => 'The node name or group name.',
|
||||
os => 'The operating system deployed on this node. Valid values: AIX, rhels*,rhelc*, rhas*,centos*, alma*, rocky*,SL*, fedora*, sles* (where * is the version #). As a special case, if this is set to "boottarget", then it will use the initrd/kernel/parameters specified in the row in the boottarget table in which boottarget.bprofile equals nodetype.profile.',
|
||||
arch => 'The hardware architecture of this node. Valid values: x86_64, ppc64, x86, ia64, aarch64.',
|
||||
arch => 'The hardware architecture of this node. Valid values: x86_64, ppc64, x86, ia64, aarch64, riscv64.',
|
||||
profile => 'The string to use to locate a kickstart or autoyast template to use for OS deployment of this node. If the provmethod attribute is set to an osimage name, that takes precedence, and profile need not be defined. Otherwise, the os, profile, and arch are used to search for the files in /install/custom first, and then in /opt/xcat/share/xcat.',
|
||||
provmethod => 'The provisioning method for node deployment. The valid values are install, netboot, statelite or an os image name from the osimage table. If an image name is specified, the osimage definition stored in the osimage table and the linuximage table (for Linux) or nimimage table (for AIX) are used to locate the files for templates, pkglists, syncfiles, etc. On Linux, if install, netboot or statelite is specified, the os, profile, and arch are used to search for the files in /install/custom first, and then in /opt/xcat/share/xcat.',
|
||||
supportedarchs => 'Comma delimited list of architectures this node can execute.',
|
||||
@@ -794,7 +795,7 @@ passed as argument rather than by table value',
|
||||
profile => 'The node usage category. For example compute, service.',
|
||||
osname => 'Operating system name- AIX or Linux.',
|
||||
osvers => 'The Linux operating system deployed on this node. Valid values: rhels*,rhelc*, rhas*,centos*,alma*, rocky*,SL*, fedora*, sles* (where * is the version #).',
|
||||
osarch => 'The hardware architecture of this node. For netboot/statelite images, QEMU emulation for non-native architectures is used if qemu-user-static is installed and configured via systemd-binfmt. Valid values: x86_64, ppc64, x86, ia64, aarch64.',
|
||||
osarch => 'The hardware architecture of this node. For netboot/statelite images, QEMU emulation for non-native architectures is used if qemu-user-static is installed and configured via systemd-binfmt. Valid values: x86_64, ppc64, x86, ia64, aarch64, riscv64.',
|
||||
synclists => 'The fully qualified name of a file containing a list of files to synchronize on the nodes. Can be a comma separated list of multiple synclist files. The synclist generated by PCM named /install/osimages/<imagename>/synclist.cfm is reserved for use only by PCM and should not be edited by the admin.',
|
||||
postscripts => 'Comma separated list of scripts that should be run on this image after diskful installation or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. See the site table runbootscripts attribute.',
|
||||
postbootscripts => 'Comma separated list of scripts that should be run on this after diskful installation or diskless boot. On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. See the site table runbootscripts attribute.',
|
||||
|
||||
@@ -4916,6 +4916,8 @@ sub lookupNetboot {
|
||||
$ret = "petitboot,grub2,grub2-tftp,grub2-http";
|
||||
} elsif ($osarch =~ /^aarch64$/i) {
|
||||
$ret = "grub2";
|
||||
} elsif ($osarch =~ /^riscv64$/i) {
|
||||
$ret = "grub2,grub2-tftp,grub2-http";
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
|
||||
Reference in New Issue
Block a user