2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-10-22 07:38:08 +00:00
Commit Graph

429 Commits

Author SHA1 Message Date
Vinícius Ferrão cce001abb8 refactor(dhcp): share the packet capture lifecycle
Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-10-11 01:29:22 -03:00
Vinícius Ferrão b633f669c4 fix(dhcp): check SHA support only when OMAPI requires it 2026-10-05 22:54:27 -03:00
Vinícius Ferrão 32a688b30a build: require ipxe-xcat alongside xnba-undi
Unknown x86 clients and netboot=ipxe nodes boot the upstream iPXE
loader of the ipxe-xcat package, which the xCAT packages did not
install.

The specs require ipxe-xcat where they require xnba-undi: on x86 and
ppc for xCAT, and on x86 for xCATsn. xCAT on riscv64 and xCATsn on ppc
and riscv64 require ipxe-xcat alone, because a POWER or riscv64 server
can serve x86 nodes. The xcat and xcatsn debs depend on ipxe-xcat on
every architecture for the same reason. go-xcat installs and removes
ipxe-xcat with the other packages.

xnba-undi stays a dependency, because netboot=xnba nodes still boot
xNBA.
2026-10-02 23:58:14 -03:00
Vinícius Ferrão 5461b767ca refactor(go-xcat): define the riscv64 filter before a sourced run returns
A sourced go-xcat returns before the main program, which defined
riscv64_install_list, so a test that sources the script could not call
the filter. The function is now defined above the main program. A run of
the script does the same as before.
2026-10-02 23:58:13 -03:00
Daniel Hilst 0682d56de6 Merge master into fix/remove-xcat-genesis-builder
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-01 09:03:27 -03:00
Daniel Hilst b2e76e61e3 fix(xcat-core): go-xcat complete uninstall does not purge removed packages
After `apt-get remove`, dpkg reports a package as "deinstall ok
config-files". uninstall_xcat_completely() selected packages with
installed_packages(), which accepts only "install ok installed". So
`go-xcat completely uninstall` after `go-xcat uninstall` did not purge
the xCAT packages, and their configuration files stayed on the node.

uninstall_xcat_completely() now uses purgeable_packages(). On Debian it
also accepts packages whose state ends in "ok config-files". On rpm
systems it is installed_packages(). uninstall_xcat() keeps the
installed-only filter.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-28 14:56:34 -03:00
Daniel Hilst 0d8c61d8c3 fix(xcat-core): go-xcat cannot be sourced without running the installer
go-xcat runs internal_setup and the main program at file scope. A test
that sources the script to read its package lists or call its functions
starts the installer, so the tests extracted function bodies with awk and
evaluated them instead.

When go-xcat is sourced, it now skips internal_setup and returns before
the main program. A direct run and a run from a pipe do not change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-24 17:28:26 -03:00
Daniel Hilst e1e48a485d Merge master into fix/remove-xcat-genesis-builder
Master fixed debuild-xcat-genesis-base and added a bats test for it. The
branch deleted that script as unused. The merge keeps the script and
moves it to xCAT-genesis-base with the other Genesis base files.

Master also stages verify-genesis-payload for the spec %install check.
stage_genesis_base_sources() now stages it too, and
genesis_base_sources_staged.t expects it in the tarball.

The workflow, builds.rst and xcat_probe_package_payload.t take the
master version.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-24 16:42:35 -03:00
Vinícius Ferrão 16b6acf620 fix(openeuler): integrate current Genesis and installer changes
Merge current master into the openEuler support branch. Keep native
kernel, DHCP, locale and timezone requirements with the upstream payload
verifier and EL10 package paths. Preserve signed openEuler installation.

Update the native fixtures to check the merged payload contract.
2026-09-22 19:45:05 -03:00
Daniel Hilst 6edeafa438 fix(xcat-core): go-xcat asks to remove packages that are not installed
GO_XCAT_UNINSTALL_LIST names every package go-xcat installs plus the ones xCAT
has stopped producing, so a node installed before they went away is still
cleaned up. uninstall_xcat handed that whole list to the package manager, and
most of it is not installed on any one node: apt answers "Unable to locate
package" for a name it does not know and go-xcat warns once per package, while
dnf answers "No match for argument" and fails the call when nothing matches.

installed_packages() asks the local package database which of them this system
has, and uninstall_xcat and uninstall_xcat_completely pass only those on. A
node with none of them installed calls the package manager not at all.

This is also what makes a retired name in the list free to keep.

go_xcat_uninstall_installed_only.t runs uninstall_xcat with rpm and dpkg-query
answering from a fake package database and remove_package shadowed, and reads
the argument list the package manager would have been given. A filter that
kept everything and a filter that kept nothing each fail three of its four
assertions.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-16 18:25:29 -03:00
Daniel Hilst 1e939d4cb0 fix(xcat-core): the rename took the OpenEmbedded build instructions with it
Deleting xCAT-genesis-builder/README.md removed 99 lines that describe the
build path this branch keeps: the kas virtualenv, the architectures `oe/build`
accepts, the console keys, `oe/export`, the signed-extension workflow with
`oe/export-extension`, and the `oe/report` baseline comparison. Only the legacy
RPM builder half was dead. The reader is now told nothing about how to build a
Genesis image.

xCAT-genesis-base/README.md carries that half with its paths on the new
directory. The legacy RPM builder chapter stays deleted.

go-xcat keeps xCAT-genesis-builder in GO_XCAT_UNINSTALL_LIST. No build
produces that rpm any more, but a management node installed before 2.19 still
has it, and the list is what `go-xcat uninstall` hands to the package manager.

genesis_readme_paths.t asserts every in-tree path the README names exists, and
that its link to the architecture plan resolves. It reads the file because the
file is the artifact: the text is the instruction. It matches any xCAT-*
directory rather than the new name alone, so a path left on the old name fails
instead of going uncollected, and it bails below a fixed floor so a pattern
that stops matching cannot pass on an empty plan.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-16 18:19:40 -03:00
Vinícius Ferrão baf535fa26 feat(openeuler): use native repositories for bootstrap 2026-09-14 14:10:26 -03:00
Daniel Hilst 2a7364476e fix(xcat-core): xCAT-genesis-builder is named for a builder nothing calls
The directory holds the Genesis image sources and, beside them, a builder that
no pipeline runs. buildrpm, debuild-xcat-genesis-base, install, install.ubuntu,
check, cmdlist_check, findmcprpms, xCAT-genesis-builder.spec and the root
makerpm-genesisbuilder have no caller. So has build-ubunturepo, which
builddebs.pl replaced, and its -r flag has set an unread variable since 2013.
docs/source/references/coral/known_issues/genesis_base.rst tells the reader to
install an rpm no build produces, and go-xcat offers to remove that package.

Delete all of them, and rename the directory xCAT-genesis-base for what it
holds: the dracut modules the EL spec and the Ubuntu builder read, the
OpenEmbedded layers the GitHub job builds, the deb packaging, the image scripts
and 80-net-name-slot.rules.

Every reader of the old path is updated: buildrpms.pl, .gitattributes, the OE
workflow and the OpenEmbedded tests. buildrpms.pl mapped the package
xCAT-genesis-base to the directory xCAT-genesis-builder; the two names are the
same now, so the mapping goes.

xcat_probe_package_payload.t read build-ubunturepo for the probe helper staging.
builddebs.pl stages them with XCAT::BuildUtils::stage_probe_helpers, which
build_utils.t drives directly.

genesis_base_sources_staged.t passes with this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-12 08:45:49 -03:00
Daniel Hilst 24e22671b4 Merge branch 'master' of https://github.com/xcat2/xcat-core into release/2.19-rc1
master moved 149 commits ahead of the branch point and four files needed a
decision.

xCAT/debian/control and xCATsn/debian/control: master moved nmap and
ipmitool-xcat into Depends, raised the ipmitool version and added the s390x
OpenEmbedded Genesis recommendation. The branch made the genesis-scripts
dependency per architecture. Both are kept, so the ppc64el metapackage depends
on xcat-genesis-scripts-ppc64el and no longer on the amd64 package.

build-utils/lib/XCAT/BuildUtils.pm and xCAT-test/unit/build_utils.t: master
replaced @DEB_ARCHES plus the branch's %NO_RISCV64 exception list with
%ARCH_PACKAGES, which carries the architecture list per package.
deb_package_arches returns the same answer for every package, so master's form
is kept and %NO_RISCV64 is dropped.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-11 15:59:58 -03:00
Vinícius Ferrão 955713c4b2 fix(detect_dhcpd): capture into a private file and stop only its own tcpdump
Both copies wrote the capture to /tmp/dhcpdumpfile.log, so a file left by
another user or an earlier root run blocked the probe and two runs
overwrote each other. tcpdump ran behind a shell, so the script killed it
by searching the process table for any tcpdump on the interface, and a
tcpdump that failed to start left an empty file that read as zero DHCP
servers. An interrupt left the capture running.

The capture file is now a private temporary file removed on every exit.
The child execs tcpdump itself, so the script stops and reaps exactly that
pid, and a tcpdump that ended before the window did fails the run. A
failed send and an INT or TERM stop the capture and exit 1 as well.

Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-09-10 03:12:16 -03:00
Vinícius Ferrão 5957e7125d feat(go-xcat): install xCAT on a riscv64 management node
go-xcat stopped on riscv64 before it reached the package manager, so the
installer xCAT documents could not set up the management node the riscv64
packages are built for. The architecture is now accepted alongside the
others.

Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-09-08 22:01:27 -03:00
Daniel Hilst cd4d903879 Merge pull request #7820 from VersatusHPC/fix/ubuntu-install-pkglists
Make ospkgs and detect_dhcpd work on current Ubuntu releases
2026-09-08 14:13:17 -03:00
Vinícius Ferrão 20eef6d224 fix(detect_dhcpd): find tcpdump through PATH
Both copies refused to run unless /usr/sbin/tcpdump existed. Debian and Ubuntu
install it as /usr/bin/tcpdump, so the rogue DHCP detector never ran there and
the probe reported its tcpdump check as failed.

Resolve tcpdump through PATH and the standard system directories with
CommandUtils::find_executable, run the resolved path, and match that path when
the capture process is killed at the end.
2026-09-08 11:43:00 -03:00
Vinícius Ferrão 01d8de2bc2 fix(go-xcat): check the EPEL and CRB repositories on EL10 as well
The check ran on EL9 only, and only when the version carried a minor number,
so CentOS Stream was never checked. On EL10 a management node without EPEL
or CRB failed inside dnf install with a dependency error instead of the
message that names the missing repository. The CRB message proposed a CentOS
Stream repository file with signature checks disabled, on every
distribution. The probe used dnf list, which an installed copy of the probe
package satisfies with the repository disabled, and which reports a failed
query as a missing repository.

Check EL9 and EL10, with or without a minor version. Probe the enabled
repositories with repoquery for the host architecture and noarch, so a
source repository does not stand in for the binary one, and stop with the
package manager's own error when the query fails. Name the EPEL release
package of the running major version. For CRB, name crb enable from a
current epel-release, which handles Red Hat Enterprise Linux under both
subscription management and RHUI, Rocky Linux, AlmaLinux and CentOS Stream,
and the dnf config-manager command for Oracle Linux.
2026-09-07 13:40:19 -03:00
Daniel Hilst b83d3379e6 fix(xcat-core): go-xcat names a genesis package no apt repository has
On ppc64el "go-xcat install" and "go-xcat uninstall" stop with

  E: Unable to locate package xcat-genesis-scripts-ppc64

apt refuses the whole transaction, so no package of the list is installed
or removed.

The dpkg branch of GO_XCAT_INSTALL_LIST in
xCAT-server/share/xcat/tools/go-xcat names xcat-genesis-scripts-ppc64 and
xcat-genesis-base-ppc64. Those are rpm architecture names.
GO_XCAT_UNINSTALL_LIST is derived from the same array, so both actions
carry the wrong names. The Debian architecture is ppc64el.

This change renames the two entries of the dpkg branch. The rpm branch
keeps ppc64, which is the Genesis target architecture of the spec.

go_xcat_genesis_package_names.t fails the four deb assertions without
this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-04 19:51:18 -03:00
Vinícius Ferrão a4109f6865 feat(genesis): add s390x network boot 2026-09-04 12:48:32 -03:00
Vinícius Ferrão d1bd0fe576 refactor(dhcp): share OMAPI command runner 2026-09-03 18:13:59 -03:00
Vinícius Ferrão 8ffad6b21b refactor(go-xcat): centralize os-release parsing 2026-09-01 14:33:18 -03:00
Vinícius Ferrão 719e5aecab fix(genesis): close consumer review gaps 2026-08-25 11:26:46 -03:00
Vinícius Ferrão ba2c1e75bc fix(genesis): finish consumer integration 2026-08-25 11:26:45 -03:00
Vinícius Ferrão 52b0a0aedd test(genesis): mark sourced script fallback 2026-08-25 11:26:45 -03:00
Vinícius Ferrão 735951fefe feat(genesis): enable shared package repository 2026-08-25 11:26:44 -03:00
Daniel Hilst 1b5938969c fix(xcat-core): stop go-xcat aborting the install on obsolete/missing packages
go-xcat's install list still named yaboot-xcat, which was obsoleted in the
xcat-dep 2.18 rebuild and is no longer published. It also lists the cross-arch
ppc64 genesis packages, which the arch-split 2.18 dep repo no longer places in
the x86_64 view an x86 management node reads. Because EL dnf is strict by
default, any one of these unresolvable names aborts the entire `dnf install`
transaction, so `go-xcat install` fails outright on EL9/EL10 even though every
package the node actually needs is available.

Drop yaboot-xcat from the install list (kept in the uninstall list so existing
installs are still cleaned up) and pass `dnf --setopt=strict=0` so a package
missing from the enabled repository is warned and skipped instead of failing
the whole install. The existing post-install smoke test still catches a
genuinely broken install.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-07-20 12:14:10 -03: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 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 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 4165b26a04 fix: remove Docker container lifecycle management (dead code since 2016)
Docker container lifecycle management (mgt=docker, mkdocker, rmdocker,
lsdocker) was added in 2015-2016 as an experiment targeting Docker API
v1.22 on Ubuntu only. Documentation and man pages were deliberately
removed in 2019 (PRs #6222 and #6324) with the original developer's
approval, noting that "the interface of Docker has become very simple
right now, so there is no value for xCAT to offer such functions."

The plugin was still being shipped but has had no functional code changes
since April 2016, was never listed as a valid mgt value in Schema.pm,
and no user ever filed an issue about it.

Removed:
- xCAT-server/lib/xcat/plugins/docker.pm (1,142 lines)
- xCAT/postscripts/setupdockerhost
- xCAT-server/share/xcat/scripts/setup-dockerhost-cert.sh
- xCAT-test/autotest/testcase/dockercommand/ (test cases)
- Docker attribute definitions in Schema.pm
- Client symlinks (mkdocker, rmdocker, lsdocker)
- Usage entries and dockerhost cert handling in credentials.pm
- Docker attribute documentation in man7 pages

The "Running xCAT in Docker" documentation (dockerized_xcat/) is
retained as it documents containerizing xCAT itself, not the removed
mgt=docker feature.

Closes #7518
2026-05-03 12:11:33 -03:00
Vinícius Ferrão 714c0785b6 Preserve OPAL conf-file handling for Kea 2026-04-23 19:19:29 -03:00
Vinícius Ferrão 8399d88509 Address Perl quality findings 2026-04-23 03:04:37 -03:00
Vinícius Ferrão 6f3d9bb9d1 Add Kea DHCP backend 2026-04-23 02:01:33 -03:00
Markus Hilger f42011a493 Unify shebang lines 2024-05-07 16:43:07 +02:00
Markus Hilger 2643c1edd6 Remove useless executable bit 2024-05-07 16:19:25 +02:00
Samveen 3c0e09a116 Add workaround for sles-15 in go-xcat 2023-05-19 10:20:32 +05:30
Mark Gurevich b35fc1b0e7 go-xcat should not use available option 2023-03-02 14:12:43 -05:00
Mark Gurevich 1c0fc47c8a Install initscripts RPM during xCAT install(2) 2023-01-31 09:04:40 -05:00
Mark Gurevich a886e8c480 Enable go-xcat to insall xCAT on Alma Linux 2023-01-19 13:11:41 -05:00
Mark Gurevich af7264f1ba Bump up go-xcat version number 2022-12-07 11:12:25 -05:00
Mark Gurevich 8e6e151151 Installing xCAT on EL9 display message that EPEL and CRB repos are needed 2022-12-07 10:49:18 -05:00
Mark Gurevich 55e4078768 Install initscripts during xCAT go-install 2022-11-01 15:13:17 -04:00
Mark Gurevich 71d3b76881 Check SUSE-brand file on SLES 2022-08-15 10:16:22 -04:00
Mark Gurevich 14f45f9ba7 Removing jenkins files 2022-05-25 13:27:28 -04:00
Mark Gurevich 77a1971d99 Sync up xcatjktest 2022-05-24 08:49:41 -04:00
Mark Gurevich 890aa93bd1 Support Rocky Linux on service nodes 2021-07-27 10:07:01 -04:00
Wai Yee Wong 49e8af7fd7 Bump up the version number, update the copyright year and a new entry for the changes made 2021-07-08 17:29:55 -04:00
Wai Yee Wong f7feaf6005 Keep finding better wording 2021-07-08 16:36:53 -04:00