The UUID conversion of mkvm, clonevm, rinv and rscan used the machine
type that the domain XML names. A domain that names none, or names an
alias such as pc, gets the default machine type of the hypervisor:
pc-i440fx-2.1 on QEMU 2.1 and pc-i440fx-rhel7.1.0 on the qemu-kvm of
RHEL 7.1. Its guest then reported a swapped UUID that the plugin did
not expect.
The plugin now asks libvirt for the machine type through the domain
capabilities of the hypervisor, as it already does for the video
model, and converts the UUID for that machine type. The domain XML
keeps the machine type it names. When libvirt cannot answer, the
plugin uses the machine type of the XML, as before.
(cherry picked from commit f3b47fcca98ca75c123615433df38d3642d2c5d4)
A guest that an earlier rscan defined has duid=canonical. rscan -u and
rscan -w update its MAC address and keep mac.duid, and the DHCPv6
identifier selection for the node still gives the canonical DUID.
Before the fix both commands removed mac.duid and the selection fell
back to the firmware order.
The guest is defined before the first command, because this process
keeps the node list it reads first and the forked plugin inherits it.
(cherry picked from commit 36b997376d05cb0b74bec279766e2793e026f59b)
rscan -u, and rscan -w for a guest that xCAT already knows, deleted the
mac row of the guest and wrote back only its MAC address. That dropped
mac.duid, so the next makedhcp reserved the default DUID in place of
the identifier the node had selected, and its client lost the reserved
address. rscan now updates the MAC address in the existing row and
keeps the other mac attributes. The other tables it rewrites are
unchanged.
(cherry picked from commit b464b57499d74d525188c59a340c1bde8e3ffcf1)
The plugin runs through process_request with a private SQLite database
and a stub libvirt connection. mkvm gives the domain XML vpd.uuid, and
a UUID that it generates, unchanged; rinv prints the domain UUID; and
rscan -w stores it in vpd.uuid. For a guest on machine type
pc-i440fx-2.1 or pc-i440fx-rhel7.1.0 they swap the first three fields
instead, and guest_uuid swaps only for those two machine types. Against
the old plugin the unchanged cases fail with the fields swapped, and
against a plugin that ignores the machine type the swapped cases fail
unswapped.
(cherry picked from commit 8db182e8c6fdf184ceeccc87ff5e5569070cc26a)
mkvm and clonevm wrote the libvirt domain UUID with the first three
fields of vpd.uuid swapped, rscan swapped them back when it stored a
domain UUID in vpd.uuid, and rinv printed the swapped value. QEMU
stores the domain UUID as SMBIOS 2.6 specifies, so the guest reported
the swapped UUID, not vpd.uuid, and its UEFI firmware sent a DUID that
the reservation makedhcp derives from vpd.uuid did not match.
The plugin now converts through xCAT::KVMUtils::guest_uuid, which
keeps the UUID unchanged for every machine type except pc-i440fx-2.1
and its RHEL counterpart pc-i440fx-rhel7.1.0. Those machine types,
which QEMU before 9.1 and the qemu-kvm of EL8 still offer, store the
UUID bytes unencoded behind an SMBIOS 2.8 entry point, so their guest
reports the first three fields swapped and the swap stays. mkvm and
clonevm take the machine type of the domain they build, and rscan and
rinv the machine type of the domain they read.
A guest that mkvm defined before keeps its UUID, because mkvm reuses
the domain XML in kvm_nodedata. Its vpd.uuid keeps the swapped order
until it is corrected.
(cherry picked from commit 4d8007091c9a8ba2e246749a7278c0f5e04da374)
dodiscovery runs in a private namespace with a fixed product_uuid and
stubbed hardware and transport commands. The test reads the UUID from
the discovery request that the script sends and expects product_uuid
unchanged. Before the fix the request held the UUID with its first
three fields swapped.
(cherry picked from commit 21762f21526e0ba71fb3b9a6d3ec314e59feb101)
Genesis discovery swapped the first three fields of product_uuid before
it sent the UUID. When that was written, the kernel printed the SMBIOS
bytes in their stored order, and the swap gave the UUID that dmidecode
prints. Since Linux 3.8 product_uuid is that UUID already, so the swap
stores vpd.uuid in SMBIOS byte order. makedhcp then reverses it again,
and the DHCPv6 reservation does not match the DUID that UEFI firmware
sends.
Discovery now reports product_uuid as it is, as the OpenEmbedded
Genesis does. doxcat keeps the swap in the DUID that it writes for
dhclient, because the swap gives the DUID that the firmware sends.
Windows provisioning links the node file under both UUID orders and
does not change.
(cherry picked from commit 1a6cd4259ca8b71fc12aa03e61b88b60705d7889)
The plugin builds the DHCPv6 reservations from a private xCAT database,
and kea-dhcp6 and dhcpd -6 serve them in a network namespace. DHCPv6
clients in a second namespace send the DUID that UEFI firmware sends,
the RFC 4122 order and a given DUID, and check the address and the
bootfile-url that each one gets.
Without mac.duid only the firmware order gets the reservation. With
duid=canonical the operating system gets the reserved address and the
firmware leases a pool address, so the two never hold the same address.
When mac.duid changes, Kea revokes the lease of the old DUID and dhcpd
gives the fixed address to the new DUID at once. An invalid value keeps
the existing reservation, and makedhcp -d removes the selected one only.
An IPv4-only node with the vpd.uuid of another node leaves the
reservation of that node alone.
The makedhcp autotest case checks duid=canonical and an invalid value
through chdef and makedhcp, and no longer says that RFC 6355 requires
the firmware order.
(cherry picked from commit 740d1b846c0c13342f9f1ec2e24f570354e885d4)
The ISC host commands from makedhcp and the Kea reservations get the
same DUID for each value of mac.duid: firmware or no value, canonical, a
DUID in uppercase, an invalid value and a node without a usable
vpd.uuid. An invalid value is reported, and the node gets no DHCPv6
reservation in either backend.
A change of mac.duid replaces the reservation of the node and keeps its
address and bootfile-url. Query and delete match only the selected DUID,
so the other byte order of the same UUID stays with the node that holds
it. When a node is given the DUID of another node, both backends give
the reservation to the node that makedhcp updates, and makedhcp -d of
that node removes it, as they do for a MAC that two nodes share. An IPv6
node keeps its reservation when an IPv4-only node has the same vpd.uuid.
The DHCPv4 hosts and reservations, IPoIB included, do not change with
mac.duid, and IPv4-only nodes with an invalid DUID get no error from
either backend. Single-node requests in a cluster of a thousand nodes
read the rows of the requested nodes only.
(cherry picked from commit 9e5e5d90fe98891fda1e4e5ef8adec16a09a7f7f)
makedhcp built every DHCPv6 reservation from vpd.uuid in the byte order
that EDK2 firmware sends, for ISC DHCP and Kea alike. A client that
encodes the UUID in RFC 4122 network byte order, as RFC 6355 refers to
it, sends a different DUID and never matches its reservation.
The new duid attribute (mac.duid) selects the identifier. firmware, the
default, keeps the EDK2 order: SMBIOS 2.6 and later store the first
three UUID fields little-endian, and EDK2 copies those bytes. canonical
uses vpd.uuid in RFC 4122 order. Any other value is the DUID itself.
makedhcp reports an invalid value as an error and does not change the
DHCPv6 reservation of that node.
Like a MAC address, a DUID identifies one client, and makedhcp treats
the database as authoritative for it as it does for MACs: the node that
makedhcp updates takes a reservation that another node held under the
same DUID, in both backends. A node without an IPv6 address needs no
DHCPv6 reservation, so an invalid duid there is a warning and does not
fail the request.
ISC DHCP, the Kea reservations and the Kea query and delete matches
take the DUID from one function, so the backends cannot disagree. A
reservation still matches one DUID. makedhcp does not reserve both
orders: Kea rejects two reservations of one address in a subnet, and
the second replaces the first in the xCAT update.
(cherry picked from commit d3360f32ce5f920d945cb6f902badf4a2a0a108b)
addnode6 printed its omshell commands to a file-scope handle, so no test
could read the DHCPv6 host that ISC DHCP is told to create. It now
returns the commands, and makedhcp prints them to the same omshell
session. The commands and their order do not change.
(cherry picked from commit 178de13a677ffe9326ed9cc697a063de39337e42)
The DUID-UUID assertions called kea_duid_from_uuid directly, so they
pinned the helper and not the reservation that a client must match.
They now build the DHCPv6 reservations and the query and delete matches
for the same uuid values, and expect the same DUIDs.
The comment no longer says that RFC 6355 requires the firmware byte
order. RFC 6355 refers to RFC 4122, which encodes a UUID in network byte
order. The firmware order comes from EDK2, which copies the SMBIOS bytes.
(cherry picked from commit 1acf6b9e89791ceabb4e75f29b2d0aafa4886868)
The OpenEmbedded discovery sends the product_uuid fixture and expects it
unchanged in the findme request.
(cherry picked from commit 092d78a224ee57af834a74ccfb63185f7120a2b7)
This reverts 6382f7baae and 9e234189ef, except genesis_duid_uuid.bats.
That test checks the DUID that doxcat sends, which does not change.
The two commits made vpd.uuid hold the UUID with its first three fields
in SMBIOS byte order. makedhcp copied the column into the DUID-UUID, and
the OpenEmbedded genesis-discover swapped product_uuid to match the
legacy dodiscovery. vpd.uuid then differs from the UUID that the
operating system and dmidecode report for the node.
The next commits keep vpd.uuid as the UUID that the operating system
reports. makedhcp builds from it the DUID that EDK2 firmware sends,
mac.duid selects another DUID, and the legacy dodiscovery and kvm.pm
stop swapping the UUID.
(cherry picked from commit b3cf807045192114d1b81a2e7b6211e90a56d343)
makedhcp reversed the first three fields of vpd.uuid to build the DUID-UUID,
and the OpenEmbedded Genesis image reported product_uuid in the opposite order
to the legacy image. Kea matched neither reservation, so an IPv6 node took a
pool address with no bootfile-url.
vpd.uuid holds the sixteen octets in the order the client sends them. kvm.pm
swaps the first three SMBIOS fields to build the libvirt <uuid>, dodiscovery
and doxcat swap product_uuid before they report or send it, and both DHCP
backends on master use the column as the DUID payload unchanged. On xcat76-cn
the firmware sent 00:04 followed by that column verbatim.
kea_duid_from_uuid now colonises vpd.uuid and prefixes 00:04, and
genesis-discover reports the DMI uuid in the same order as its legacy sibling.
The s390x and device-tree paths read their uuid elsewhere and are untouched.
Five assertions in dhcp_kea_plugin_intent.t and the genesis-discover assertion
in genesis_openembedded_discovery.bats fail without this change.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
A node discovered by the OpenEmbedded Genesis image gets a vpd.uuid that
differs from the one the legacy image reports for the same machine, and
makedhcp reverses the first three fields of whichever value it finds. The
reservation then carries a DUID no client presents, Kea does not match it,
and the node takes a pool address with no bootfile-url.
vpd.uuid holds the sixteen octets in the order a client sends them. dodiscovery
swaps the first three SMBIOS fields before it reports them, kvm.pm swaps them
back to build the libvirt <uuid>, and both DHCP backends on master use the
column as the DUID payload unchanged. The OpenEmbedded genesis-discover reports
product_uuid as sysfs renders it, which is the canonical order.
These assertions state the one order. genesis_duid_uuid.bats measures the DUID
the legacy image sends for a known product_uuid, and is the reference the other
two are read against; it passes before and after. The reservation and
genesis-discover assertions fail on this tree.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Some aarch64 UEFI firmware ignores a boot file name without the .efi
suffix and requests grubaa64.efi instead. xcat-core/#7980 made
xCAT::DHCP::BootPolicy->grub2_node_loader the one place that name is
chosen, and the ISC and DHCPv4 paths of makedhcp call it.
kea_bootfile_url6_for_node in dhcp.pm builds the name itself, as
"grub2-$node", so the RFC 5970 bootfile-url of an aarch64 node never
carries the suffix and the node loads nothing. The routine also had no
node architecture to decide on: kea_build_node_reservations6 does not
read the nodetype table.
kea_build_node_reservations6 now reads nodetype.arch and noderes.tftpdir,
kea_node_reservations6 passes the nodetype entry on, and
kea_bootfile_url6_for_node asks grub2_node_loader for the name.
dhcp_grub2_node_loader.t, which holds the name down for the other two
paths, now asserts the DHCPv6 URL over its whole case table. Without this
change 2 of its 62 assertions fail: the two aarch64 cases where nodeset
has published the .efi link.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Master gained d9936e4a6, which moves the validation of the node
architecture, of the grub2 binary and of the node address in
xCAT_plugin::grub2::setstate above the find/rm that replaces the
configuration, and declares $serverip and $grub2protocol before that
validation block. This branch rewrites the same region to resolve the
boot server in either address family.
Resolution. The helper call grub2_server_for_node assigns the $serverip
that master now declares in the outer scope. A "my" on that assignment
compiles and passes perl -c, but it leaves the outer $serverip undef and
the configuration gets no "set root=" line; grub2_ipv6.t fails 2 of its
22 assertions on that form. The IPv4/IPv6 split of getipaddr moves to
master's hoisted validation site, so an IPv6-only node passes validation
before the previous configuration is removed.
The IPv6 boot file URL in dhcp.pm builds the loader name itself and so
bypasses grub2_node_loader, which xcat-core/#7980 added as the one place
that name is chosen. An aarch64 node over IPv6 therefore gets a name
without the .efi suffix its firmware requests. The next commit routes
that path through the helper.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
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>
Substring and regular-expression matches can mistake a different boot state
or image name for a completed chain. Compare the full state values while
preserving the completed boot exception.
Rejected protocols, unresolved addresses and missing loaders can leave a
partial configuration after removing the previous files. Check these inputs
before replacing the node configuration and its aliases.
An Ubuntu node that netboots legacy Genesis dies with
Failed to execute /init (error -13)
Kernel panic - not syncing: No working init found.
xCAT-genesis-base/debian/rules is a bare `dh $@`, so dh_fixperms applies its
*.so* rule to the whole package. That is right for a Debian shared library and
wrong for a netboot ROOT FILESYSTEM: the kernel execs the payload's dynamic
loader, and a loader with no execute bit makes open_exec() return EACCES, so
every ELF in the image fails to start. mknb copies the tree verbatim into
genesis.fs.<arch>.lzma, so the mode travels into the image. The pipeline's iPXE
command line carries `quiet`, which hid the reason.
Measured on xcat-master-ub from the installed package:
644 .../netboot/genesis/x86_64/fs/usr/lib64/ld-linux-x86-64.so.2
755 .../netboot/genesis/x86_64/fs/usr/bin/basename
and reproduced away from the lab: that management node's own kernel and image
under qemu panicked at 35 seconds, a repack with no change panicked again, and a
repack with only chmod 0755 on the loader reached /init and started dracut.
The EL rpm is unaffected, because it never runs dh_fixperms. This is why only
the Ubuntu genesis-legacy cell saw it, and why that cell has never had a
non-mock green. It is not a regression: the same recipe builds the published
xcat-genesis-base-amd64.
The bit is restored AFTER dh_fixperms rather than excluding the tree with -X,
which would also skip its chown 0:0 pass and ship the payload owned by the build
user.
genesis_deb_loader_executable.t asserts the override exists, still calls
dh_fixperms, is scoped to the netboot tree, names both the glibc and the ppc64le
loader, and runs the chmod AFTER dh_fixperms. Three of its ten assertions fail
without the override, and the ordering assertion fails if the chmod is moved
first -- which is the mistake that looks correct.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
This branch is titled "provision a node over IPv6" and shipped one IPv6
xcattest case, makenetworks_ipv6_route_filter_unit, which is a unit-style check
that no bundle names. Nothing ran against a management node to show that the
DHCPv6 path works.
makedhcp_dhcpv6_boot_intent builds its own state on the management node -- an
IPv6 address on the provisioning NIC, a matching xCAT network, and a node that
answers only on IPv6 with a fixed vpd.uuid -- and asserts four things a UEFI
client depends on: makedhcp exits 0, kea-dhcp6 accepts the configuration it
wrote, the reservation's DUID is the uuid with its first three fields reversed
as the firmware sends them, and the bootfile-url is the RFC 5970 form with a
bracketed authority. It then asserts the IPv4 configuration carries no
reservation and no client class for that node.
Every value is read out of Kea's JSON with python3 and compared for EQUALITY. A
grep for bootfile-url passes on the key alone, and a check whose pattern appears
in its own command cannot fail.
The uuid is fixed rather than generated, because the expected DUID is derived
from it. The case pre-cleans before it builds: xcattest stops a case at its
first failed check, so the cleanup at the end does not run after a failure, and
without the pre-clean a failed run would leave an address, a network and a node
behind for the next run to measure.
It needs no compute node and no image, so it runs wherever a management node is
installed. ci/bundles/ipv6_dhcpv6.bundle and the el10-x86_64-ipv6 cell in
xcat-core-ci-cd dispatch it.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
A node with an IPv6 reservation took a pool address with no bootfile-url and
stopped at PXE-E21. RFC 6355 carries the sixteen octets of the system UUID as
the firmware holds them, and SMBIOS 2.6 and later store time_low, time_mid and
time_hi_and_version little-endian, while vpd.uuid holds the canonical spelling
Linux reports in product_uuid. kea_duid_from_uuid copied that spelling verbatim,
so the DUID disagreed with the client in its first eight octets and Kea never
matched the reservation.
Measured on xcat76-cn, 2026-10-23, with vpd.uuid
c78c76bf-3286-46f3-b80d-8fe079dd6de7:
xCAT wrote 00:04:c7:8c:76:bf:32:86:46:f3:b8:0d:8f:e0:79:dd:6d:e7
the firmware sent 00:04:bf:76:8c:c7:86:32:f3:46:b8:0d:8f:e0:79:dd:6d:e7
The first three fields are now reversed. The ISC path had its own copy of the
same transformation and the same defect; it calls the sub instead, so the two
backends cannot disagree about what a client's DUID looks like. A uuid that is
not sixteen octets now has no DUID and the node is skipped with a warning,
rather than a malformed string reaching omshell.
Two assertions in dhcp_kea_plugin_intent.t held the canonical spelling and so
agreed with a DUID no firmware presents; they now hold the reversed form. Five
assertions fail without the reversal.
Also: makedhcp exited 1 on an IPv6-only node whose DHCPv6 reservation and
bootfile-url it had just written correctly. kea_node_client_classes_for_nodes
resolved next_server_for_node before the per-MAC loop that skips an IPv6-only
node, so the node still reached the IPv4 resolver, and with noderes.xcatmaster
naming a host that has only an AAAA record inet_aton fails and the sub reports
an unresolvable tftpserver with errorcode 1. 6f171a22b made the same call lazy
in kea_node_reservations and missed this second site. It is resolved on first
use now, and the new assertion is on the CALL rather than the exit code, because
the error is what the exit code is made of.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
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>
Two conflicts, both from xcat-core/#7978 landing on master.
build-utils/lib/XCAT/BuildUtils.pm: both branches added a package_skip_reason,
#7978 with a general @PACKAGE_SKIPS table and this branch with its own
%EL_ONLY_PACKAGES and a second sub. git merges them as separate hunks because
they sit apart in the file, and Perl takes the LAST definition, so keeping both
silently deletes whichever rule came first. There is now one table and one sub.
A rule names either the target prefixes that do NOT build the package, or, with
`only`, the pattern of the targets that DO. The second form is what an EL-only
package needs: naming the families that are not EL means a family added later
tries to build it, which is how openSUSE reached xCAT-selinux and failed
xcat-core-build-opensuse #42 on a missing selinux-policy-devel.
buildrpms.pl: an empty build plan takes upstream's answer, a clean return rather
than this branch's die. That is the decision #7978 exists for -- the dep
pipeline asks for xCAT-genesis-base alone and no openSUSE target builds it -- so
reinstating the die would fail a build that has nothing to do.
selinux_el_only_scope.t is 37 of 37 and opensuse_no_legacy_genesis.t 22 of 22 on
the merged tree, and the whole unit suite passes: 301 files, 9801 tests.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
xcat-core-build-opensuse #42 failed on three packages whose only error was
"No matching package to install: selinux-policy-devel", and took the whole
openSUSE family of xcat-ci #146 down with it. openSUSE Leap ships no
selinux-policy-devel, so the policy module has nothing to compile against.
package_skip_reason in build-utils/lib/XCAT/BuildUtils.pm tested the target
against /\Aopeneuler-/, because openEuler was the one non-EL family buildrpms.pl
targeted when the guard was written. openSUSE was enabled afterwards and matches
no arm of that test, so the EL-only package was selected for it.
The test is now on EL rather than on the families that are not EL, so a family
added later skips an EL-only package instead of trying to build it.
selinux_el_only_scope.t gains the two openSUSE targets. Without this change its
two new assertions fail and the other 35 pass.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Drive the Kea reservation builder and the ISC makedhcp path for grub2
nodes of each architecture. Place the loader links in the site TFTP
directory or in noderes.tftpdir. An aarch64 node with only grub2-<node>
keeps that name. The table stub returns only the requested columns, so
a missing nodetype.arch or noderes.tftpdir read fails the aarch64 cases.
Drive grub2 setstate for the node loader links: both names for an
aarch64 node and one for the others. Cover a repeated nodeset, a node
with only the old link, and removal in the boot, offline and SLES 15
standby states.
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>.
The SELinux page carried the repair in two blocks. The first mapped the
published artifacts and ran restorecon over the image root. The second mapped
the publication directory and excluded both guest trees. An operator with
site.installdir=/srv/xcat-install who reads the page in order therefore
relabels before any mapping covers that tree, and rootimg/etc/shadow resolves to
var_t. The exclusion added afterwards keeps the var_t it finds, because it only
stops the next relabel from changing the label again.
The order also cost the artifacts. file_contexts keeps the expressions in the
order they are read and the last one that matches a path wins, so the exclusions
of the second block beat the artifact mappings of the first. Where the image
root carries a rootimg component in the middle, the exclusion matches the
artifacts as well, and the five expressions with a wildcard, the initrds and the
packed images, resolve <<none>>. kernel and hypervisor carry no wildcard and win
either way, which is why the defect showed on a subset.
The page is now one sequence: the publication directory, both guest exclusions,
the artifact mappings, then one restorecon. It says what each step orders and
why.
xCAT-test/native/selinux_image_repair.t passes 381 of 381 checks on this
sequence and fails 47 on the order of the parent commit. selinux_docs.t fails 3
of 30 on the parent commit.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
selinux_image_repair.t measured a moved publication directory and an image root
with a rootimg component in the middle in separate fixtures, and it called the
mappings of a scenario a repair without running the restorecon the page puts
between them. Neither condition reaches the ordering defect on its own, and the
relabel the procedure runs itself was never measured.
The case now gives each scenario the relabel, so the scenario places it where
the page does. It reads the guest labels straight after the procedure, because a
label the procedure overwrote cannot be recovered by a mapping added afterwards.
It then asserts the mapping and the label of each path after a recursive relabel
and after a reinstall of the module.
A third scenario runs the four documented steps on the layout that needs all of
them: site.installdir is /srv/xcat-images, so no mapping covers the tree until
the procedure adds one, and the image root carries a rootimg component in the
middle, so the guest exclusion matches the published artifacts too.
selinux_docs.t gains three checks on the order of the page: the guest exclusions
come before the artifact mappings, the relabel comes after the last mapping, and
there is one relabel. All three fail against the page at 78f6d65a7.
With the command order of that page, the full sequence fails 47 of 381 checks:
16 guest labels, which go from shadow_t, etc_t and bin_t to var_t, and 15
artifact mappings, which resolve <<none>> for the five expressions that carry a
wildcard.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
xcat-dep-build-opensuse15-x86_64 fails its xCAT-genesis-base step. BuildRequires
resolve, and verify-genesis-payload then reports 566 missing zoneinfo/posix paths,
etc/redhat-release, and 45 EL paths and tool names -- net-tools-deprecated,
kmod-compat, iputils, systemd-sysvinit, timezone, nc, mkdosfs and the lvm symlinks.
The manifest is written for EL, so the package cannot be built on openSUSE.
openSUSE ships no legacy Genesis, so it does not need to be. package_skip_reason names
the pairs a target does not build and why, buildrpms.pl prints each skipped pair, and a
plan that skips everything returns 0 rather than failing: the dep pipeline asks for
xCAT-genesis-base alone, so on openSUSE its whole plan is empty and an empty plan is
the plan.
Dropping the package alone would make xCAT unresolvable there.
xCAT-genesis-scripts.spec requires xCAT-genesis-base-%{tarch} unconditionally and xCAT
requires xCAT-genesis-scripts, so zypper install xCAT would fail on a missing package
-- later than the build and looking like something else. That Requires now stands
behind %if ! 0%{?suse_version}; the Leap chroot's /usr/lib/rpm/suse/macros sets
%suse_version 1500, and no EL or openEuler target defines it.
xCAT-test/unit/opensuse_no_legacy_genesis.t covers the skip, the empty plan and the
conditional Requires.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Nothing holds the openSUSE Genesis scope down. xCAT-genesis-base is built for
every target the dep pipeline names, and xCAT-genesis-scripts requires the
payload on every family.
The test reads the build-plan decision and the payload requirement in the spec.
It fails on this commit: the build plan keeps xCAT-genesis-base for openSUSE,
and the requirement carries no condition.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The SELinux page told the operator to run chcon -R -t public_content_t over the
image root to repair a published artifact that kept an older type. That command
walks into rootimg and rootimg-statelite, so it replaces the labels of the guest
operating system with public_content_t. The xcat.fc comment carried the same
advice. chcon also writes a type that no mapping selects, so the next relabel of
a path that has a mapping reverts it: the repair held only until then.
The page now maps each published artifact with semanage fcontext and applies the
mapping with restorecon. Each expression names one regular file directly below
the image root, so no path in either guest tree matches one, and both trees keep
the <<none>> of the packaged mappings. The procedure reads the publication
directory from site.installdir, and a site that moved it maps the configured
directory and keeps both guest trees out of that mapping. The page says why a
tree mapping over the image root is the same defect as the chcon.
xCAT-test/native/selinux_image_repair.t passes 170 of 170 checks with the
documented procedure. With the chcon of the previous page it fails 101, 36 of
them guest labels. selinux_docs.t fails 7 of 26 on the parent commit.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The SELinux page documents a recursive chcon to repair a published artifact
that carries the wrong type. No case runs that procedure, so nothing measures
what it does to the guest trees of the image root, and nothing measures whether
the repair survives a later relabel.
selinux_image_repair.t starts with default_t on every published artifact of an
image root and with valid types in both rootimg and rootimg-statelite. It runs
the repair, then reads the labels back after a recursive relabel and after a
reinstall of the module. It covers the standard publication directory and one
that site.installdir moved, because the packaged mappings name /install.
semanage writes to the policy store of the host, so the case refuses to run
where SELinux is enabled and removes every mapping it adds. restorecon is a
no-op where SELinux is disabled, so the case applies the mappings with setfiles
and asserts that the merged file_contexts answers what the store answers for
each path.
selinux_docs.t gains the checks that keep the page and the xcat.fc comment from
describing a chcon repair. 7 of its 26 checks fail on this commit.
With the chcon of the page in place of the documented procedure,
selinux_image_repair.t fails 101 of its 170 checks, 36 of them guest labels that
the recursive chcon overwrote.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>