Skip to content

Commit

Permalink
Merge branch 'xcat2:master' into aarch64
Browse files Browse the repository at this point in the history
  • Loading branch information
Obihoernchen committed Feb 21, 2024
2 parents 8118f8c + 540fbf2 commit 9947c3c
Show file tree
Hide file tree
Showing 52 changed files with 176 additions and 50 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/xcat_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ on: [pull_request, workflow_dispatch]
jobs:
xcat_pr_test:
runs-on: ubuntu-20.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- run: sudo apt-get install -y fakeroot reprepro devscripts debhelper libcapture-tiny-perl libjson-perl libsoap-lite-perl libdbi-perl libcgi-pm-perl quilt openssh-server dpkg looptools genometools software-properties-common
- run: perl github_action_xcat_test.pl
- uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get install -y fakeroot reprepro devscripts debhelper libcapture-tiny-perl libjson-perl libsoap-lite-perl libdbi-perl libcgi-pm-perl quilt openssh-server dpkg looptools genometools software-properties-common
- name: Run tests
run: perl github_action_xcat_test.pl
29 changes: 29 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/source/conf.py
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
# builder: "dirhtml"
# Fail on all warnings to avoid broken references
# fail_on_warning: true

# Optionally build your docs in additional formats such as PDF and ePub
formats: all

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt
2 changes: 1 addition & 1 deletion Version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.16.6
2.17.0
2 changes: 1 addition & 1 deletion build-ubunturepo
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ for package in ${packages[@]}; do
done

# Supported distributions
dists="saucy trusty utopic xenial bionic focal"
dists="saucy trusty utopic xenial bionic focal jammy"

c_flag= # xcat-core (trunk-delvel) path
d_flag= # xcat-dep (trunk) path
Expand Down
13 changes: 2 additions & 11 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,9 @@ The xCAT docs are hosted here: https://xcat-docs.readthedocs.io/ and are written

* Clone this project

* Install or update sphinx (See: https://pip.readthedocs.io/)
* Install dependencies (See: https://pip.readthedocs.io/)
```
pip install sphinx
```
or
```
pip install sphinx --upgrade
```

* Install ReadTheDocs theme
```
pip install sphinx_rtd_theme
pip install --user -r requirements.txt
```

* Build the Docs
Expand Down
5 changes: 4 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
docutils==0.17
sphinx==7.2.6
sphinx_rtd_theme==2.0.0
docutils==0.20.1
readthedocs-sphinx-search==0.3.2
1 change: 1 addition & 0 deletions docs/source/advanced/networks/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ Networking
ethernet_switches/index.rst
onie_switches/index.rst
switchdiscover/index.rst
vlan/index.rst
infiniband/index.rst
getadapter.rst
14 changes: 5 additions & 9 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx_search.extension',
]

# Add any paths that contain templates here, relative to this directory.
Expand Down Expand Up @@ -59,14 +60,14 @@
# The short X.Y version.
version = '2'
# The full version, including alpha/beta/rc tags.
release = '2.16.6'
release = '2.17.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'en'

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
Expand Down Expand Up @@ -144,13 +145,8 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
import os
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if on_rtd:
html_theme = 'default'
else:
# some of the popular themes: alabaster, sphinx_rtd_theme, classic, nature
html_theme = 'sphinx_rtd_theme'
# some of the popular themes: alabaster, sphinx_rtd_theme, classic, nature
html_theme = 'sphinx_rtd_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down
35 changes: 35 additions & 0 deletions perl-xCAT/xCAT/data/discinfo.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,34 @@ require Exporter;
use strict;

our %distnames = (
"1699649961.901830" => "alma9.3", #x86_64
"1683740561.481881" => "alma9.2", #x86_64
"1668611652.293224" => "alma9.1", #x86_64
"1653492552.897374" => "alma9.0", #x86_64
"1700507279.498559" => "alma8.9", #x86_64
"1684368711.170717" => "alma8.8", #x86_64
"1668064303.058266" => "alma8.7", #x86_64
"1652294731.711015" => "alma8.6", #x86_64
"1636648892.129507" => "alma8.5", #x86_64
"1622014558.977612" => "alma8.4", #x86_64
"1616719527.545010" => "alma8.3", #x86_64

"1699827798.672747" => "rocky9.3", #x86_64
"1683907016.7470503" => "rocky9.2", #x86_64
"1669255400.517928" => "rocky9.1", #x86_64
"1657031221.5900638" => "rocky9.0", #x86_64
"1700593425.194997" => "rocky8.9", #x86_64
"1684366557.751811" => "rocky8.8", #x86_64
"1668116088.755845" => "rocky8.7", #x86_64
"1652648703.486923" => "rocky8.6", #x86_64
"1636882174.934804" => "rocky8.5", #x86_64
"1624205633.869423" => "rocky8.4", #x86_64
"1619847935.413219" => "rocky8.3", #x86_64

"1636765473.891280" => "centos8.5", #x86_64
"1578087695.538488" => "centos8.1", #x86_64
"1578087695.537220" => "centos8.1", #ppc64le
"1603728831.612616" => "centos7.9", #x86_64
"1480943823.812754" => "centos7.3", #x86_64
"1450147276.351714" => "centos7.2", #ppc64le
"1449699925.561114" => "centos7.2", #x86_64
Expand Down Expand Up @@ -103,6 +124,20 @@ our %distnames = (
"1446216863.790260" => "rhels7.2", #x86_64
"1446216863.764721" => "rhels7.2", #ppc64
"1446216863.771788" => "rhels7.2", #ppc64le
"1554367054.162671" => "rhels8.0", #x86_64
"1571146135.637073" => "rhels8.1", #x86_64
"1585988230.312698" => "rhels8.2", #x86_64
"1602239874.439561" => "rhels8.3", #x86_64
"1620069559.055704" => "rhels8.4", #x86_64
"1634111543.317017" => "rhels8.5", #x86_64
"1650472728.682141" => "rhels8.6", #x86_64
"1665640879.622493" => "rhels8.7", #x86_64
"1681178617.415884" => "rhels8.8", #x86_64
"1698675913.542581" => "rhels8.9", #x86_64
"1673532738.064152" => "rhels9.0", #x86_64
"1666859625.373080" => "rhels9.1", #x86_64
"1681421276.520925" => "rhels9.2", #x86_64
"1698234899.296206" => "rhels9.3", #x86_64

"1285193176.593806" => "rhelhpc6", #x86_64
"1305067719.718814" => "rhelhpc6.1", #x86_64
Expand Down
2 changes: 1 addition & 1 deletion xCAT-genesis-builder/xCAT-genesis-base.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%global version %(rpm -q xCAT --qf "%{VERSION}" 2>/dev/null | grep -Po '[0-9\.]+' || echo "2.16.5")
%global version %(rpm -q xCAT --qf "%{VERSION}" 2>/dev/null | grep -Po '[0-9\.]+' || echo "2.17.0")
Version: %{version}
Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")}
%ifarch i386 i586 i686 x86
Expand Down
4 changes: 2 additions & 2 deletions xCAT-genesis-scripts/usr/bin/dodiscovery
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ if [ -r /sys/devices/virtual/dmi/id/product_name ]; then #x86
if [ -z "$MTM" ]; then
FRU=`ipmitool fru print 0`
if [ $? -eq 0 ]; then
MTM=`echo "$FRU" | awk -F': ' '/Product Manufacturer/ {m=$2} /Product Name|Product Part Number/ {if (n==""||n=="NONE") {n=$2}} END {print m":"n}'`
MTM=`echo "$FRU" | awk -F': ' '/Product Manufacturer/ {m=$2} /Product Name|Product Part Number/ {if (n==""||n~/\s+/||n=="NONE") {n=$2}} END {print m":"n}'`
fi
if [ -z "$MTM" -o "$MTM" == ":" ]; then
logger -s -t $log_label -p local4.warning "Couldn't find MTM information in FRU, falling back to DMI (MTMS-based discovery may fail)"
Expand Down Expand Up @@ -267,7 +267,7 @@ for dev in `ip link|grep -B1 ether|grep UP|awk '{print $2}'|sed -e s/://|grep -v
if [[ ! -z "$myport" && ! "$myport" =~ "Agent instance for device not found" ]]; then
echo " <switchport>$myport</switchport>" >> /tmp/discopacket
fi

echo "</nic>" >> /tmp/discopacket
done
if [ "$UUID" == "unknown" ]; then
Expand Down
52 changes: 36 additions & 16 deletions xCAT-server/lib/perl/xCAT/IPMI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,16 @@ my $ipmi2support;
if (-f "/etc/debian_release" or -f "/etc/debian_version") {
$ipmi2support = eval {
require Digest::SHA;
Digest::SHA->import(qw/sha1/);
Digest::SHA->import(qw/sha1 hmac_sha256/);
require Digest::HMAC_SHA1;
Digest::HMAC_SHA1->import(qw/hmac_sha1/);
1;
};
}
else {
$ipmi2support = eval {
require Digest::SHA1;
Digest::SHA1->import(qw/sha1/);
require Digest::SHA;
Digest::SHA->import(qw/sha1 hmac_sha256/);
require Digest::HMAC_SHA1;
Digest::HMAC_SHA1->import(qw/hmac_sha1/);
1;
Expand Down Expand Up @@ -455,12 +455,26 @@ sub open_rmcpplus_request {
$self->{sidm} = \@sidbytes;
unless ($self->{rmcptag}) { $self->{rmcptag} = 1; }
$self->{rmcptag} += 1;
my @payload = ($self->{rmcptag}, #message tag,
my @payload;
if ($self->{attempthash} == 256) {
$self->{hshfn} = \&hmac_sha256;
$self->{hshln} = 16;
@payload = ($self->{rmcptag}, #message tag,
0, #requested privilege role, 0 is highest allowed
0, 0, #reserved
@sidbytes,
0, 0, 0, 8, 3, 0, 0, 0, #table 13-17, request sha256
1, 0, 0, 8, 4, 0, 0, 0); #sha256 integrity
} else {
$self->{hshfn} = \&hmac_sha1;
$self->{hshln} = 12;
@payload = ($self->{rmcptag}, #message tag,
0, #requested privilege role, 0 is highest allowed
0, 0, #reserved
@sidbytes,
0, 0, 0, 8, 1, 0, 0, 0, #table 13-17, request sha
1, 0, 0, 8, 1, 0, 0, 0); #sha integrity
}
push @payload, (2, 0, 0, 8, 1, 0, 0, 0); # aes
$self->{sessionestablishmentcontext} = STATE_OPENSESSION;
$self->sendpayload(payload => \@payload, type => $payload_types{'rmcpplusopenreq'});
Expand Down Expand Up @@ -696,9 +710,9 @@ sub handle_ipmi_packet {
}

splice(@rsp, 0, 4); #ditch the rmcp header
my @authcode = splice(@rsp, -12); #strip away authcode and remember it
my @expectedcode = unpack("C*", hmac_sha1(pack("C*", @rsp), $self->{k1}));
splice(@expectedcode, 12);
my @authcode = splice(@rsp, 0-$self->{hshln}); #strip away authcode and remember it
my @expectedcode = unpack("C*", $self->{hshfn}->(pack("C*", @rsp), $self->{k1}));
splice(@expectedcode, $self->{hshln});
foreach (@expectedcode) {
unless ($_ == shift @authcode) {
return 3; #authcode bad, pretend it never existed
Expand Down Expand Up @@ -768,6 +782,11 @@ sub got_rmcp_response {
}
$byte = shift @data;
unless ($byte == 0x00) {
if ($self->{attempthash} == 256) {
$self->{attempthash} = 1;
$self->open_rmcpplus_request();
return 9;
}
if ($rmcp_codes{$byte}) {
$self->{onlogon}->("ERROR: " . $rmcp_codes{$byte}, $self->{onlogon_args}); #TODO: errors
} else {
Expand Down Expand Up @@ -799,7 +818,7 @@ sub send_rakp3 {
$self->{rmcptag} += 1;
my @payload = ($self->{rmcptag}, 0, 0, 0, @{ $self->{pendingsessionid} });
my @user = unpack("C*", $self->{userid});
push @payload, unpack("C*", hmac_sha1(pack("C*", @{ $self->{remoterandomnumber} }, @{ $self->{sidm} }, $self->{privlevel}, scalar @user, @user), $self->{password}));
push @payload, unpack("C*", $self->{hshfn}->(pack("C*", @{ $self->{remoterandomnumber} }, @{ $self->{sidm} }, $self->{privlevel}, scalar @user, @user), $self->{password}));
$self->sendpayload(payload => \@payload, type => $payload_types{'rakp3'});
}

Expand All @@ -823,6 +842,7 @@ sub send_rakp1 {

sub init {
my $self = shift;
$self->{attempthash} = 256;
$self->{confalgo} = undef;
$self->{integrityalgo} = undef;
$self->{sessionestablishmentcontext} = 0;
Expand Down Expand Up @@ -902,8 +922,8 @@ sub got_rakp4 {
return 9;
}
splice @data, 0, 6; #discard reserved bytes and session id
my @expectauthcode = unpack("C*", hmac_sha1(pack("C*", @{ $self->{randomnumber} }, @{ $self->{pendingsessionid} }, @{ $self->{remoteguid} }), $self->{sik}));
foreach (@expectauthcode[ 0 .. 11 ]) {
my @expectauthcode = unpack("C*", $self->{hshfn}->(pack("C*", @{ $self->{randomnumber} }, @{ $self->{pendingsessionid} }, @{ $self->{remoteguid} }), $self->{sik}));
foreach (@expectauthcode[ 0 .. ($self->{hshln} - 1) ]) {
unless ($_ == (shift @data)) {

#we'll just ignore this transgression...... *this time*
Expand Down Expand Up @@ -973,17 +993,17 @@ sub got_rakp2 {
my @user = unpack("C*", $self->{userid});
my $ulength = scalar @user;
my $hmacdata = pack("C*", (@{ $self->{sidm} }, @{ $self->{pendingsessionid} }, @{ $self->{randomnumber} }, @{ $self->{remoterandomnumber} }, @{ $self->{remoteguid} }, $self->{privlevel}, $ulength, @user));
my @expectedhash = (unpack("C*", hmac_sha1($hmacdata, $self->{password})));
my @expectedhash = (unpack("C*", $self->{hshfn}->($hmacdata, $self->{password})));
foreach (0 .. (scalar(@expectedhash) - 1)) {
if ($expectedhash[$_] != $data[$_]) {
$self->{sessionestablishmentcontext} = STATE_FAILED;
$self->{onlogon}->("ERROR: Incorrect password provided", $self->{onlogon_args});
return 9;
}
}
$self->{sik} = hmac_sha1(pack("C*", @{ $self->{randomnumber} }, @{ $self->{remoterandomnumber} }, $self->{privlevel}, $ulength, @user), $self->{password});
$self->{k1} = hmac_sha1(pack("C*", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), $self->{sik});
$self->{k2} = hmac_sha1(pack("C*", 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2), $self->{sik});
$self->{sik} = $self->{hshfn}->(pack("C*", @{ $self->{randomnumber} }, @{ $self->{remoterandomnumber} }, $self->{privlevel}, $ulength, @user), $self->{password});
$self->{k1} = $self->{hshfn}->(pack("C*", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), $self->{sik});
$self->{k2} = $self->{hshfn}->(pack("C*", 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2), $self->{sik});
my @aeskey = unpack("C*", $self->{k2});
$self->{aeskey} = pack("C*", (splice @aeskey, 0, 16));
$self->{sessionestablishmentcontext} = STATE_EXPECTINGRAKP4;
Expand Down Expand Up @@ -1129,8 +1149,8 @@ sub sendpayload {
push @msg, 7;
push @integdata, 7;
my $intdata = pack("C*", @integdata);
my @acode = unpack("C*", hmac_sha1($intdata, $self->{k1}));
push @msg, splice @acode, 0, 12;
my @acode = unpack("C*", $self->{hshfn}->($intdata, $self->{k1}));
push @msg, splice @acode, 0, $self->{hshln};

#push integrity pad
#push @msg,0x7; #reserved byte in 2.0
Expand Down
6 changes: 3 additions & 3 deletions xCAT-server/lib/xcat/plugins/dhcp.pm
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ sub addnode
$hname = $node;
} #Default to hostname equal to nodename
unless ($mac) { next; } #Skip corrupt format
if ($mac !~ /^[0-9a-fA-F]{2}(-[0-9a-fA-F]{2}){5,7}$|^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5,7}$/)
if ($mac !~ /^[0-9a-fA-F]{2}(-[0-9a-fA-F]{2}){5,8}$|^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5,8}$/)
{
$callback->(
{
Expand Down Expand Up @@ -764,8 +764,8 @@ sub addnode
$hostname = $1 . "-hf" . $count;
}
}
} elsif (length($mac) == 23) { # 8 bytes of mac address
# Currently the only thing that has 8 bytes is an infiniband
} elsif (length($mac) == 23 || length($mac) == 26) { # 8 or 9 bytes of mac address
# Currently the only thing that has 8 or 9 bytes is an infiniband
# or infiniband like device, which is type 32 (0x20).
$hardwaretype = 32;
}
Expand Down
1 change: 1 addition & 0 deletions xCAT-server/share/xcat/install/alma/compute.alma9.pkglist
1 change: 1 addition & 0 deletions xCAT-server/share/xcat/install/alma/compute.alma9.tmpl
1 change: 1 addition & 0 deletions xCAT-server/share/xcat/install/alma/service.alma9.pkglist
1 change: 1 addition & 0 deletions xCAT-server/share/xcat/install/alma/service.alma9.tmpl
1 change: 1 addition & 0 deletions xCAT-server/share/xcat/install/ol/compute.ol9.pkglist
1 change: 1 addition & 0 deletions xCAT-server/share/xcat/install/ol/compute.ol9.tmpl
1 change: 1 addition & 0 deletions xCAT-server/share/xcat/install/ol/service.ol9.pkglist
1 change: 1 addition & 0 deletions xCAT-server/share/xcat/install/ol/service.ol9.tmpl
Loading

0 comments on commit 9947c3c

Please sign in to comment.