2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-19 17:02:15 +00:00
Commit Graph

2826 Commits

Author SHA1 Message Date
Daniel Hilst cd67199463 fix(netboot): an IPv6-only diskless node boots with no address
xcatroot writes the netplan of the booted system from the interface it found,
and it always wrote "dhcp4: true". An IPv6-only node has no DHCPv4 server, so it
reached its login prompt with no address: Ubuntu 24.04.5 reported
"[FAILED] Failed to start systemd-networkd-w... Wait for Network to be
Configured." and "[FAILED] Failed to start xcatpostinit.service", and the node
answered no ssh.

The address is already on the kernel command line, in the static form dracut
takes. xcat_static_ip6_fields reads it and the netplan carries the address, the
prefix and a default route through the gateway. A node whose command line holds
an IPv4 form keeps dhcp4, because the fields are read only from a bracketed
literal.

Captured by xCAT-test/bats/ipv6_xcatroot_netplan.bats. Reading the fields by
cutting on the first colon, which is what an IPv6 literal breaks, fails the
three parsing assertions and leaves the four refusals passing.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 16:01:34 -03:00
Daniel Hilst 0ac354f931 fix(sle): an IPv6 install server empties the AutoYaST profile
pre.sle substitutes the install server for XCATNEXTSERVERHOOK in the media_url
that xCAT::Template writes for every install source. The substitution read
sed -e 's!XCATNEXTSERVERHOOK!'$nextserver'!', with the value unquoted, and
shopt -s nullglob is set earlier in the same script. An IPv6 server is bracketed,
so "[2001:db8::1]" is a glob that matches no file and the whole sed script word
is removed. sed then reads the profile as its script and writes nothing, so
/tmp/profile/modified.xml is empty. AutoYaST falls back to the unmodified profile
and stops on "Disk 'XCATPARTITIONHOOK' was not found", because the pre-script
also substitutes the install disk into that profile.

The substitution moves into substitute_nextserver, which quotes the value. An
IPv4 server was never affected, because it carries no bracket.

Captured by xCAT-test/bats/ipv6_pre_sle_nextserver.bats. With the quotes removed
again, assertions 9 and 10 fail and the IPv4 assertion 11 still passes.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 11:53:52 -03:00
Daniel Hilst 174668fb60 fix(sles): an IPv6 install server reaches the media_url as "[2001"
The nextserver derivation in pre.sle and pre.sles split the URL authority at the
first colon, which splits an IPv6 literal. YaST then had no usable install source
on a SLE15 or SLES12 node installed over IPv6.

Both scripts now read the authority with the bracket-aware form pre.rhels10 already
uses, and put the brackets back when the host is an IPv6 address, because the value
goes into a media_url. A portless IPv4 URL no longer keeps its path.

Captured by xCAT-test/bats/ipv6_pre_sle_nextserver.bats, which fails 5 of its 8
assertions without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 08:56:37 -03:00
Daniel Hilst 116d1c1227 fix(install): an IPv6-only node gets no credentials and stays at postbooting
post.xcat and post.xcat.ng exported XCATSERVER as "$MASTER_IP:3001".
getcredentials.awk and updateflag.awk split that value on a colon to separate the
address from the port, and an IPv6 address is full of colons, so the node could not
reach xcatd. remoteshell installed no root key and the node stopped at
installstatus postbooting.

Measured on openEuler 24.03: the node installed, booted, answered ping6 on its
reserved address, and refused xdsh with "Permission denied (publickey)" while its
status stayed postbooting.

Both scripts now build the endpoint with format_host_port, as post.xcat.rhels10
already did.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 05:57:00 -03:00
Daniel Hilst 1bf2e7f7b6 fix(install): an IPv6-only node halts in %post downloading its postscripts
post.xcat and post.xcat.ng built their download URLs as
"http://$MASTER_IP:${HTTPPORT}...". An IPv6 management node address already
contains colons, so the result is not a URL, curl and wget refuse it, the script
reports installstatus failed and halts with sleep infinity. The install itself has
already succeeded at that point, so the node sits in %post and xCAT records
status=failed, which reads as an install failure.

Measured on openEuler 24.03: the node took its reserved address, installed all 565
packages over IPv6, then stopped in "Running post-installation scripts".

Both scripts now carry the format_uri_host helper that post.xcat.rhels10 already
had, and build their URLs from MASTER_HTTP_HOST. The helper is a third copy because
a node has no shared shell library at the point these scripts run.

This reaches openEuler, EL 8, EL 9 and CentOS 8 through post.xcat.ng, and the
Ubuntu and SUSE post scripts through post.xcat. EL 10 was already correct.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 02:54:28 -03:00
Daniel Hilst bfbc014ffe feat(xcat-core): a SUSE node can install over IPv6
sles.pm matched ipv6 nowhere in 2801 lines and the SUSE templates wrote
"<bootproto>dhcp</bootproto>" directly, so an IPv6-only SUSE node had no way to configure its
installer: DHCP cannot serve it, and SUSE has no static handoff on the kernel command line.

_autoyast_network6 builds the networking section of such a node, with a static interface, the
address of the node and a prefix length, which is what AutoYaST takes for IPv6 instead of a
netmask, and a default route carrying the IPv6 gateway.

The #YAST2NET6# directive chooses between that and the DHCP block the templates carried. An IPv4
node gets that block unchanged, which is why the existing #YAST2NET# was not used: its DHCP arm
renders something else, and leap15.6 is a gating cell. compute.leap15.tmpl and compute.sle15.tmpl
take the directive.

autoyast_ipv6_network.t covers the section. Emitting a netmask instead of a prefix length fails 2
of its 11 assertions. The IPv4 output of the directive was compared with the text it replaced and
is identical.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 01:37:57 -03:00
Daniel Hilst 2371e2a98e fix(xcat-core): a syslog target with a port is bracketed as if it were an IPv6 literal
site.master may carry a port. format_syslog_forward_target in
xCAT/postscripts/syslog bracketed any value containing a colon, so
MASTER=127.0.0.1:1515 rendered the rsyslog line as @[127.0.0.1:1515], which
rsyslog does not accept, and syslog_ng_udp_driver chose udp6 for an IPv4 peer.
format_syslog_server in the dracut_105 rsyslogd-start.sh carries its own copy of
the rule and had the same defect; it runs inside the initramfs and cannot source
the postscript, so the rule is held down twice on purpose.

An IPv4 address or a hostname with a port has exactly one colon and an IPv6
literal has at least two, so the test is now on two colons rather than one. A
value already starting with "[" is left alone whether or not a port follows it,
which the old pattern missed: it required a trailing "]" and so double-bracketed
[2001:db8::1]:514.

ipv6_syslog_forwarding.bats gains four cases. Without the fix, "a target with a
port is not mistaken for an IPv6 literal", "an already-bracketed target with a
port is left alone" and "the initrd launcher does not mistake a port for an IPv6
literal" all fail; the compressed-literal case passes either way and is there to
show the bracketing of ::1 did not regress.

Also: grub2_ipv6.t could not load grub2.pm once xcat-core/#7980 made it use
xCAT::DHCP::BootPolicy, which lives in perl-xCAT. The file died at compile time
and reported no plan at all, which in a prove summary reads as a count
discrepancy rather than a failure. It now puts perl-xCAT and the server perl
directory on @INC, as every other plugin test does.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-26 15:27:21 -03:00
Daniel Hilst 0fb17cab83 fix(xcat-core): an EL10 diskless node powers off with no netroot handler
An EL10 stateless compute node gets its lease, loads its iPXE script and
downloads the kernel and the initramfs, then dies four seconds into the
kernel:

    dracut: FATAL: No handler for netroot type 'xcat'
    dracut: Refusing to continue
    reboot: Power down

xCAT-server/share/xcat/netboot/rh/dracut_105/stateless/xcatroot lost its
execute bit in 3928c0450. genimage copies the file with the mode it reads
from the share tree, and dracut's inst_script keeps that mode, so
/sbin/xcatroot reaches the initramfs mode 0644. dracut resolves the
handler with command -v, which skips a file that is not executable, so
netroot.sh finds no handler and gives up. An EL9 node reads dracut_047,
where the same file is mode 0755, so only EL10 is affected.

The fix restores mode 0755. netboot_xcatroot_executable.t fails without
it.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-26 15:27:20 -03:00
Vinícius Ferrão f05677d173 feat(ipv6): add EL10 IPv6-only provisioning support
An IPv6-only provisioning network cannot deploy a node. The discovery and
credential callbacks open IPv4 sockets, the kickstart and boot templates
render an IPv4 address into every endpoint, and makehosts drops an IPv6
value because hosts.pm gates on isIpv4addr.

NetworkUtils gains the address helpers the rest of the change uses:
format_host_port, parse_host_port and format_uri_host bracket an IPv6
literal, getNodeNetworkCfg6 reads the static IPv6 configuration of a node,
my_ip_facing_family selects the management-node address of one family,
getIPv6ReverseZone builds a nibble-aligned reverse zone, and
node_is_ipv6_only and ipv6_server_for_node answer the two questions the
plugins used to answer for themselves. credentials.pm opens the callback
socket through IO::Socket::INET6 when the modules are present and keeps the
IPv4 path when they are not. Template.pm and anaconda.pm render an IPv6
kickstart network line and bracketed endpoints. The postscripts and the
stateless xcatroot format every endpoint through the bracketing helpers.

xCAT-server requires perl-IO-Socket-INET6 and perl-Socket6 on EL, and
libio-socket-inet6-perl and libsocket6-perl on Debian.

(cherry picked from commits c0a69bb5a and caa8ca790)
Ported onto upstream master ee6b4f532. The two commits are folded because the
second refactors the first. Master is kept where it has a newer form of the
same thing: the getipaddr cache guard, the Kea control_socket_path helper, the
netboot method list, install_device_params, the modern_installer test and the
isValidIp validator, which replaces the isValidIPAddress this branch added.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit 3928c04507)
2026-10-26 15:27:08 -03:00
Daniel Hilst c768025739 Merge upstream/master into feat/selinux-netboot
Twelve conflicts, all from xcat-core/#7970 landing.

Eleven are the one sed line in the netboot postinstall profiles, where #7970 and
this branch replaced the same line with different patterns. Master's wins: it
anchors on optional leading blanks and preserves a trailing comment, which this
branch's `s/^SELINUX=.*$/SELINUX=disabled/` would have eaten. This branch's own
postinstall_selinux_config.bats asserts "the comment that names permissive keeps
its text", so the better pattern is the one its test already wanted -- 6 of 6
pass on master's version. What master's pattern does not catch is a value
outside enforcing|permissive, which nothing here tests and no stock config
ships.

The twelfth is .github/workflows/xcat_test.yml: master added a step to the
existing job and this branch adds a whole selinux_policy_test job after it.
Resolved as the union, with master's step where it put it; the file still parses
and names three jobs.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-23 14:42:37 -03:00
Vinícius Ferrão 88915f34cf fix(netboot): use POSIX firewalld checks in postinstall profiles
Use separate test commands under /bin/sh. Remove regular files and symlinks,
including dangling links, while retaining absent entries and directories.
2026-10-21 18:07:11 -03:00
Vinícius Ferrão ce335ba3b3 fix(netboot): correct SELinux assignments in postinstall profiles
Match the complete enforcing or permissive setting. Preserve comments and
whitespace, and do not change unrelated lines or create a missing policy
file.
2026-10-21 18:01:27 -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 21a0ad8089 Merge pull request #7962 from VersatusHPC/feat/uftp-rootimg-transport
feat(uftp): distribute stateless root images over UFTP multicast
2026-10-21 15:52:02 -03:00
Vinícius Ferrão 0c160da2d0 feat(uftp): receive the root image over UFTP on Ubuntu stateless nodes
genimage gives the stateless dracut initial ramdisk of an Ubuntu image
the same UFTP receiver as an EL image, under the same conditions.
xcatroot receives the first copy of the image over UFTP when nodeset
asks for it, and checks it like an HTTP download.

The kernel does not pass an argument with a dot, such as xcat.uftp=,
to init as a variable. The Ubuntu xcatroot reads these arguments with
the dracut getarg function, in a subshell, so its other variables keep
their sources.
2026-10-21 11:44:22 -03:00
Vinícius Ferrão a4cef2c4ce feat(uftp): receive the root image over UFTP on SLES stateless nodes
genimage gives the stateless initial ramdisk of a SLES or openSUSE Leap
image with dracut 033 or later the same UFTP receiver as an EL image. It
adds the helper and uftpd when the image has the UFTP 5 receiver of
xcat-dep for its architecture, checks the built ramdisk, and marks it
for nodeset. xcatroot receives the first copy of the image over UFTP
when nodeset asks for it, and checks it like an HTTP download.
2026-10-21 11:44:22 -03:00
Vinícius Ferrão 3dcf4bdef7 feat(uftp): receive the root image over UFTP on EL stateless nodes
genimage adds the UFTP fetch helper and uftpd to the stateless initial
ramdisk of an EL image that has the UFTP 5 receiver of xcat-dep for its
architecture. It checks that the built ramdisk holds the receiver files.
It writes a marker with the digest of the published ramdisk, which
nodeset compares before it asks for UFTP. Without a usable receiver,
genimage removes the helper and the marker.

When nodeset passes xcat.uftp=, xcatroot receives the first copy of the
image over UFTP. The helper asks the listener for the archive that the
checksum file names, as fetched before the request. xcatroot checks the
received file against the checksum file like an HTTP download. A
mismatch or a failed transfer is followed by the HTTP download loop.
UFTP is used only together with rootimgchecksum=yes.
2026-10-21 11:44:21 -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 10c2bd5d9b fix(xcat-core): the aarch64 postinstall SELinux substitution doubles the key
compute.rhels10.aarch64.postinstall arrived after the other netboot
postinstall scripts were anchored, and it carries the old pattern:
s/SELINUX=enforcing\|permissive/SELINUX=disabled/. The alternation binds
to the whole pattern, so the right branch is the bare word permissive.

On a permissive image the substitution writes SELINUX=SELINUX=disabled,
which no SELinux reads, and it rewrites the comment line that names
permissive. On a disabled image it still rewrites that comment.

Anchor the pattern to the SELINUX= line, as the other scripts do.
postinstall_selinux_config.bats fails three of its six checks against
this script before the change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-21 10:44:04 -03:00
Daniel Hilst e7b24beba7 fix(xcat-core): the netboot postinstall SELinux substitution doubles the key
The substitution had two unanchored alternatives, SELINUX=enforcing and the bare word
permissive. An image whose /etc/selinux/config reads SELINUX=permissive therefore gets
SELINUX=SELINUX=disabled, which the policy loader rejects, so the image boots with
SELinux enabled. The bare alternative also matches the comment that lists the three
values, so every image gets a rewritten comment line.

The substitution is now anchored on the whole assignment, the form xcatconfig already
uses. Thirteen scripts carry it, and eleven more postinstall paths are symlinks into
those files.

The postinstall scripts source no shared library, so each copy is edited in place.
Symlinks are how this tree already shares a postinstall between distributions.

The xcat_inventory fixture test1.postinstall is changed as well. cases.environment
names it as the postinstall attribute of an osimage, so genimage runs it on a real
diskless image.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-21 10:35:58 -03:00
Daniel Hilst 4ee82d40d8 fix(xcat-core): a stateless node is told to run SELinux and cannot boot
netboot_supported() answered 1 for rhels8 and later and for every
openEuler, so mknetboot wrote no selinux= argument and a stateless node
was asked to run SELinux enforcing. It does not boot.

A stateless root is a cpio archive unpacked into tmpfs, and cpio carries
no SELinux label, so the root starts unlabelled. Three boots of an
AlmaLinux 10.1 image on an enforcing node measured both ways out of
that, on cluster xcat163:

- With the stock dracut selinux module, which this branch added to the
  module list, the policy loads at pre-pivot 50 over the unlabelled
  initramfs. 61 Permission denied lines follow, setfiles returns 126 and
  the node loops. That module ships with check() returning 255, so no
  image enables it by accident.
- Without it, and with the relabel hook corrected, setfiles labels the
  root: /usr/lib/systemd/systemd reads init_exec_t. systemd then loads
  the policy after switch_root, cannot relabel /dev or /run, and stops
  with "Failed to allocate manager object. Freezing execution".

The hook could not have worked as written either. It read the mode with
sed piped into tail, and the initramfs has neither tail nor chroot:
chroot arrived with the selinux module. The console reported "tail:
command not found" twice and relabelled nothing.

So netboot_supported() answers 0, mknetboot writes selinux=0 for every
stateless node and nodeset says why. The code that only serves a
stateless node with SELinux on is removed with it: the relabel hook and
its two installers, the selinux dracut module, write_image_config, and
the squashfs label machinery that stored labels nothing reads. The
netboot postinstalls and the stateless xcatroot write SELINUX=disabled
again, so the image says what the kernel command line does.

What stays is what was measured working: a diskful node provisioned
enforcing with zero xCAT denials, the kickstart templates, the policy
package, and the service node mount options.

Tests: selinux_netboot_kcmdline.t fails 34 of its 69 checks on the
parent commit. selinux_cn_diskless_disabled_by_design in cases1
provisions a stateless node asked for enforcing and requires selinux=0
on its command line and getenforce Disabled. selinux_image_config.t and
selinux_squashfs_labels.t go with the subs they tested.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-21 10:35:22 -03:00
Daniel Hilst fabfaedc89 feat(xcat-core): provision compute and service nodes with SELinux enabled
Every compute and service node was provisioned with SELinux disabled.
mknetboot added selinux=0, the kickstart templates said selinux
--disable, and the genimage postinstall and the dracut hooks wrote
SELINUX=disabled into the image. noderes.selinux and site.selinux had no
consumer on the node side.

The mode that xCAT::SELinux->node_modes resolves now reaches the node:

- Kernel command line: mknetboot appends kcmdline_selinux(): selinux=0
  for disabled, enforcing=0 for permissive, nothing for enforcing. An
  image built without the relabel hook (EL7 and older), and a squashfs
  image without labels, boot with selinux=0 and nodeset says why.
  Test: selinux_netboot_kcmdline.t.
- Kickstart: #SELINUXMODE# and #SELINUXRELABEL# in xCAT::Template. The
  rh el8/9/10, riscv64 and openEuler templates use them; the %post ends
  with restorecon -RF over the paths the xCAT scripts write. mkinstall
  warns when a template cannot express the mode of the node.
  Test: selinux_kickstart_template.t.
- genimage: the el8-10 postinstalls no longer write SELINUX=disabled, and
  the stateless xcatroot no longer writes /etc/sysconfig/selinux. genimage
  sets SELINUX=enforcing in the image, adds dracut 98selinux, and installs
  a pre-pivot hook that runs setfiles with the image file_contexts unless
  selinux=0 is set. Tests: selinux_image_config.t, selinux_relabel_hook.bats.
- packimage -m squashfs stores the labels of the image policy through
  mksquashfs pseudo xattr definitions (squashfs-tools 4.6 or later), and
  writes rootimg.sfs.selinux beside the image. Test:
  selinux_squashfs_labels.t.
- Service nodes mount /install and /tftpboot from the management node with
  context=public_content_t and tftpdir_t when SELinux is on.
  Test: selinux_sn_mount_options.t.
- makedns no longer warns about SELinux. xcatprobe xcatmn checks the xcat
  module and the labels of installdir and tftpdir instead of failing on
  enforcing. Test: probe_utils_selinux_policy.t.

The selinux/cases1 xcattest cases provision a diskful, a stateless and a
squashfs node enforcing, and a stateless node with site.selinux=disabled.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-21 10:33:16 -03:00
Vinícius Ferrão 0d1e044ea9 refactor(ubuntu): share identical release and architecture package lists 2026-10-19 12:17:03 -03:00
Vinícius Ferrão adaff490cf refactor(profiles): share identical EL10 RISC-V assets
Use relative aliases for identical shipped profiles. Keep their public names,
resolved contents and executable modes. Custom copies remain independent.
2026-10-19 11:48:36 -03:00
Vinícius Ferrão 2a5b55da47 refactor(ubuntu): share architecture-specific APT mirror defaults 2026-10-19 11:30:48 -03:00
Vinícius Ferrão 042804fe5e fix(genimage): create the /run mount point before mounting it
mount_chroot bind-mounts the host /run into the image root before the
run directory exists there. On the first build of a new image, mount
fails with "mount point does not exist". genimage does not check the
result, so the packages install without the host /run.

Create the directory first, as mount_chroot already does for /proc,
/sys and /dev. The mount also uses the subroutine argument instead of
the global image path. Both have the same value at every call site.
2026-10-16 18:45:07 -03:00
Vinícius Ferrão f8469e2074 feat(nodeset): tell nodes the root image checksum setting
Nodes could not know whether an image turned the root image checksum on.
An initial ramdisk built before the check booted the image unchecked,
and nothing reported it. An archive packed before the check had no
checksum for a new initial ramdisk to find.

When the image or the site turns the checksum on, nodeset adds
rootimgchecksum=yes to the kernel command line of the node. This applies
to stateless and statelite ramdisk nodes. genimage writes
<initrd>.rootimgcheck next to an initial ramdisk that can check. The
marker holds the SHA-256 checksum of the initial ramdisk, so a replaced
ramdisk does not match it. imgexport and imgimport carry the marker with
the ramdisk.

When the checksum is on, nodeset warns once for each image whose initial
ramdisk has no matching marker. Its nodes may boot the image unchecked.
nodeset judges the initial ramdisk in TFTP after it copies the boot
files, because nodes boot that copy, also with --noupdateinitrd. A copy
that fails is now an error for the node, instead of a boot entry for the
previous boot files.

genimage and nodeset write a checksum for each archive of the image
directory that has none, also when the check is off. Nodes with older
boot entries still check. genimage does it before it copies a new
initial ramdisk to TFTP, and nodeset before it copies the boot files of
a node. Both hold the publication lock while they write. When they
cannot write the checksum, they keep the boot files that nodes use now
and report how to recover. With the check off, nodeset reports it as a
warning instead, and still sets up the node. nodeset marks the boot
files of an image as copied only after this step succeeds. When the
first node of an image fails it, the next node copies them.

The change covers the Red Hat, SUSE and Ubuntu nodeset plugins, which
share one helper in xCAT::SvrUtils.
2026-10-13 15:29:22 -03:00
Vinícius Ferrão b08b4cbd58 feat(netboot): check the root image against its published checksum
xcatroot extracted whatever curl or wget downloaded, so a damaged
download became the root file system of the node.

After the download, xcatroot fetches the .sha256 file next to the image
and compares it with sha256sum. It also fetches that file before each
download. A download passes when it matches a line of either file, so a
download that began before packimage replaced the image still passes.
The check can fail for any reason, such as a missing checksum file or a
missing sha256sum. xcatroot then removes the download, logs the reason,
waits, and downloads the image again. A file that an earlier attempt
left is checked like a new download. xcatroot checks only when the
kernel argument rootimgchecksum=yes asks for it, and logs when it does
not check. An older xCAT server never passes the argument, so a new
initial ramdisk boots from it unchecked, as before.

The change covers the stateless modules of dracut 033, 047 and 105 for
the Red Hat family, dracut 033 for SUSE, and the Ubuntu module. These
modules also download statelite ramdisk images. Their initial ramdisks
now include sha256sum.
2026-10-13 15:29:21 -03:00
Daniel Hilst abf0f2228f Merge pull request #7935 from VersatusHPC/refactor/r26-package-lifecycle
refactor(packaging): share package lifecycle helpers
2026-10-13 10:00:14 -03:00
Daniel Hilst aa05e7026b Merge pull request #7933 from VersatusHPC/refactor/r26-capture-lifecycle
refactor(dhcp): share the packet capture lifecycle
2026-10-12 10:54:00 -03:00
Vinícius Ferrão cd90878516 refactor(init): share target detection and pending-state cleanup
Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-10-11 11:46:10 -03:00
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 a987cfbd10 refactor(postscripts): share the early postinit disable policy
Embed one helper in the legacy and systemd postboot runners. Keep each
caller policy and disable the service before running postscripts.
2026-10-10 02:25:59 -03:00
Daniel Hilst 2840a965a6 Merge pull request #7903 from middelkoopt/tm-aarch64-mn
aarch64: management-node support (EL10 netboot pkglist + spec Requires)
2026-10-08 15:34:50 -03:00
Daniel Hilst 5952dc04a2 Merge pull request #7594 from VersatusHPC/feat/fips-support
feat(fips): support installation on FIPS-enabled systems
2026-10-07 10:34:18 -03:00
Timothy Middelkoop d1faba077c feat(genimage): opt-in package signature checks for EL images
Add the linuximage gpgcheck attribute. When it is set to 1 or yes,
genimage passes --gpgcheck to the shared RPM image builder, which
exports the builder's trusted RPM keys exactly as it does for openEuler
and writes gpgcheck=1 with that gpgkey for the pkgdir, kerneldir and
otherpkgdir repositories. Unset keeps the existing unverified
configuration, openEuler stays always verified, and builders without
the option reject the attribute instead of ignoring it.

Collect the otherpkgs repositories in imgutils so that an otherpkgdir
holding only URLs no longer adds a file:/// repository that fails to
download metadata on EL.

Signed-off-by: Timothy Middelkoop <tmiddelkoop@internet2.edu>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 11:24:33 -05:00
Timothy Middelkoop d95b190461 aarch64: management-node support (EL10 netboot pkglist + spec Requires)
xCAT builds and runs on aarch64, but two pieces were missing for an EL10
aarch64 management node:

- No compute.rhels10.aarch64.{pkglist,exlist,postinstall}, so genimage
  fell back to the generic EL8/9-shaped compute.pkglist (dhclient,
  busybox-anaconda), which does not resolve on EL10 aarch64. Add the rh
  files (same content as the other EL10 architectures) with alma/rocky
  aliases, following the x86_64/ppc64le layout.
- xCAT.spec had Requires blocks for x86, ppc and riscv64 but none for
  aarch64, so an aarch64 install pulled no ipmitool-xcat. Add the block,
  mirroring riscv64: ipmitool-xcat plus ipxe-xcat (an aarch64 management
  node can serve x86 nodes); the x86-only PXE stack stays excluded.

Tests: extend el10_netboot_dhcp_client.t to the aarch64 lists and add
aarch64_packaging.t for the spec block and the netboot file layout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Timothy Middelkoop <tmiddelkoop@internet2.edu>
2026-10-06 10:51:37 -05: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 750ed7e5a5 fix(ssh): skip optional DSA host keys in FIPS mode 2026-10-05 18:14:20 -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 6b84bdbd4e Merge pull request #7894 from VersatusHPC/fix/openeuler-provisioning
fix(xCAT-server): an openEuler node reinstalls for ever instead of booting
2026-10-02 13:05: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 a63233e91f fix(xcat-core): an openEuler node reinstalls for ever instead of booting
reg_linux_diskfull_installation_flat never finishes on openEuler. The install completes, the
postscripts run, and then the node reboots into the installer again and repeats, so the case waited
an hour and the node stayed at status=installing.

post.xcat.ng ends with updateflag.awk, the call its own comment calls the one that must always run
to prevent infinite installation loops. It passed $MASTER, a hostname. The anaconda %post chroot on
openEuler has no /etc/resolv.conf and no management node entry in /etc/hosts, so gawk cannot open
the socket. From the node's own /var/log/xcat/xcat.log:

  awk: /xcatpost/updateflag.awk:15: warning: remote host and port information
       (xcat58-mn, 3002) invalid: Name or service not known
  updateflag.awk: Retrying flag update

It retries ten times, gives up, and the status is never sent. Nothing reports it: the retry message
goes to logger, and a %post chroot runs no rsyslog.

The same script already uses $MASTER_IP for all 36 of its other callbacks, and the kickstart sets it
to the same host: MASTER_IP=192.168.58.1, MASTER=xcat58-mn. All six updateflag calls now use the
address, so none of them depends on a resolver the node does not have.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-30 21:09:35 -03:00
Daniel Hilst 86d33741d7 Merge pull request #7889 from VersatusHPC/fix/service-node-ub
fix(xcat-server): an Ubuntu service node never installs, and never serves its compute node
2026-09-30 20:34:06 -03:00
Daniel Hilst 9efb3fb3c0 fix(xcat-server): an Ubuntu service node installs from a debian-installer preseed
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-29 17:18:04 -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
Vinícius Ferrão 463eca19e5 Merge master into feature/openeuler-lts 2026-09-25 01:41:02 -03:00
Vinícius Ferrão cc2e3e9635 refactor(genimage): share boot publication and repository setup 2026-09-25 01:31:14 -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