Skip to content

Commit

Permalink
Merge pull request #7314 from gurevichmark/alma_support
Browse files Browse the repository at this point in the history
Initial Alma Linux support
  • Loading branch information
besawn committed Jan 18, 2023
2 parents 913fedb + 9fbd58b commit 1fcd09b
Show file tree
Hide file tree
Showing 32 changed files with 65 additions and 16 deletions.
4 changes: 2 additions & 2 deletions perl-xCAT/xCAT/Schema.pm
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ passed as argument rather than by table value',
table_desc => 'A few hardware and software characteristics of the nodes.',
descriptions => {
node => 'The node name or group name.',
os => 'The operating system deployed on this node. Valid values: AIX, rhels*,rhelc*, rhas*,centos*,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.',
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.',
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.',
Expand Down Expand Up @@ -799,7 +799,7 @@ passed as argument rather than by table value',
cfmdir => 'CFM directory name for PCM. Set to /install/osimages/<osimage name>/cfmdir by PCM. ',
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*,rocky*,SL*, fedora*, sles* (where * is the version #).',
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. Valid values: x86_64, ppc64, x86, ia64.',
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.',
Expand Down
4 changes: 2 additions & 2 deletions perl-xCAT/xCAT/Utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3724,7 +3724,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|rocky|sles|ubuntu)/) { push @nodesfiltered, $_; } } @{ $inref->{$::STATUS_INSTALLING} };
map { if ($nttabdata->{$_}->[0]->{os} !~ /(fedora|rh|centos|alma|rocky|sles|ubuntu)/) { push @nodesfiltered, $_; } } @{ $inref->{$::STATUS_INSTALLING} };
delete $inref->{$::STATUS_INSTALLING};
if (@nodesfiltered) {
@{ $inref->{$::STATUS_INSTALLING} } = @nodesfiltered;
Expand All @@ -3733,7 +3733,7 @@ sub filter_nostatusupdate {

@nodesfiltered = ();
if (exists $inref->{$::STATUS_NETBOOTING}) {
map { if ($nttabdata->{$_}->[0]->{os} !~ /(fedora|rh|centos|rocky|sles|ubuntu)/) { push @nodesfiltered, $_; } } @{ $inref->{$::STATUS_NETBOOTING} };
map { if ($nttabdata->{$_}->[0]->{os} !~ /(fedora|rh|centos|alma|rocky|sles|ubuntu)/) { push @nodesfiltered, $_; } } @{ $inref->{$::STATUS_NETBOOTING} };
delete $inref->{$::STATUS_NETBOOTING};
if (@nodesfiltered) {
@{ $inref->{$::STATUS_NETBOOTING} } = @nodesfiltered;
Expand Down
1 change: 1 addition & 0 deletions xCAT-server/lib/perl/xCAT/Postage.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,7 @@ sub getImageitems_for_node
{
if ($os =~ /rh.*/) { $platform = "rh"; }
elsif ($os =~ /centos.*/) { $platform = "centos"; }
elsif ($os =~ /alma.*/) { $platform = "alma"; }
elsif ($os =~ /rocky.*/) { $platform = "rocky"; }
elsif ($os =~ /fedora.*/) { $platform = "fedora"; }
elsif ($os =~ /SL.*/) { $platform = "SL"; }
Expand Down
6 changes: 6 additions & 0 deletions xCAT-server/lib/perl/xCAT/SvrUtils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ sub getsynclistfile()
if ($os) {
if ($os =~ /rh.*/) { $platform = "rh"; }
elsif ($os =~ /centos.*/) { $platform = "centos"; }
elsif ($os =~ /alma.*/) { $platform = "alma"; }
elsif ($os =~ /rocky.*/) { $platform = "rocky"; }
elsif ($os =~ /fedora.*/) { $platform = "fedora"; }
elsif ($os =~ /sles.*/) { $platform = "sles"; }
Expand Down Expand Up @@ -432,6 +433,7 @@ sub getsynclistfile()
if ($os) {
if ($os =~ /rh.*/) { $platform = "rh"; }
elsif ($os =~ /centos.*/) { $platform = "centos"; }
elsif ($os =~ /alma.*/) { $platform = "alma"; }
elsif ($os =~ /rocky.*/) { $platform = "rocky"; }
elsif ($os =~ /fedora.*/) { $platform = "fedora"; }
elsif ($os =~ /sles.*/) { $platform = "sles"; }
Expand Down Expand Up @@ -2173,6 +2175,10 @@ sub getplatform {
{
$platform = "centos";
}
elsif ($os =~ /alma.*/)
{
$platform = "alma";
}
elsif ($os =~ /rocky.*/)
{
$platform = "rocky";
Expand Down
2 changes: 1 addition & 1 deletion xCAT-server/lib/perl/xCAT/Template.pm
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ sub subvars {
my $space10 = " " x 10;
my $space12 = " " x 12;
foreach my $pkgdir (@pkgdirs) {
if ($platform =~ /^(rh|SL|centos|ol|fedora|rocky)$/) {
if ($platform =~ /^(rh|SL|centos|alma|ol|fedora|rocky)$/) {
if ($c == 0) {
# After some tests, if we put the repo in pre scripts in the kickstart like for rhels6.x
# the rhels5.9 will not be installed successfully. So put in kickstart directly.
Expand Down
23 changes: 17 additions & 6 deletions xCAT-server/lib/xcat/plugins/anaconda.pm
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ sub handled_commands
{
return {
copycd => "anaconda",
mknetboot => "nodetype:os=(^ol[0-9].*)|(centos.*)|(rocky.*)|(rh.*)|(fedora.*)|(SL.*)",
mkinstall => "nodetype:os=(pkvm.*)|(esxi4.1)|(esx[34].*)|(^ol[0-9].*)|(centos.*)|(rocky.*)|(rh(?!evh).*)|(fedora.*)|(SL.*)",
mksysclone => "nodetype:os=(esxi4.1)|(esx[34].*)|(^ol[0-9].*)|(centos.*)|(rocky.*)|(rh(?!evh).*)|(fedora.*)|(SL.*)",
mkstatelite => "nodetype:os=(esx[34].*)|(^ol[0-9].*)|(centos.*)|(rocky.*)|(rh.*)|(fedora.*)|(SL.*)",
mknetboot => "nodetype:os=(^ol[0-9].*)|(centos.*)|(alma.*)|(rocky.*)|(rh.*)|(fedora.*)|(SL.*)",
mkinstall => "nodetype:os=(pkvm.*)|(esxi4.1)|(esx[34].*)|(^ol[0-9].*)|(centos.*)|(alma.*)|(rocky.*)|(rh(?!evh).*)|(fedora.*)|(SL.*)",
mksysclone => "nodetype:os=(esxi4.1)|(esx[34].*)|(^ol[0-9].*)|(centos.*)|(alma.*)|(rocky.*)|(rh(?!evh).*)|(fedora.*)|(SL.*)",
mkstatelite => "nodetype:os=(esx[34].*)|(^ol[0-9].*)|(centos.*)|(alma.*)|(rocky.*)|(rh.*)|(fedora.*)|(SL.*)",

};
}
Expand Down Expand Up @@ -145,7 +145,7 @@ sub process_request
sub using_dracut
{
my $os = shift;
if ($os =~ /(rhels|rhel|centos|rocky|ol)(\d+)/) {
if ($os =~ /(rhels|rhel|centos|alma|rocky|ol)(\d+)/) {
if ($2 >= 6) {
return 1;
}
Expand Down Expand Up @@ -762,7 +762,7 @@ sub mknetboot
}

# turn off the selinux
if ($osver =~ m/(fedora12|fedora13|rhels7|rhels8|ol7|ol8|rocky8)/) {
if ($osver =~ m/(fedora12|fedora13|rhels7|rhels8|ol7|ol8|alma8|rocky8)/) {
$kcmdline .= " selinux=0 ";
}

Expand Down Expand Up @@ -2013,6 +2013,7 @@ sub copycd
}
if ($distname
and $distname !~ /^centos/
and $distname !~ /^alma/
and $distname !~ /^rocky/
and $distname !~ /^fedora/
and $distname !~ /^SL/
Expand Down Expand Up @@ -2070,6 +2071,8 @@ sub copycd
$distname = "centos-stream" . $1;
} elsif ($desc and $desc =~ /Rocky Linux (.*)/) {
$distname = "rocky" . $1;
} elsif ($desc and $desc =~ /AlmaLinux (.*)/) {
$distname = "alma" . $1;
}

unless ($dno) {
Expand Down Expand Up @@ -2156,7 +2159,11 @@ sub copycd
} elsif ($_ =~ /family\s*=\s*Rocky/i) {
$distname = "rocky" . $desc;
last;
} elsif ($_ =~ /family\s*=\s*Alma/i) {
$distname = "alma" . $desc;
last;
}

}
close($dinfo);
}
Expand Down Expand Up @@ -2407,6 +2414,10 @@ sub getplatform {
{
$platform = "centos";
}
elsif ($os =~ /alma.*/)
{
$platform = "alma";
}
elsif ($os =~ /rocky.*/)
{
$platform = "rocky";
Expand Down
6 changes: 3 additions & 3 deletions xCAT-server/lib/xcat/plugins/geninitrd.pm
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ sub geninitrd {
mkpath $tftppath;
}
if ($arch =~ /x86/) {
if ($osvers =~ /(^ol[0-9].*)|(centos.*)|(rocky.*)|(rh.*)|(fedora.*)|(SL.*)/) {
if ($osvers =~ /(^ol[0-9].*)|(centos.*)|(alma.*)|(rocky.*)|(rh.*)|(fedora.*)|(SL.*)/) {
$kernelpath = "$tftppath/vmlinuz";
copy("$pkgdir/images/pxeboot/vmlinuz", $kernelpath);
$initrdpath = "$tftppath/initrd.img";
Expand All @@ -205,7 +205,7 @@ sub geninitrd {
return;
}
} elsif ($arch =~ /ppc/) {
if ($osvers =~ /(^ol[0-9].*)|(centos.*)|(rocky.*)|(rh.*)|(fedora.*)|(SL.*)|(pkvm.*)/) {
if ($osvers =~ /(^ol[0-9].*)|(centos.*)|(alma.*)|(rocky.*)|(rh.*)|(fedora.*)|(SL.*)|(pkvm.*)/) {
$kernelpath = "$tftppath/vmlinuz";
copy("$pkgdir/ppc/ppc64/vmlinuz", $kernelpath);
if (-r "$pkgdir/ppc/ppc64/ramdisk.image.gz") {
Expand All @@ -231,7 +231,7 @@ sub geninitrd {
# call the insert_dd function in the anaconda or sles to hack the initrd that:
# 1. Get the new kernel from update distro and copy it to /tftpboot
# 2. Inject the drivers to initrd in /tftpboot base on the new kernel ver
if ($osvers =~ /(^ol[0-9].*)|(centos.*)|(rocky.*)|(rh.*)|(fedora.*)|(SL.*)/) {
if ($osvers =~ /(^ol[0-9].*)|(centos.*)|(alma.*)|(rocky.*)|(rh.*)|(fedora.*)|(SL.*)/) {
require xCAT_plugin::anaconda;
xCAT_plugin::anaconda->insert_dd($callback, $osvers, $arch, $initrdpath, $kernelpath, $driverupdatesrc, $netdrivers, $osdisupdir, $ignorekernelchk);
} elsif ($osvers =~ /(sles.*)|(suse.*)/) {
Expand Down
8 changes: 8 additions & 0 deletions xCAT-server/lib/xcat/plugins/imgcapture.pm
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,8 @@ sub getplatform {
$platform = "rh";
} elsif ($os =~ m/centos.*/) {
$platform = "centos";
} elsif ($os =~ m/alma.*/) {
$platform = "alma";
} elsif ($os =~ m/rocky.*/) {
$platform = "rocky";
} elsif ($os =~ m/fedora.*/) {
Expand Down Expand Up @@ -846,6 +848,12 @@ sub getOsVersion {
$version = $lines[0];
$version =~ s/[^0-9]*([0-9.]+).*/$1/;
$os = $os . $version;
}
elsif (grep (/Alma Linux/, @lines)) {
$os = "alma";
$version = $lines[0];
$version =~ s/[^0-9]*([0-9.]+).*/$1/;
$os = $os . $version;
}
elsif (grep (/Rocky/, @lines)) {
$os = "rocky";
Expand Down
1 change: 1 addition & 0 deletions xCAT-server/lib/xcat/plugins/imgport.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1354,6 +1354,7 @@ sub change_profile {
if ($os) {
if ($os =~ /rh.*/) { $platform = "rh"; }
elsif ($os =~ /centos.*/) { $platform = "centos"; }
elsif ($os =~ /alma.*/) { $platform = "alma"; }
elsif ($os =~ /rocky.*/) { $platform = "rocky"; }
elsif ($os =~ /fedora.*/) { $platform = "fedora"; }
elsif ($os =~ /sles.*/) { $platform = "sles"; }
Expand Down
1 change: 1 addition & 0 deletions xCAT-server/lib/xcat/plugins/ontap.pm
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ sub create_new_lun {
my %osmap = (
'rh.*' => 'linux',
'centos.*' => 'linux',
'alma.*' => 'linux',
'rocky.*' => 'linux',
'sles.*' => 'linux',
'win2k8' => 'windows_2008',
Expand Down
4 changes: 2 additions & 2 deletions xCAT-server/lib/xcat/plugins/route.pm
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ sub set_route {
} elsif ($os =~ /ubuntu|debian/) { #ubuntu or Debian?
addPersistentRoute_Debian($callback, $net, $mask, $gw_ip, $gw, $ifname);
}
elsif ($os =~ /rh|fedora|centos|rocky/) { #RH, Ferdora, CentOS
elsif ($os =~ /rh|fedora|centos|alma|rocky/) { #RH, Ferdora, CentOS
addPersistentRoute_RH($callback, $net, $mask, $gw_ip, $gw, $ifname);
}
} else { #AIX
Expand Down Expand Up @@ -756,7 +756,7 @@ sub delete_route {
} elsif ($os =~ /ubuntu/) { #ubuntu or Debian?
deletePersistentRoute_Debian($callback, $net, $mask, $gw_ip, $gw, $ifname);
}
elsif ($os =~ /rh|fedora|centos|rocky/) { #RH, Ferdora
elsif ($os =~ /rh|fedora|centos|alma|rocky/) { #RH, Ferdora
deletePersistentRoute_RH($callback, $net, $mask, $gw_ip, $gw, $ifname);
}
}
Expand Down
1 change: 1 addition & 0 deletions xCAT-server/share/xcat/install/alma/compute.alma8.pkglist
1 change: 1 addition & 0 deletions xCAT-server/share/xcat/install/alma/compute.alma8.tmpl
1 change: 1 addition & 0 deletions xCAT-server/share/xcat/install/alma/service.alma8.pkglist
1 change: 1 addition & 0 deletions xCAT-server/share/xcat/install/alma/service.alma8.tmpl
1 change: 1 addition & 0 deletions xCAT-server/share/xcat/netboot/alma/dracut
1 change: 1 addition & 0 deletions xCAT-server/share/xcat/netboot/alma/dracut_033
1 change: 1 addition & 0 deletions xCAT-server/share/xcat/netboot/alma/dracut_047
1 change: 1 addition & 0 deletions xCAT-server/share/xcat/netboot/alma/genimage
1 change: 1 addition & 0 deletions xCAT-server/share/xcat/netboot/alma/geninitrd
1 change: 1 addition & 0 deletions xCAT-server/share/xcat/netboot/alma/kvm.exlist
1 change: 1 addition & 0 deletions xCAT-server/share/xcat/netboot/alma/kvm.pkglist
1 change: 1 addition & 0 deletions xCAT-server/share/xcat/netboot/alma/xen.exlist
1 change: 1 addition & 0 deletions xCAT-server/share/xcat/netboot/alma/xen.pkglist

0 comments on commit 1fcd09b

Please sign in to comment.