2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-05-17 19:57:18 +00:00
Commit Graph

27045 Commits

Author SHA1 Message Date
Vinícius Ferrão 539ecf9bf4 Add AlmaLinux 10 ppc64le netboot symlinks
Match Rocky Linux 10 ppc64le coverage for AlmaLinux 10.
2026-05-10 01:52:03 -03:00
Vinícius Ferrão ca764c39c4 Add AlmaLinux 10 netboot symlinks for stateless provisioning
Add compute and service profile symlinks for alma10, following the
existing pattern used by alma8 and alma9. Also add the missing
dracut_105 symlink required by EL10's dracut v107.

Tested with BIOS and UEFI stateless provisioning on AlmaLinux 10.1.
2026-05-10 01:51:58 -03:00
Markus Hilger a10f0ccc38 Merge pull request #7571 from VersatusHPC/fix/confignetwork-remove-option
feat: confignetwork: add -r option to remove undefined NICs
2026-05-08 09:41:44 +02:00
Markus Hilger f004021b19 Merge pull request #7570 from VersatusHPC/fix/nicutils-ipv4-validation
fix: nicutils IPv4 address validation
2026-05-08 09:40:58 +02:00
Vinícius Ferrão b69d9ca1f8 confignetwork: add -r option to remove undefined NICs
Port the -r option from the deprecated confignics postscript to
confignetwork. This allows removing network configuration for NICs
that are not defined in xCAT, useful when nodes have extra interfaces
that get DHCP addresses by default.

Safety checks ported from confignics:
- Skip non-ethernet interfaces
- Skip bridge members
- Skip xCAT-defined NICs
- Skip install NIC
- Skip VLAN interfaces
- Skip bonding members (SLAVE/MASTER)

Closes: https://github.com/xcat2/xcat-core/issues/6142
Supersedes: https://github.com/xcat2/xcat-core/pull/7092

Co-Authored-By: Christopher Walker <cjw1006@gmail.com>
2026-05-07 23:45:34 -03:00
Vinícius Ferrão adb93b3eac Fix nicutils IPv4 address validation
Co-authored-by: JDiprose <3533220+JDiprose@users.noreply.github.com>
2026-05-07 23:00:07 -03:00
Markus Hilger 9bbd5644bc Merge pull request #7569 from VersatusHPC/fix/go-xcat-shellcheck
fix: ShellCheck compliance fixes in go-xcat
2026-05-08 02:00:55 +02:00
Markus Hilger 7425c1b490 Merge pull request #7568 from VersatusHPC/fix/genesis-scripts-shell-hygiene
fix: improve genesis-scripts shell quoting and syntax hygiene
2026-05-08 01:59:53 +02:00
Markus Hilger 4aa3205bca Merge pull request #7567 from VersatusHPC/fix/makedhcp-remote-networks
fix: non-local networks being skipped in makedhcp
2026-05-08 01:57:19 +02:00
Markus Hilger 2b987fed98 Merge pull request #7566 from VersatusHPC/fix/nicutils-uuid-hardening
fix: harden nmcli connection handling against spaces in NM profile names
2026-05-08 01:55:42 +02:00
Vinícius Ferrão b34d6abf08 go-xcat: ShellCheck compliance fixes
Address ShellCheck warnings across go-xcat without breaking
distro detection. Key changes:

- Replace source /etc/os-release with awk parsing that strips
  quotes, fixing detection on distros that quote ID/VERSION_ID
- Use $() instead of backticks for command substitution
- Quote $1 and file path variables in dnf/yum repo version checks
- Use ${FUNCNAME[0]} instead of ${FUNCNAME} for dispatch calls
- Fix $@ vs $* usage in string contexts (warn_if_bad, el9 check)
- Remove useless use of cat (UUOC) in pipe chains
- Escape $releasever/$basearch/$stream in CRB repo echo
- Use xargs instead of unquoted command substitution in rm
- Split local declaration and assignment per SC2155
- Fix minor typos (secert -> secret, preform -> perform)

Signed-off-by: Vinícius Ferrão <vinicius@ferrao.net.br>
Co-Authored-By: Samveen <samveen@samveen.in>
2026-05-07 19:16:47 -03:00
Vinícius Ferrão e239e04843 genesis-scripts: improve shell quoting and syntax hygiene
Replace backtick command substitutions with $(), quote variable
expansions to prevent word splitting, replace useless cat pipes with
redirections, use grep -q instead of redirecting to /dev/null, and use
bash parameter expansion for case conversion.

Based on the work from PR #6366, rebased and adapted to current master.
Shebangs already merged separately via df64bf8fe are excluded.

Co-Authored-By: Samveen <samveen@yahoo.com>
2026-05-07 18:17:00 -03:00
Vinícius Ferrão afbb9114cf fix: remove dead check that skips all remote networks in makedhcp
The activenics{"!remote!"} hash key is checked at line 1940 but never
set by any code path — neither the dhcpinterfaces parsing nor the
querynics discovery populates it. This causes the guard to always
evaluate true, hitting next and silently skipping every !remote!
network when dhcpinterfaces is defined in the site table or on a
service node.

Remove the dead check so remote networks are processed correctly.
The inner activenics{$netif} check (which uses the actual interface
name after stripping the !remote! prefix) is the correct guard and
is preserved.

Original analysis by lebonez in xcat2/xcat-core#7242.

Co-authored-by: Lebonez <25910791+lebonez@users.noreply.github.com>
2026-05-07 18:05:27 -03:00
Vinícius Ferrão 64ebf8c96e fix: harden nmcli connection handling against spaces in NM profile names
NetworkManager auto-generates connection names that can contain spaces
(e.g. "Wired connection 2"). Multiple devices can also share the same
auto-generated name. Both cases cause failures when names are passed
to nmcli in bridge and bond setup paths.

Resolve active connection UUID via nmcli device show (GENERAL.CON-UUID)
instead of by name, which avoids both word-splitting on spaces and
ambiguity when multiple connections share the same name.

Changes:
- Bridge slave setup: resolve UUID via device show instead of by name
- Bond slave setup: same UUID-via-device approach for con down/mod
- Bridge rollback: preserve original xcat-prefixed connection name so
  rollback paths restore the correct name instead of a UUID
- Utility functions: quote connection name arguments in
  is_nmcli_connection_exist, is_connection_activate_intime, and
  wait_nic_connect_intime for defensive correctness
- Add -F flag to grep in is_nmcli_connection_exist for literal matching
- Log both human-readable name and UUID when reusing existing connections

Tested on EL10 host with duplicate "Ethernet connection 1/2" profiles
across multiple NICs — UUID resolution via device returns exactly one
UUID per device regardless of name collisions.

Follows up on #7562 and #7483.

Co-authored-by: OliverTUBAF <86062666+OliverTUBAF@users.noreply.github.com>
2026-05-07 17:55:07 -03:00
Markus Hilger 96b0b0b551 Merge pull request #7565 from VersatusHPC/fix/netplan-static-ip-fallback
fix: add networkd fallback for netplan static IP probe
2026-05-07 19:54:37 +02:00
Markus Hilger 6bf1d9a1cb Merge pull request #7564 from VersatusHPC/fix/rh-genimage-dnf
fix: use dnf for EL8+ RH genimage installroot
2026-05-07 19:53:51 +02:00
Markus Hilger fa17f7072d Merge pull request #7563 from VersatusHPC/fix/isc-omapi-tsig-policy
feat: support configurable ISC OMAPI TSIG policy
2026-05-07 19:51:32 +02:00
Vinícius Ferrão 219b0f1f5d Add networkd fallback for netplan static IP probe
Detect static netplan addresses on older Ubuntu netplan releases by falling back to generated systemd-networkd configuration when netplan get is unavailable. Keep netplan get authoritative when supported.

Co-authored-by: karcaw <663031+karcaw@users.noreply.github.com>
2026-05-07 13:46:33 -03:00
Vinícius Ferrão 57daff8a31 Use dnf for EL8+ RH genimage installroot 2026-05-07 12:54:38 -03:00
Markus Hilger 155e58e4ed Merge pull request #7562 from VersatusHPC/fix/nicutils-bridge-quoting
fix: use connection UUID in bridge slave setup in NetworkManager
2026-05-07 11:57:17 +02:00
Markus Hilger 5bd7bd2112 Merge pull request #7561 from VersatusHPC/fix/confignetwork-typo
fix: typo in confignetwork preventing SETINSTALLNIC from working
2026-05-07 11:55:55 +02:00
Markus Hilger 79dd24d80b Merge pull request #7560 from VersatusHPC/fix/otherpkgs-dnf-detection
fix: detect dnf as package manager in ospkgs and otherpkgs postscripts
2026-05-07 11:53:54 +02:00
Markus Hilger b2272818d8 Merge pull request #7559 from VersatusHPC/fix/bmcsetup-disable-retry
fix: skip disabled IPMI user slots in bmcsetup
2026-05-07 11:52:30 +02:00
Markus Hilger 5463a7c46c Merge pull request #7558 from VersatusHPC/fix/mkdef-partial-object-on-validation-error
fix: prevent mkdef partial writes on validation errors
2026-05-07 11:50:41 +02:00
Vinícius Ferrão ab86139959 Support configurable ISC OMAPI TSIG policy
Add a shared OMAPI policy helper for ISC DHCP and DDNS so administrators can select the key name, signing algorithm, and omshell path from the site table while preserving the existing xcat_key hmac-md5 default.

Keep local ISC updates from hanging indefinitely when omshell does not exit, and use a static host-declaration fallback for local Ubuntu ISC releases where omshell is unstable for xCAT host updates.

Co-authored-by: gskouson <1507929+gskouson@users.noreply.github.com>
2026-05-07 03:57:10 -03:00
Vinícius Ferrão a6c2bc3790 fix: use connection UUID in bridge slave setup to handle spaces in NM profile names
NetworkManager can auto-generate connection names with spaces (e.g.
"Wired connection 2"). The bridge slave setup in create_bridge_interface_nmcli
stored this name in a variable that was later expanded unquoted in nmcli
commands, breaking both the initial con mod and all downstream operations
(con up, con delete on rollback). Resolve the connection to its UUID
before use, which is space-safe and valid for all nmcli operations.

Closes: #7483
2026-05-07 03:06:41 -03:00
Vinícius Ferrão 1e341d941a fix: typo in confignetwork preventing SETINSTALLNIC from working
bool_install_nic on line 99 should be boot_install_nic, matching
the variable used everywhere else in the script. This caused the
SETINSTALLNIC environment variable to have no effect.

Fixes: xcat2/xcat-core#7472
2026-05-07 03:02:07 -03:00
Vinícius Ferrão dd15d5abb5 fix: detect dnf as package manager in ospkgs and otherpkgs postscripts
On RHEL 9.x minimal installs, the yum package may not exist as a
separate RPM — only dnf is present with /usr/bin/yum as a symlink.
The previous detection using rpm -q yum would fail, causing hasyum
to remain 0 and skipping repo file creation entirely.

Replace rpm -q based detection with executable checks for /usr/bin/dnf
and /usr/bin/yum. Introduce yumcmd variable to carry the actual command
name through all package operations instead of hardcoding yum.

Fixes: xcat2/xcat-core#7497
2026-05-07 02:54:44 -03:00
Vinícius Ferrão 7c1444335e fix: skip disabled IPMI user slots in bmcsetup
bmcsetup iterated every user slot and retried ipmitool user disable for slots that were already disabled. Lenovo XCC reports those attempts as Invalid data field in request, so discovery can spend minutes retrying no-op disables.

Read the current user table once per BMC, keep the old fallback when the table cannot be read, and disable only non-target slots whose IPMI Msg flag is true. Also use the loop's current username when resolving the target slot and keep the intended userslot 2 fallback assignment.

Fixes xcat2/xcat-core#5065
2026-05-06 23:54:02 -03:00
Vinícius Ferrão 2ae97c2ac4 fix: prevent mkdef partial writes on validation errors 2026-05-06 20:40:38 -03:00
Markus Hilger 238b357428 Merge pull request #7557 from Obihoernchen/ci
Speed up CI
2026-05-07 01:00:20 +02:00
Markus Hilger cb11564ff1 Merge pull request #7556 from VersatusHPC/fix/openbmc-503-retry
fix: retry on HTTP 503 from OpenBMC REST API instead of failing
2026-05-07 00:34:10 +02:00
Markus Hilger 145bff6ca3 Speed up CI 2026-05-07 00:30:10 +02:00
Markus Hilger a90ef274aa Merge pull request #7555 from VersatusHPC/fix/ipmi-rmcptag-and-cbcpad
fix: ipmi rmcptag and cbcpad
2026-05-07 00:00:15 +02:00
Vinícius Ferrão 1bca57fa2a fix: retry on HTTP 503 from OpenBMC REST API instead of failing
OpenBMC BMCs intermittently return 503 Service Unavailable when the
REST service is busy or recovering. xCAT reported the error immediately,
requiring the user to manually retry. A second attempt usually succeeds.

Retry the same request up to 3 times with a 3-second wait on 503.
If all retries fail, report the error as before. The existing 504
handling for bmcreboot is preserved.

Ref: #4264
2026-05-06 18:50:53 -03:00
Markus Hilger ca6bafd723 Merge pull request #7553 from VersatusHPC/fix/tls-policy
feat: add xCAT TLS policy selection
2026-05-06 19:39:19 +02:00
Markus Hilger aa180925e3 Merge pull request #7550 from VersatusHPC/fix/profile-asset-dotted-osvers
fix: handle dotted OS versions in profile asset lookup
2026-05-06 19:18:26 +02:00
Markus Hilger 2b1986d946 Merge pull request #7552 from VersatusHPC/fix/ubuntu-live-media-guardrails
fix: guardrails for Ubuntu genimage
2026-05-06 19:17:08 +02:00
Markus Hilger b93a54daee Merge pull request #7554 from VersatusHPC/fix/dhcpop-requires
fix: use runtime require for xCAT::DHCP::Backend in dhcpop
2026-05-06 18:45:27 +02:00
Vinícius Ferrão 911c74fda6 fix: use runtime require for xCAT::DHCP::Backend in dhcpop
The xCAT-server build-readme script runs every tool in share/xcat/tools/
with --help during RPM packaging. At build time perl-xCAT is not installed,
so the compile-time 'use xCAT::DHCP::Backend' aborts before --help can run.

Switch to runtime require inside the remove-operation branch where the
module is actually needed.
2026-05-06 02:55:11 -03:00
Vinícius Ferrão c0e8b1730e fix: fall back from sha256 to sha1 on RAKP2 auth rejection
Extend the existing sha256-to-sha1 fallback (already present in
got_rmcp_response for Open Session errors) to also cover RAKP2
rejections with "Unauthorized name" (0x0d) or "Invalid role" (0x09).

Ref: #7511
2026-05-06 01:26:29 -03:00
Vinícius Ferrão 86f6a12264 fix: set IPMI name-only lookup bit in RAKP1 to match ipmitool
Set bit 4 (0x10) of the requested privilege byte in RAKP Message 1
for name-only user lookup, matching ipmitool behavior. Use the same
value consistently in all HMAC calculations (RAKP2 verification,
RAKP3 auth code, SIK derivation).

Without this, some BMCs fail user lookup with "Unauthorized name"
even though the credentials are correct.

Ref: #7511
2026-05-06 01:25:55 -03:00
Vinícius Ferrão 2bcdc52f92 fix: accept RMCP message tag 0 from OpenBMC with session ID correlation
OpenBMC-based BMCs return message tag 0 in RAKP2/RAKP4 instead of
echoing the tag from the request. xCAT rejected these as stale
responses and retried indefinitely until timeout.

Accept tag 0 but verify the remote console session ID in the response
matches our current sidm. This prevents stale retries from corrupting
session state while allowing OpenBMC responses through.

Applied to got_rmcp_response, got_rakp2, and got_rakp4.

Ref: #7511
2026-05-06 01:25:09 -03:00
Vinícius Ferrão cb2a6b3f3c fix: reject IPMI packets with invalid CBC padding instead of crashing
cbc_pad in decrypt mode reads the last byte as the pad count, then
calls splice(@block, 0 - $count). If decrypted data is corrupt, the
pad count can exceed the array size, crashing with "Modification of
non-creatable array value attempted, subscript -16".

Return empty string on invalid padding so the caller treats it as a
decryption failure rather than accepting corrupted data as a valid
IPMI response.

Ref: #7511
2026-05-06 01:23:10 -03:00
Vinícius Ferrão 2915e9be0e Add xCAT TLS policy selection 2026-05-05 23:20:18 -03:00
Markus Hilger 0649b4c4ac Merge pull request #7549 from VersatusHPC/fix/update-copyright
docs: update copyright to include xCAT Consortium
2026-05-06 03:17:12 +02:00
Markus Hilger b006975b54 Merge pull request #7551 from VersatusHPC/fix/sles-legacy-validation
fix: restore legacy SLES provisioning paths
2026-05-06 02:49:34 +02:00
Vinícius Ferrão 7b20bbd187 Guard Ubuntu live media package sources 2026-05-05 21:40:04 -03:00
Vinícius Ferrão 9f33b19214 fix: restore legacy SLES provisioning paths 2026-05-05 17:09:37 -03:00
Vinícius Ferrão 119b19ce14 fix: handle dotted OS versions in profile asset lookup 2026-05-05 13:50:58 -03:00