2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-21 01:42:15 +00:00
Commit Graph

195 Commits

Author SHA1 Message Date
Daniel Hilst c0698fa253 Merge pull request #7995 from VersatusHPC/fix/opensuse-mn-package-requires
fix(xcat-core): xCAT cannot be installed on an openSUSE management node
2026-10-30 09:57:51 -03:00
Daniel Hilst ac0ec70821 Merge pull request #7979 from VersatusHPC/refactor/debian-profile-lookup
refactor(netboot): share profile asset selection
2026-10-29 14:58:18 -03:00
Vinícius Ferrão 447db00a81 fix(netboot): keep profile helpers with shared image utilities
Shared image utilities must not require the Debian source directory.

Keep the profile helper beside imgutils and materialize the Debian copy
when building RPM and DEB packages. Source-only Debian copies must follow
symlinks; installed Debian directories stay self-contained.
2026-10-26 18:29:45 -03:00
Daniel Hilst ef7989112f fix(xcat-core): xcatd does not start on an openSUSE node
xCAT installs on the leap15.6 node and the install gate still fails:

  GATE FAIL: xcatd not active
  GATE FAIL: lsdef cannot reach xcatd
  GATE FAIL: site.xcatdport not seeded

journalctl for xcatd has no entries, and loading the library by hand on the
node says why:

  Can't locate JSON.pm in @INC ... (@INC contains: /opt/xcat/lib/perl ...)

openSUSE has no perl-generators. Nothing generates a perl(...) requirement for
any xCAT package there, so no spec installs the modules its code loads, and
perl-xCAT names no Requires at all. Measured on xcat20-mn against the 85
external modules the EL build auto-requires: five are absent -- Date::Parse,
Expect, HTML::Form, JSON and SNMP -- and the other 80 are present.

Each openSUSE branch now names the modules EL's generator emits for that
package, as capabilities, so the same core build serves the sles15 and sles12
cells: both Leap releases provide all five, from perl-TimeDate, perl-Expect,
perl-HTML-Form, perl-JSON and perl-SNMP.

Verified with rpmspec that only openSUSE gets these; EL and openEuler are
unchanged and keep generating them.

xCAT-test/unit/opensuse_mn_requires.t fails on the commit before this one.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-26 10:22:32 -03:00
Daniel Hilst 844a5ba350 fix(xcat-core): xCAT cannot be installed on either openSUSE node
Both openSUSE test cells fail the install step:

  leap15.6: nothing provides 'perl-DB_File' needed by xCAT-server
  sles12:   nothing provides (/usr/sbin/dhcpd if openEuler-release else
            ((kea and kea-hooks) if (system-release >= 10) else
            /usr/sbin/dhcpd)) needed by xCAT

Two requirements are written for EL and have no answer on openSUSE.

xCAT-server asks for perl-DB_File. No package of that name exists on Leap
15.6 or 42.3: 15.6 calls it perl-core-DB_File and 42.3 has neither. Both
provide the capability perl(DB_File), so openSUSE asks for the capability.

xCAT and xCATsn ask for dhcpd through a rich dependency. The sles12 cell is
an openSUSE 42.3 management node whose rpm is 4.11, which has no rich
dependencies and reports the whole expression as an unprovided capability.
Neither Leap release carries kea and both carry chrony and ISC dhcpd, so
openSUSE takes the plain names the expressions resolve to there anyway. One
core build serves both openSUSE cells, so the openSUSE branch must emit no
rich dependency at all.

Verified per platform with rpmspec. openSUSE now gets perl(DB_File),
/usr/sbin/dhcpd and chrony; EL9 keeps perl-DB_File and both expressions; EL10
keeps perl-DB_File as a Recommends; openEuler keeps both expressions.

xCAT-test/unit/opensuse_mn_requires.t fails on the commit before this one.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-26 10:22:32 -03:00
Daniel Hilst b46826434a fix(xcat-selinux): openEuler builds a policy package it cannot compile
xCAT-selinux is in the default package set of buildrpms.pl, so every target
builds it. openEuler 20.03sp4 and 22.03sp4 carry selinux-policy 3.14.2, which
defines none of unconfined_server_stream_connectto(), files_map_etc_files() or
chronyd_manage_pid_files(). m4 leaves an undefined interface name in its
output and checkmodule stops with a syntax error, so rpmbuild fails and the
core build for that target publishes no repository at all.

SELinux support is EL only. XCAT::BuildUtils::package_skip_reason names the
packages an openEuler target does not build, and buildrpms.pl prints each pair
it skips. openEuler 24.03sp4 carries selinux-policy 40.7 and does compile the
module. It is excluded as well, so no openEuler release ships a package the
other releases cannot build.

xCAT-server and xCATsn required xCAT-selinux when selinux-policy-targeted was
installed, on openEuler too. openEuler defines %openEuler and no %rhel, so the
condition now names EL 8 and later and Fedora only. Without this an openEuler
management node cannot resolve xCAT-server.

xCAT-test/unit/selinux_el_only_scope.t fails on the parent commit.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-22 12:03:43 -03:00
Daniel Hilst 141f5b62ef Merge remote-tracking branch 'upstream/master' into feat/selinux-netboot
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>

# Conflicts:
#	.github/workflows/xcat_test.yml
2026-10-21 16:51:43 -03:00
Daniel Hilst 3d58aefcba fix(xcat-core): a relocated xcatd loads the modules of another installation
xcatd.service sets XCATROOT and PATH to the literal /opt/xcat. The
previous ExecStart sourced xcat.sh, which %post generates from
RPM_INSTALL_PREFIX0, so a relocated package got its own prefix. With the
package installed under /srv/xcat the daemon symlink reaches
/srv/xcat/sbin/xcatd and the Perl search path still names /opt/xcat, so
xcatd cannot load its own modules unless the administrator overrides the
environment or a default installation is left behind.

%post writes /etc/xcat/xcatroot.env with XCATROOT and PATH built from
RPM_INSTALL_PREFIX0, and the unit reads it with EnvironmentFile. The
order is the default in the unit, then that file, then
/etc/sysconfig/xcat, so the recorded prefix replaces the default and the
site file keeps the last word. ExecStart stays a direct call, so the
kernel still enters xcat_t on the xcatd script. %preun removes the file
on erase. The file is not in %files, so rpm --verify is unaffected.

xcatd_relocated_startup.t fails 3 checks of its /srv/xcat subtest
without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-21 16:50:33 -03:00
Vinícius Ferrão 199e4733a7 feat(uftp): add the UFTP transfer listener
Booting nodes need a server that sends a published root image once to
every node that asks for it in a short window.

xcat-uftp-listener accepts HTTP/1.0 GET requests that name an image
path and its digest. It serves only an archive that packimage published
under the configured image roots, for a digest that the checksum file
lists. It keeps the archive open from the first request, so a later
packimage does not change the bytes of a queued batch. It collects the
requests for the same inode, digest and port for batch_delay seconds,
then runs one closed-group uftp session for the batch. Connections,
queued jobs, senders and receivers per job are limited.

The sender gets an argument vector built only from the configuration,
and signs the encrypted session with a persistent server key. It drops a
receiver that misses nearly every block of a section, so one node
without multicast cannot hold the session open. A sender that is not the
UFTP 5 build of xcat-dep is refused.

block_size allows larger packets on jumbo frame networks, up to the
8800-byte limit of uftp.

xCAT::UFTP holds the decisions of the listener: request checks, batches,
limits, timeouts and the runtime check. The script holds the sockets,
the key commands and the sender processes.

The packages install the service but do not enable it. Package removal
stops and disables it.
2026-10-21 11:44:21 -03:00
Daniel Hilst 414504d069 feat(xcat-core): add the xCAT-selinux policy package
xCAT shipped no SELinux policy. On an enforcing management node httpd
could not read /install, which had no file context, or the /tftpboot
files that xcat.conf serves, and xcatws.cgi could not connect to xcatd.

The new noarch xCAT-selinux package builds the xcat module with the
selinux-policy-devel Makefile. The module labels /install
public_content_t and leaves each rootimg tree out of the relabel. It lets
httpd read tftpdir_t and lets httpd_sys_script_t connect to ntop_port_t.
The scriptlets use the selinux-policy macros, and %posttrans relabels
/install. They do not change the SELinux mode.

checkmodule writes module version 19, so the package built in the EL10
mock root installs on EL8, EL9 and EL10. On a Red Hat family build,
xCAT-server and xCATsn require xCAT-selinux when selinux-policy-targeted
is installed. SUSE and Debian builds do not change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-14 16:45:20 -03:00
Daniel Hilst 469e108ff4 Merge upstream master into fix/xcat-ws-conf-module-path
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-05 13:50:47 -03:00
Daniel Hilst 74d5184963 fix(xcat-core): xcat-ws.conf names a SUSE module path and never matches its package
`rpm -V xCAT-server` reports /etc/httpd/conf.d/xcat-ws.conf and
/etc/apache2/conf.d/xcat-ws.conf changed on every EL, openEuler and SUSE
management node, for the life of the install. %install shipped the Apache 2.2
fragment as the payload, and %post replaced it with the Apache 2.4 fragment
whenever httpd, apachectl or apache2ctl reported 2.4. Every supported
distribution runs Apache 2.4, so the file on disk never matched the package
digest. The drift is a permanent false positive for anyone who verifies an
installed xCAT before trusting it.

Both fragments also began with
`LoadModule rewrite_module /usr/lib64/apache2-prefork/mod_rewrite.so`. That
file exists only on SUSE under the prefork MPM. Apache tolerates it on EL and
openEuler because conf.modules.d loaded mod_rewrite first, and logs AH01574;
where the module is not loaded first, the missing file stops Apache from
starting.

xcat-ws.conf.apache22 and xcat-ws.conf.apache24 are replaced by one
xcat-ws.conf that serves both generations: the redirect sits behind
<IfModule mod_rewrite.c>, and the authorization directives behind
<IfModule mod_authz_core.c> and its negation. %install copies that one file to
both conf.d paths and %post no longer names them, so the payload is the final
file. %post runs a2enmod rewrite where a2enmod manages modules, which is how
SUSE gets the module the removed LoadModule used to pull in.

xCAT-test/unit/wsapi_apache_conf_portable.t fails 22 of its 30 assertions
without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-05 11:25:38 -03:00
Vinícius Ferrão 80418f2f73 feat(netboot): add the ipxe netboot method
xCAT boots x86 nodes through iPXE with netboot=xnba, which names the
xNBA fork that xCAT retires. netboot=ipxe is the method for the upstream
iPXE loaders of the ipxe-xcat package.

The ipxe plugin runs the xnba code, with the boot scripts under
xcat/ipxe/nodes instead of xcat/xnba/nodes. nodeset stat, the osimage
check of nodeset and rinstall, and the install check of Postage accept
the new value. The noderes.netboot description lists it and marks xnba
deprecated. The z/VM and FSM builds of xCAT-server leave the ipxe plugin
out with the xnba and pxe plugins. netboot=xnba does not change, and
makedhcp does not serve the new method yet.
2026-10-02 20:11:18 -03:00
Vinícius Ferrão 5ffc466824 feat(openeuler): select native RPM package policy
Use ISC DHCP for openEuler release packages. Retain the EL and SUSE
dependency choices. Select Apache 2.4, the httpd service and native Perl
build generators.
2026-09-14 23:31:28 -03:00
Vinícius Ferrão 4f26b38d81 build(server): make perl-DB_File a weak dependency of xCAT-server
perl-DB_File is only used by the Confluent client
(lib/xcat/Confluent/Client.pm). EL10 dropped libdb, EPEL re-adds it only
on its own architectures, and riscv64 has no perl-DB_File at all, so a
hard Requires makes xCAT-server uninstallable on a riscv64 management
node. Ask for it weakly: dnf installs it where it exists and skips it
where it does not; the Confluent client stays optional.

The dependency generator also turns Confluent/Client.pm's "use DB_File"
into a hard perl(DB_File) requirement regardless of the Recommends, so
that one generated requirement is excluded as well, appended to whatever
filter the build root already set.

Weak dependencies need rpm 4.12, so both only apply on a build host that
has it (EL8 and later, or SUSE 15 and later); older build hosts keep the
hard requirement they have today.
2026-09-01 10:50:20 -03:00
Vinícius Ferrão bdfe7a4a2c build(server): cover s390x Digest::SHA 2026-08-11 20:45:20 -03:00
Vinícius Ferrão 2ba1048f24 build(server): require Digest::SHA 2026-08-11 20:10:40 -03:00
Daniel Hilst 2d26dca480 Merge pull request #7614 from VersatusHPC/fix/xcatd-rpm-init-state
fix(packaging): preserve xcatd init state across RPM transactions
2026-07-24 12:25:28 -03:00
Vinícius Ferrão 3825677ad4 fix(xCAT-server): declare Perl deps used only by xCAT-server code
xCAT-server.spec sets "AutoReqProv: no", so RPM does not auto-generate
dependencies from the Perl modules this package ships. Modules that are
loaded (compile-time "use") only by xCAT-server code are therefore neither
auto-required here nor pulled in transitively by perl-xCAT (which does have
AutoReqProv on and already covers SNMP, Expect, JSON, Net::Ping, Time::HiRes
and Text::Balanced). On a host without them the package installs cleanly and
the affected subcommands then fail at load time with "Can't locate <M>.pm".

Add the five that are genuinely uncovered, each a compile-time "use" in a
module shipped by xCAT-server and used nowhere in perl-xCAT:

  perl-Net-Telnet       xCAT/SSHInteract.pm        (telnet switch/console)
  perl-Net-DNS          plugins/activedirectory.pm
  perl-Crypt-CBC        xCAT/IPMI.pm               (IPMI 2.0 RMCP+ crypto)
  perl-Crypt-Rijndael   xCAT/IPMI.pm               (IPMI 2.0 RMCP+ crypto)
  perl-DB_File          Confluent/Client.pm

The Crypt::CBC / Crypt::Rijndael gap is the notable one: IPMI.pm fails to
load without them, disabling all IPMI-based hardware control on a host where
those modules are absent.

Recovered from the unmerged lenovobuild branch (Jarrod Johnson; originals
807d30d3, c2e22f6f, 792e41727), reduced to the subset that master's current
packaging does not already satisfy.

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-21 14:26:17 -03:00
Vinícius Ferrão ef6e037366 refactor(packaging): share systemctl readiness guard 2026-07-21 11:08:05 -03:00
Vinícius Ferrão 09d1befb62 fix(packaging): preserve fresh legacy defaults 2026-07-21 11:08:04 -03:00
Vinícius Ferrão bdbf7b894a fix(packaging): preserve custom SysV runlevels 2026-07-21 11:08:04 -03:00
Vinícius Ferrão 7df7da59b3 fix(packaging): preserve unregistered legacy state 2026-07-21 11:08:04 -03:00
Vinícius Ferrão 115c9cda7e fix(packaging): preserve unmanaged xcatd init scripts 2026-07-21 11:08:03 -03:00
Vinícius Ferrão a47e73dc46 fix(packaging): converge xcatd init transitions 2026-07-21 11:08:03 -03:00
Daniel Hilst 419d6c262c Merge pull request #7596 from VersatusHPC/fix/issue-7593-systemd-packaging
fix: avoid sysvinit paths on systemd enabled systems
2026-07-17 21:35:45 -03:00
Vinícius Ferrão c34db2c55f fix(packaging): avoid SysV init paths in modern RPMs 2026-07-16 01:42:40 -03:00
Daniel Hilst 529c821177 fix(packaging): install-time DHCP rich dep + genesis-base out of flat core
The single flat xcat-core repo serves el8/el9/el10 from one build, but two spec
decisions were resolved at BUILD time and so were wrong for the other ELs that
share the same repo.

1. DHCP backend. xCAT.spec and xCATsn.spec selected the dhcp provider with a
   build-time %if (rhel >= 10 -> kea, else dhcpd), so an el10 build wrongly
   required kea on el8/el9 (and an el8/el9 build wrongly required dhcpd on
   el10). Replace it with an install-time RPM rich dependency:

     Requires: (kea if (system-release >= 10) else /usr/sbin/dhcpd)
     Requires: (kea-hooks if (system-release >= 10))

   dnf now resolves it per client: kea on el10+ (which dropped ISC dhcp from the
   distro), dhcpd on el8/el9. SLES has no "system-release" provide, so the
   condition is false there and it falls back to /usr/sbin/dhcpd, preserving
   prior behavior. system-release is versioned per release package
   (el10=10.x, el9=9.x, el8=8.x).

2. openssl. Make the xCAT-server openssl Requires uniform across EL (non-SUSE)
   instead of el10-only, so the produced package set does not depend on which EL
   the build host happened to be.

Also drop xCAT-genesis-base from the default @PACKAGES set in buildrpms.pl: its
initramfs bundles the build-chroot kernel/glibc and is therefore OS- and
arch-dependent, so it cannot ship in the single flat core. It is now built per
target by the xcat-dep pipeline (mockbuild-all.pl, via
`buildrpms.pl --package xCAT-genesis-base`) and ships in xcat-dep/rh<N>. The
explicit `--package xCAT-genesis-base` build path is retained.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-06-30 19:19:33 -03:00
Vinícius Ferrão 7897f30bfe Modernize xcatd service packaging 2026-05-04 18:13:23 -03:00
Vinícius Ferrão 88da644249 Merge pull request #7532 from VersatusHPC/fix/el10-netboot-dhcp-client
fix: use NetworkManager for EL10 netboot DHCP instead of dhclient
2026-05-04 17:20:11 +02:00
Vinícius Ferrão 1f9173f07a Fix some EL9 and EL10 provisioning gaps (#7530)
* Fix EL9 and EL10 provisioning gaps
2026-05-02 04:27:54 +02:00
Daniel Hilst Selli baa2380cd2 fix: Move dracut call to the .spec
This fixes a problem where the dracut image was pulling artifacts from
the build host and not the mock image, e.g. building for EL9 in EL10.

Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com>
2026-04-14 11:15:56 -03:00
Daniel Hilst Selli 1b0deaf9af fix: Fix dhcp-client dependency failure during genimage
Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com>
2026-04-01 13:02:35 -03:00
Daniel Hilst Selli 460451cef2 fix: Fix installation warnings regarding egrep and grep
Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com>
2025-11-28 13:06:02 -03:00
Daniel Hilst Selli 786d7d93e1 fix: Fix RPM dependencies
Add initscripts as dependency and openssl if we're
building for EL10 or greater.

Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com>
2025-11-27 18:06:33 -03:00
Mark Gurevich 32b072e35c Revert "Make sure initd files are installed with xCAT-server" 2022-11-01 15:17:34 -04:00
Mark Gurevich f2cdc7cb94 Make sure initd files are installed 2022-10-28 13:56:32 -04:00
Mark Gurevich 05bceac072 Prevent rpmbuild from checking and modifying interpreter directives 2022-08-11 13:38:26 -04:00
Mark Gurevich 4c18f63eb5 Add perl packages for building on CentOS8 (6) 2022-08-09 16:01:33 -04:00
Mark Gurevich 47c02f43f4 Support xcat-core builds on CentOS8 2022-05-12 14:38:12 -04:00
Mark Gurevich 1147726242 Support CentOS8 Stream 2021-08-31 15:54:43 -04:00
Mark Gurevich 7e635bafd9 Make xCAT-server require httpd 2021-04-07 15:23:05 -04:00
cxhong 881a8716f4 use cp -r to copy whole xcat/sample dir 2020-06-19 09:30:35 -04:00
Mark Gurevich 721c0bbc3b Spec file fix for XML::LibXML 2020-05-11 09:29:03 -04:00
Mark Gurevich fa86dd4fbb Use XML::LibXML::Simple instead of XML::Simple 2020-05-01 17:06:22 -04:00
GONG Jie 3e249fe766 Update grub2-xcat requirement 2019-05-16 17:30:32 +08:00
GONG Jie c06f1a4213 Update xCAT-server.spec to require a new version of grub2-xcat 2019-04-18 17:41:35 +08:00
Yuan Bai 95ca105635 enhancements for sle15 diskful CN deployment (#5605)
* add sle dir for copycds

* remove HPC packages from sle15 template

* copycds support ppc64le sle15

* support packages products for sle15

* create repos  for all products in sle15 Package ISO

* fix deployment status postbooting in sle15

* support sle15

* add copycds example for sle15

* generate add_on product

* polished

* adjust product_dir
2018-09-18 18:03:32 +08:00
Bin Xu 03242a3463 not generate debuginfo for xCAT-server package (#5431) 2018-07-25 15:25:08 +08:00
Bin Xu 57bc7c1f57 Add a default systemd unit file based on the auto-generated one from SysV (#5394)
* Add a default systemd unit file based on the auto-generated one from SysV

* modify the xcatd testcase when using systemd
2018-07-23 17:31:50 +08:00