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

3535 Commits

Author SHA1 Message Date
Daniel Hilst efb8e81cb3 Merge pull request #7996 from VersatusHPC/fix/xcattest-table-value-class
fix(xcattest): a [Table_*] value stops at its first colon or slash
2026-11-06 16:28:35 -03:00
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 10c30c80ba Merge pull request #7993 from VersatusHPC/fix/getpostscript-client-identity-v2
fix(xcat-core): getpostscript serves no node when the client reverse lookup is empty
2026-10-30 09:57:22 -03:00
Daniel Hilst 1d148d1847 Merge branch 'master' into fix/xcattest-table-value-class
No conflicts. master gained #7990, #7979 and #7977 after the previous merge.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 15:01:18 -03:00
Daniel Hilst 89b9213e4d Merge pull request #7977 from VersatusHPC/fix/boot-node-template
fix(boot): stop unsupported node-template keys from looping
2026-10-29 15:00:28 -03:00
Daniel Hilst 9f4a296310 Merge branch 'master' into fix/xcattest-table-value-class
xCAT-server/lib/xcat/plugins/anaconda.pm conflicted in the module
imports: this branch adds "use xCAT::MediaPerms" and master adds
"use xCAT::SELinux" on the same line. Both imports are kept. The two
modules are used in different subs, and no other hunk conflicted.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 14:45:55 -03:00
Daniel Hilst e3429791c6 fix(xcat-core): getpostscript serves a node's postscripts to a password or token login
With nodeauthentication off and no peer name, getpostscript used
_xcat_authname as the client identity and expanded it with noderange.
becomeuser and tokens set _xcat_authname to an account name, so a user
named after a node group received the postscripts of the first node in
that group.

xcatd now records the CN of the validated client certificate as
_xcat_certname, and only while no becomeuser or token replaced it. It
deletes any _xcat_certname the client sent. getpostscript uses that
name only when it names exactly one node, with no group or range
expansion. _xcat_authname is no longer a candidate.

getpostscript_client_identity.t drives the plugin with these requests.
On the previous head the group and node login checks fail, and
dropping the exact match fails the group and range checks.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-29 14:41:25 -03:00
Vinícius Ferrão a09fd53acd fix(boot): bound recursive node-template replacements 2026-10-26 17:44:52 -03:00
Daniel Hilst ca5587a73b Merge pull request #7976 from VersatusHPC/fix/debian-package-lifecycle
fix(debian): preserve upgrade context and skip chroot service actions
2026-10-26 14:41:46 -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 3dd7c2a590 fix(xcat-core): a node-initiated request is dropped when only its reverse lookup fails
xcatd fills _xcat_clienthost and _xcat_clientfqdn from a reverse lookup of the
client socket, so both are empty when that lookup fails, however good the
client credentials are. A plugin that asks only for the peer host therefore
cannot identify a node whose certificate names it correctly.

xCAT::DiscoveryUtils::request_client_names returns the names a request offers,
most trustworthy first: the peer host, its fully qualified form, then
_xcat_authname, which is the name in the validated client certificate and does
not depend on name resolution. The request's own node attribute is excluded on
purpose -- a client sends it, so it states what the client wants to be rather
than what it proved it is, and postscripts carry the cluster root ssh key.

xCAT-test/unit/getpostscript_client_identity.t drives the routine directly: the
request hash is its only input and a list of names its only output. It fails on
five mutants of the routine, each naming the assertion it breaks -- the
certificate name dropped (2 checks), the empty-name guard dropped (1), the
client-supplied node offered (3), the de-duplication dropped (2), and the
array-ref guard dropped (1).

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-24 11:28:41 -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 169f3d54eb fix(grub2): give aarch64 nodes a boot file name ending in .efi
Some aarch64 UEFI firmware ignores a DHCP boot file name that does not
end in .efi and requests grubaa64.efi from the TFTP root instead. xCAT
names grub2-<node>, so these nodes stop with a TFTP error before grub2
runs.

For an aarch64 node, nodeset now links grub2-<node>.efi to
grub2.aarch64 beside grub2-<node>. Both DHCP backends name the .efi
link once it exists in the node's TFTP directory (noderes.tftpdir, or
the site one). A node set by an older xCAT keeps grub2-<node> until its
next nodeset, so makedhcp after an upgrade does not name a missing
file. With site.sharedtftp off, every server that runs nodeset for the
node creates both links. This relies on service nodes running the same
xCAT version as the management node, which xCAT requires.

The old link stays for DHCP configurations that makedhcp did not
write. The boot and offline states remove both links. Other
architectures keep grub2-<node>.
2026-10-23 02:16:59 -03:00
Vinícius Ferrão bb8bc944dd fix(boot): stop node-template expansion on unsupported keys 2026-10-22 21:09:32 -03:00
Vinícius Ferrão c76f53a826 refactor(boot): centralize node-template expansion 2026-10-22 20:53:11 -03:00
Vinícius Ferrão 103076c852 fix(debian): skip service actions inside proc-mounted chroots 2026-10-22 17:33:44 -03:00
Daniel Hilst 2cd5c70ae7 docs(kvm): the Secure Boot documentation omits the keys and the rpower path
Two statements about this branch are narrower than the code.

Commit 1edcddab8 says a node with a machine type xCAT cannot judge
"failed at mkvm". firmware_machine_error is returned by build_xmldesc,
and makedom calls build_xmldesc for a node whose domain is not yet built,
so the refusal also reaches the rpower boot of that node. The POD of
firmware_machine_error now names both callers.

The Secure Boot section of the ipxe guide did not name
firmware:efi-secureboot at all. It now says what mkvm asks libvirt for,
why both the secure-boot feature and enrolled-keys are asked for, and
what a hypervisor without such a firmware answers.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-22 10:13:01 -03:00
Daniel Hilst 94d2ce2cd5 fix(kvm): a Secure Boot domain can start on a firmware with no enrolled keys
guest_os stated <loader secure='yes'/> alone for a node with
vm.othersettings firmware:efi-secureboot. libvirt reads that element as
the secure-boot feature, and a firmware with secure-boot and an empty key
store boots an unsigned binary. The two x86_64 descriptors of an EL 10
host name the same OVMF_CODE.secboot.fd and differ in the nvram template,
OVMF_VARS.secboot.fd against OVMF_VARS.fd, so only descriptor priority
picked the one that holds keys. Commit 772b2c656 of this branch says that
element selects the descriptor with enrolled keys. It does not.

firmware_features names secure-boot and enrolled-keys for a Secure Boot
guest, and add_firmware_features writes them into the <os> of the domain.
guest_os cannot carry the element: the firmware attribute of <os> and the
<firmware> child of <os> are one key of one hash for XMLout, and the
attribute is the one that starts the selection. firmware:efi asks for no
feature and is unchanged.

Measured with libvirt 11.10.0 on an x86_64 host, with the enrolled
descriptor masked for one connection: the old XML starts on OVMF_VARS.fd
with enrolled-keys resolved to no, and the new XML is refused with
"Unable to find 'efi' firmware that is compatible with the current
configuration". virt-xml-validate accepts the new XML.

kvm_secureboot_firmware.t covers the features and the element. Two
mutations turn it red: dropping enrolled-keys from firmware_features, and
making add_firmware_features return its argument.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-22 10:11:49 -03:00
Daniel Hilst 1edcddab89 fix(kvm): the firmware guard refuses a machine type xCAT cannot judge
firmware_machine_error refused every machine type that did not contain
q35, so a node with firmware:efi and a machine type xCAT does not know
failed at mkvm. xCAT does not know which machine types a hypervisor
offers, and reg_linux_diskless_installation_flat relies on mkvm accepting
machine:invalid so that it can measure the provisioning failure that
follows. That case failed at the mkvm before it reached the measurement.

The guard now names the i440fx family alone: pc, pc-i440fx-* and
i440fx-*, whose descriptors carry no UEFI firmware. Any other value goes
to libvirt, which reports a machine type it cannot use.

kvm_secureboot_firmware.t covers both halves, and a mutation that
restores the q35 test turns the invalid-machine check red.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-21 19:36:46 -03:00
Daniel Hilst 242cff9c1c fix(kvm): a machine type of vm.othersettings takes a UEFI node to i440fx
guest_arch_profile moves an x86_64 node that asks for efi to q35, because
every x86_64 OVMF descriptor targets pc-q35-* only. guest_os then writes
a machine: setting of vm.othersettings over that machine type, so a node
with firmware:efi and machine:pc reaches libvirt asking for a UEFI
firmware on i440fx. libvirt answers "Unable to find 'efi' firmware that
is compatible with the current configuration" and names neither the node
nor either setting, and rpower boot fails with no way to see why.

firmware_machine_error refuses the pair, and build_xmldesc returns it
before the domain is built. The message names the node, both settings and
the machine type to use. A node that names no machine type, a q35 of any
version, and the machine types of another architecture are all unchanged.

kvm_secureboot_firmware.t covers the refusal and the five values that are
not refused.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-21 19:36:46 -03:00
Daniel Hilst 86f437d475 fix(copycds): the web server cannot read the EFI binaries of the media
A node with netboot=ipxe and Secure Boot on fetches the shim of its
install source over HTTP, and the server answers 403. EL media ships the
EFI binaries of its boot loader mode 0700, copycds copies the media with
the modes the media carries, and xCAT serves the install directory over
HTTP. Measured on an AlmaLinux 10 tree: EFI/BOOT/grub.cfg is 0444 and
answers 200, and BOOTX64.EFI, grubx64.efi and mmx64.efi are 0700 and
answer 403. The node reports "Verification failed: Security Policy
Violation" for its kernel and then "Operation not permitted" for the
shim, and boots nothing.

copycd gave the top directory of the copy mode 0755 and left every path
under it as the media had it. Both copycd plugins now call
xCAT::MediaPerms::make_readable on the copied tree, which adds read
permission for the group and for others, and search permission on a
directory. It adds no write permission, it adds no execute permission to
a file, and it leaves a path that is already group and other readable
alone, so a second call changes nothing.

On the same AlmaLinux 10 tree it walks 5850 paths, 5835 files and 15
directories, and changes 3 of them: the three files above, each from 0700
to 0744. An install tree that is already copied keeps its modes until
copycds runs again for that osimage, so an operator with an existing tree
re-runs copycds or gives those files read permission.

media_perms_readable.t covers the modes and the idempotence. Three
mutations of the module each turn it red.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-21 19:36:46 -03:00
Daniel Hilst 772b2c656c feat(kvm): ask libvirt for UEFI that verifies what it boots
vm.othersettings now takes firmware:efi-secureboot. guest_os puts
<loader secure='yes'/> on the domain beside firmware="efi". libvirt
reads that element while it selects the firmware and keeps only the
descriptors that carry secure-boot, so a hypervisor with no such
firmware refuses the domain instead of starting the node on a firmware
that verifies nothing.

firmware:efi keeps its meaning and states no requirement.

Measured with libvirt 11.10.0 on an x86_64 host: the domain resolves to
OVMF_CODE.secboot.fd with <smm state='on'/>, and the same domain with
secure-boot asked off resolves to OVMF_CODE.fd.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-21 19:36:45 -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
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
Daniel Hilst 9b469b68d5 feat(xcat-core): record the SELinux default at the first install
xcatconfig recorded no SELinux mode at the first install, so an enforcing
management node left site.selinux unset and its nodes were provisioned
with SELinux disabled.

At the first install, xcatconfig now sets site.selinux to enforcing when
the management node is enforcing, and to disabled when it is permissive
or disabled. xCAT::SELinux->install_default makes the decision. An
existing site.selinux value stays, and an upgrade does not set it.
xcatconfig does not change the SELinux mode of the management node.

With the existing value ignored, 12 checks of xcatconfig_selinux_policy.t
fail. With a permissive mode recorded as permissive, 4 checks fail.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-21 10:30:47 -03:00
Daniel Hilst 9923aadb11 feat(xcat-core): resolve the SELinux mode of each node
No code resolved the SELinux mode of a node, so each provisioning path
would have to repeat the precedence and the platform rules.

xCAT::SELinux->node_modes returns the mode for each node. The noderes row
of the node comes first, then the noderes rows of its groups, then
site.selinux, then disabled. A node or group row can enable SELinux when
site.selinux is disabled. A node resolves to disabled when its OS is not
in the Red Hat, Fedora or openEuler families, when its OS is not known,
and when the node or its osimage is statelite. The OS and the provisioning
method come from the osimage row when nodetype.provmethod names one. An
optional hash reference receives the reason for each such clamp.

With the clamp removed, 7 checks of selinux_node_modes.t fail. With the
site value read before noderes, 5 checks fail.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-21 10:30:46 -03:00
Daniel Hilst e0c12830fd feat(xcat-core): add site.selinux and noderes.selinux
xCAT had no attribute that selects the SELinux mode of a node.

site.selinux holds the default mode for the cluster. The values are
enforcing, permissive and disabled, and an unset key means disabled. The
new noderes.selinux column overrides it for a node or a group, and chdef
and lsdef show it as the selinux attribute of node and group objects.
Nothing reads the attributes yet.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-21 10:30:46 -03:00
Daniel Hilst 3a7c1d66a8 Merge master into feat/selinux-netboot
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-21 08:53:16 -03:00
Daniel Hilst 37a25b0fbc Merge master into feat/selinux-netboot
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-19 16:11:59 -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 7bd46bd882 feat(netboot): add the rootimgtransport attribute
UFTP multicast distribution of the root image needs a switch for each
image and a default for the cluster, as the root image checksum has.
site.rootimgtransport sets the default, which is http when it is unset.
The rootimgtransport attribute of an osimage overrides it.
rootimg_transport returns http or uftp, and refuses any other value with
the name of the attribute that holds it.
2026-10-17 13:07:27 -03:00
Daniel Hilst 43dee182ef Merge pull request #7909 from VersatusHPC/feat/secureboot-ipxe
fix(ipxe): a node with Secure Boot on cannot load the kernel
2026-10-16 20:44:36 -03:00
Daniel Hilst cf170b36c4 Merge pull request #7942 from VersatusHPC/feat/rootimg-sha256
feat(netboot): check the root image against its SHA-256 checksum
2026-10-16 18:18:10 -03:00
Daniel Hilst fb9541ffde Merge pull request #7949 from VersatusHPC/fix/table-commands
fix(table): refuse extra tabrestore fields and unknown chtab -d tables
2026-10-16 18:17:31 -03:00
Daniel Hilst 72e3dd8602 refactor(kvm): move the UEFI firmware decisions into xCAT::KVMUtils
kvm.pm made $parser, $node, $confdata and $updatetable package
variables so that kvm_uefi_firmware.t could set them and call
build_xmldesc and reconfigvm. That exposes plugin state to make it
testable, which xCAT::KVMUtils replaced for the other guest decisions.

xCAT::KVMUtils now holds vm_othersettings, requested_firmware,
firmware_error, guest_os, clock_offset and reconfigure_domain. Each one
takes its inputs as arguments. guest_os replaces build_oshash and the
<os> edits in build_xmldesc. reconfigure_domain replaces the XML
rewrite in reconfigvm and loads XML::LibXML when it is called. kvm.pm
calls these subs, and the four variables are file lexicals again.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-16 11:38:33 -03:00
Daniel Hilst 756b1807a1 Merge master into feat/secureboot-ipxe
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-16 11:08:04 -03:00
Daniel Hilst 9329aea4c2 Merge master into feat/secureboot-ipxe
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-16 11:03:31 -03:00
Daniel Hilst b17d37380a Merge pull request #7912 from VersatusHPC/fix/kvm-aarch64-guest-arch
fix(kvm): mkvm builds an aarch64 node as an x86_64 domain
2026-10-16 11:03:20 -03:00
Daniel Hilst e6ba4e4be1 fix(xcat-core): an xCAT installation turns off the SELinux policy of the node
xcatconfig set the running system permissive and wrote SELINUX=disabled into
/etc/selinux/config on a Red Hat or openEuler management node. The node lost
the SELinux policy of the site during the installation, and the log reported
only a warning. Every CI cell that declares SELINUX=enforcing ran its test
cases permissive for this reason, and two measurements needed setenforce 1
after the install to get an enforcing node.

xCAT::SELinux->xcatconfig_action now returns the mode and asks for no change.
xcatconfig reports the mode and leaves the running system and
/etc/selinux/config alone. A node that already has SELinux off gets no
warning, as before.

xCAT-test/unit/xcatconfig_selinux_policy.t fails 10 of its 27 checks on the
parent commit.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-14 16:45:20 -03:00
Daniel Hilst 5b138f24a6 refactor(xcat-core): move the xcatconfig SELinux decision into a module
xcatconfig held the SELinux decision inline and read the state with
xCAT::Utils->isSELINUX, so no unit test can reach it. The script has no sub
API.

xCAT::SELinux now reports the runtime mode and the mode that
/etc/selinux/config selects, and xcatconfig_action returns what xcatconfig
must do about it. xcatconfig applies that answer. The behavior does not
change: a node with SELinux enabled still gets the permissive write and the
/etc/selinux/config rewrite.

runtime_mode reads the selinuxfs enforce file instead of running
selinuxenabled. Both report SELinux as enabled when selinuxfs is mounted.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-14 16:45:20 -03:00
Vinícius Ferrão 3856dbeee8 refactor(boot): remove the private Genesis selector name 2026-10-14 13:30:00 -03:00
Vinícius Ferrão 3b50ed9036 refactor(boot): expose the Genesis file selector 2026-10-14 13:30:00 -03:00
Vinícius Ferrão 937f6895f0 refactor(http): share port suffix formatting across boot callers 2026-10-14 13:29:22 -03:00
Vinícius Ferrão 6713d01af3 refactor(boot): share Genesis artifact selection 2026-10-14 13:29:22 -03:00
Vinícius Ferrão 06a3f486c7 fix(chtab): report a table that chtab -d cannot open
chtab -d called delEntries on each table that it named without a check
that the table opened. A table name that xCAT does not know made chtab
die after it had deleted the rows of the tables named before it. The
error was "Can't call method delEntries on an undefined value".

The delete moves to xCAT::TableUtils->delete_rows, which opens every
named table first. When a table does not open, it deletes no row and
returns the table name. chtab -d reports that table with the error of
the update form.
2026-10-14 13:14:42 -03:00
Daniel Hilst 25a3c8e55d Merge pull request #7947 from VersatusHPC/fix/table-setattribswhere-cache
fix(table): refresh the cache after a conditional update or rollback
2026-10-14 11:53:16 -03:00
Daniel Hilst 7594786fcf fix(kvm): an aarch64 guest gets vga when the hypervisor offers no usable model
preferred_video_model returned vga whenever no preferred model was
found, also when the hypervisor did not offer vga, did not support video,
or the capability query failed. Under native aarch64 KVM, vga and the
other PCI framebuffer models do not display correctly.

An aarch64 guest now takes the first offered model of virtio and ramfb
under KVM, or of virtio, vga and ramfb under TCG. When video is
unsupported or no wanted model is offered, build_xmldesc writes no
<video> and no <graphics>, and the guest uses its serial console. When
the capabilities are unavailable, build_xmldesc returns an error that
names the query error and vm.vidmodel.

vm.vidmodel still overrides the choice. Other architectures do not
query the capabilities and keep their fixed model.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-14 05:40:19 -03:00
Vinícius Ferrão 2b6fd9cd99 fix(table): refresh the cache after a rollback
rollback did not mark the caches of the rolled-back tables as stale. A
cached read after a write and before the rollback kept the rejected
value. Cached readers then got it for up to 5 seconds after the
rollback. MySQL and PostgreSQL share one handle among tables, so a
rollback through one table also undoes the changes of the others.

rollback now refreshes the cache of every table on its handle.
2026-10-14 00:36:57 -03:00