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

29384 Commits

Author SHA1 Message Date
Daniel Hilst 17c56cdc56 Merge pull request #7985 from VersatusHPC/fix/opensuse-core-pod-man-buildrequires
fix(xcat-core): the openSUSE core build has no Pod::Man, so pod conversion fails
2026-11-07 07:38:00 -03:00
Daniel Hilst be809100d4 Merge pull request #8012 from VersatusHPC/fix/ipmi-sdr-record-count
fix(ipmi): read the SDR record count as one 16-bit value
2026-11-07 07:37:39 -03:00
Daniel Hilst 502c0f15df Merge pull request #8014 from VersatusHPC/fix/kickstart-selinux-relabel
fix(install): run the SELinux relabel after the EL post scripts
2026-11-07 07:34:41 -03:00
Daniel Hilst a89fe164c2 Merge branch 'master' into fix/kickstart-selinux-relabel 2026-11-07 06:44:02 -03:00
Daniel Hilst 64f9bc1d20 Merge pull request #8015 from VersatusHPC/fix/kickstart-bmc-usb-nic
fix(install): leave the USB NIC of the BMC down on installed EL nodes
2026-11-07 06:33:47 -03:00
Vinícius Ferrão c3c466c9a0 test(install): leave the USB NIC of the BMC down on installed EL nodes
The rendered post.rhels8, run in a sandbox with a fixture sysfs, must turn
on the PCI NICs with link, a USB Ethernet adapter with its own driver,
and a NIC with no sysfs entry, and leave a cdc_ether NIC with link down.
When only the cdc_ether NIC has link, it must fall back to the
connections active in the installer.
2026-11-07 00:59:02 -03:00
Vinícius Ferrão 63bd36cfd4 fix(install): leave the USB NIC of the BMC down on installed EL nodes
post.rhels8 turns on every NIC that has link during the installation.
The USB NIC of a BMC host interface always has link, so the installed
node starts DHCP on it at boot, gets no lease, and
NetworkManager-wait-online fails.

post.rhels8 now skips NICs bound to a USB class driver: cdc_ether,
cdc_ncm, cdc_eem or rndis_host, which Linux binds to the USB gadget of a
BMC. USB Ethernet adapters with their own driver, the other NICs with
link, and NICs without a sysfs entry come up as before.
2026-11-07 00:59:01 -03:00
Daniel Hilst a695723541 Merge pull request #8006 from VersatusHPC/fix/el-kickstart-pre-log
fix(install): copy the kickstart pre-install log from the installer
2026-11-07 00:54:01 -03:00
Daniel Hilst 03b0439bb8 Merge pull request #8016 from VersatusHPC/fix/netboot-nm-lease-handoff
fix(netboot): hand the NetworkManager lease of the initrd to diskless roots
2026-11-07 00:46:35 -03:00
Vinícius Ferrão 568db90972 test(install): cover the kickstart pre-install log handoff
Run the rendered %post --nochroot blocks of each kickstart template
whose %pre writes /tmp/pre-install.log the way anaconda runs them: in
the installer, with its own /tmp and the installed system at
/mnt/sysimage. Each run must append the log to a new or an existing
xcat.log. The riscv64 profile test now keeps the installer's /tmp out
of the installed root too. Both fail on the old templates, whose chroot
%post reads a /tmp that does not hold the log.

Run the new test in the profile artifact job.
2026-11-06 23:10:32 -03:00
Vinícius Ferrão b45dc1e85f fix(install): copy the kickstart pre-install log from the installer
The EL8 and later kickstart templates append /tmp/pre-install.log to
/var/log/xcat/xcat.log in the chroot %post. Anaconda runs that block in
the installed system, whose /tmp does not hold the installer's log, so
the %pre output, such as the install disk and the partition layout,
never reaches the node's xcat.log.

Copy the log in a %post --nochroot block before the main %post, from
the installer's /tmp to the installed system at /mnt/sysimage. The EL6
and EL7 templates use %include for this and are unchanged.
2026-11-06 23:10:32 -03:00
Vinícius Ferrão e1d9900b3e test(install): keep custom partition files out of the install log
Render the rhels9 and rhels10 kickstarts with no partitionfile, a custom
partitionfile and a custom partition script, each with xcatdebugmode 0,
1 and 2, and run %pre in a sandbox. The custom input holds credentials
in the =, separated, quoted, escaped and split option forms, a boot
loader password and a root password. The pre-install log must show the
generated partition scheme, or a notice for custom input, with neither a
credential nor a traced decoded byte of the custom input, and anaconda
must still get the custom partition definitions.

Run the new test in the profile artifact job.
2026-11-06 23:10:32 -03:00
Vinícius Ferrão 944ac3f6e9 fix(install): keep custom partition files out of the install log
pre.rhels8 and pre.rhels10 print /tmp/partitionfile into the
pre-install log, so that the partition scheme can be inspected after
the installation. A custom partitionfile can hold credentials, such as
the --passphrase of an encrypted partition or a boot loader --password,
and the log then holds them in clear text. With site.xcatdebugmode 1 or
2, %pre also traces the decoding of a custom partitionfile or partition
script, and the trace spells out every decoded byte.

The pre-install log now shows the partition scheme only when xCAT
generated it, and says that a custom partition file is not logged. The
decoding of a custom partitionfile or partition script runs untraced.
/tmp/partitionfile, which anaconda reads, is unchanged.
2026-11-06 23:10:32 -03:00
Vinícius Ferrão 2770ff0840 test(install): run the SELinux relabel after the EL post scripts
Each kickstart template with #SELINUXRELABEL#, rendered for an enforcing
node and run in a sandbox through its downloaded postscript, must call
restorecon once, after the postscript ran and post.rhels8 or post.rhels10
disabled the vendor repository. A disabled node must get no relabel.
2026-11-06 23:10:31 -03:00
Vinícius Ferrão d198efde01 test(install): run riscv64 %post --nochroot blocks outside the chroot
The riscv64 profile test runs every rendered %post block as if it ran in
the installed system. Anaconda runs a --nochroot block in the installer,
with the installed system at /mnt/sysimage, so give such a block that
view.
2026-11-06 23:10:31 -03:00
Vinícius Ferrão d52b2d463b fix(install): run the SELinux relabel after the EL post scripts
post.rhels8 and post.rhels10 end with exit 0. The kickstart templates
include them inline in the %post script, so the exit ends that script
before #SELINUXRELABEL#, and restorecon never runs on an enforcing or
permissive node.

Both scripts now end with their last command, so the templates reach
the relabel after the xCAT post scripts wrote their files.
2026-11-06 23:10:31 -03:00
Vinícius Ferrão 25793a41f0 test(netboot): hand the NetworkManager lease of the initrd to diskless roots
The stateless xcatroot of dracut_047, run in a chroot with NetworkManager
leases of the dhclient and internal clients in the initrd, must copy
both into the root under their own names. CI now runs the xcatroot test
as root.
2026-11-06 23:10:30 -03:00
Vinícius Ferrão 93f27a2674 fix(netboot): hand the NetworkManager lease of the initrd to diskless roots
xcatroot passes the DHCP lease of the initrd to the root image only from
/tmp/dhclient.*.lease, which the old dracut network scripts write. An
initrd that runs NetworkManager keeps its lease in /var/lib/NetworkManager.
The NetworkManager of the root takes over the same connection, finds no
lease and starts again with DHCPDISCOVER while the address stays on the
interface. A DHCP server that does not answer in time makes
NetworkManager-wait-online fail, and when the DHCP timeout expires
NetworkManager removes the address from the boot interface.

xcatroot now also copies the NetworkManager leases, so the root renews
the lease of the initrd with a DHCPREQUEST. Only the stateless xcatroot
of dracut_047 changes; statelite and the other dracut modules keep their
handoff.
2026-11-06 23:10:30 -03:00
Daniel Hilst 21984aade8 Merge pull request #8021 from VersatusHPC/fix/imgutils-bare-move
fix(genimage): use_host_resolver dies on an undefined subroutine move
2026-11-06 21:47:04 -03:00
Daniel Hilst 21b24f1e7d fix(xcat-core): use_host_resolver dies on an undefined subroutine move
imgutils.pm imports File::Copy with an empty list, so the module exports no
function and a bare move() is not defined. use_host_resolver calls move()
unqualified, so it dies with "Undefined subroutine &imgutils::move called" the
first time genimage reaches it, before it has moved either file aside.

Every other call site in the file already qualifies the name:
File::Copy::cp at line 139, File::Copy::copy at 208 and at 302, the last of
them two lines below the defect. The call is now qualified the same way.

xCAT-test/unit/imgutils_host_resolver.t and imgutils_reused_root.t both die at
load on the unfixed tree and pass with the fix, 34 tests.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-06 17:34:05 -03:00
Daniel Hilst 0e3caac201 Merge pull request #8019 from VersatusHPC/fix/ubuntu-genimage-rerun
fix(ubuntu): reuse the root image of an earlier genimage run
2026-11-06 17:21:59 -03:00
Daniel Hilst 005f09d51f Merge pull request #8020 from VersatusHPC/fix/geninitrd-exit-status
fix(geninitrd): report a failed genimage run
2026-11-06 17:17:57 -03:00
Daniel Hilst 1b91c188ce Merge pull request #8018 from VersatusHPC/fix/ubuntu-genimage-boot-files
fix(genimage): publish the kernel and ramdisks together
2026-11-06 17:17:10 -03:00
Daniel Hilst 0c94c50f55 Merge pull request #8011 from VersatusHPC/fix/go-xcat-apt-listing
fix(go-xcat): read apt candidates in the C locale
2026-11-06 16:57:30 -03:00
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 e4f6b4be5d Merge pull request #8017 from VersatusHPC/test/native-shell-script-tests
test(native): run shell script tests outside the unit runner
2026-11-06 15:56:14 -03:00
Daniel Hilst bc1a419f7e Merge pull request #8007 from VersatusHPC/fix/template-missing-root-password
fix(install): stop nodeset when a template has no root password
2026-11-06 15:54:05 -03:00
Vinícius Ferrão cec5fd2557 docs(genimage): require the image lock for boot file publication 2026-11-06 15:32:09 -03:00
Vinícius Ferrão 9df65310a8 test(genimage): cover the image lock of EL geninitrd 2026-11-06 15:32:09 -03:00
Vinícius Ferrão a53b65a96d fix(genimage): take the image lock for every EL geninitrd run
The Red Hat-family genimage took the image operation lock with
--onlyinitrd only for openEuler. Two geninitrd runs on another release,
or a geninitrd run during packimage, could publish and roll back boot
files over each other.

genimage now takes the lock with --onlyinitrd for every release, as it
already does for a full build.
2026-11-06 15:31:39 -03:00
Vinícius Ferrão cb75045114 test(genimage): stop checking that EL geninitrd runs without the lock 2026-11-06 15:31:38 -03:00
Vinícius Ferrão 454fe59784 test(genimage): cover a rollback whose backup is gone 2026-11-06 15:25:36 -03:00
Vinícius Ferrão 8a059f4665 fix(genimage): restore boot files from the recorded backups
publish_staged_boot_files looked for the backup of a file during the
rollback to decide whether to restore it or remove the published file.
When that lookup failed, it removed the published file, and the staging
cleanup then removed the backup.

publish_staged_boot_files now records each backup that it makes and
rolls back from that record. A file without an earlier copy is one for
which link reports ENOENT. Any other link error stops the publication.
2026-11-06 15:25:36 -03:00
Vinícius Ferrão 7f51e1da88 test(genimage): cover a rename that fails after it moved the file 2026-11-06 15:19:24 -03:00
Vinícius Ferrão 9a02347d97 fix(genimage): put back a boot file that a failed rename moved
On NFS, a rename can take effect and still report a failure after the
client retries the request. publish_staged_boot_files then put back
only the files that it published before, so the new file stayed next
to the older set, and the staging cleanup removed its backup.

When the staged copy of the file is gone after a failed rename,
publish_staged_boot_files now puts back that file too.
2026-11-06 15:19:24 -03:00
Vinícius Ferrão 4fc0d3e211 docs(genimage): describe how genimage builds and publishes boot files
The page also names the genimage scripts that do not follow the rules
yet.
2026-11-06 15:10:27 -03:00
Vinícius Ferrão 6b2c183246 test(genimage): cover the staged publication of EL boot files 2026-11-06 15:08:51 -03:00
Vinícius Ferrão 876ff7bfe0 fix(genimage): publish the EL kernel and ramdisks together
The Red Hat-family genimage staged and published the boot files only
for openEuler. For the other releases, it copied the kernel into the
image directory before it built the initial ramdisks, and it ignored a
failed kernel copy and a failed move of a ramdisk. When dracut failed,
the new kernel stayed next to the ramdisks of the earlier build. On
images without dracut, a failed cpio replaced the ramdisks with empty
archives.

genimage now builds the kernel and both ramdisks in a temporary
directory inside the image directory for every release, and publishes
them with publish_staged_boot_files after both ramdisks are built. It
stops when the kernel copy, dracut, the move of a ramdisk or any command
of the cpio pipeline fails. openEuler keeps its single stateless
ramdisk.
2026-11-06 14:56:31 -03:00
Vinícius Ferrão 1f6f56e559 test(genimage): drop the checks of the per-ramdisk publication
imgutils_staged_boot_files.t covers the publication of boot files. The
remaining checks of the unit test openeuler_genimage_bootfiles.t cover
disable_vendor_repositories, so the file now has that name.

The native EL cases checked that genimage keeps copying the kernel into
place before dracut runs, which the next change removes.
2026-11-06 14:56:31 -03:00
Vinícius Ferrão 173ab102e5 test(genimage): cover the kernel copy and the cpio packing 2026-11-06 14:52:57 -03:00
Vinícius Ferrão 555732abf9 refactor(genimage): share the kernel copy and the cpio packing
The Ubuntu and the Red Hat-family genimage each had their own code to
find and copy the kernel of the image and to pack a cpio initial
ramdisk. imgutils now has copy_kernel and pack_initrd for this, and the
Ubuntu genimage uses them.

copy_kernel also takes lib/modules/<release>/vmlinuz, which the Red
Hat-family genimage already takes.
2026-11-06 14:52:56 -03:00
Vinícius Ferrão 473c8dc947 test(geninitrd): cover the exit status of genimage 2026-11-06 02:44:26 -03:00
Vinícius Ferrão e859b4e39a fix(geninitrd): report a failed genimage run
geninitrd ran genimage --onlyinitrd for netboot and statelite images and
ignored its exit status. When genimage failed, geninitrd still exited
with 0. The errors that the genimage client writes to stderr did not
reach the user.

geninitrd now passes the genimage output to the client with stderr
included. When genimage ends with a status other than 0, geninitrd
reports an error and exits with the genimage exit code, or with 1 when
genimage could not run.
2026-11-06 02:44:25 -03:00
Vinícius Ferrão 35b7e5a91f fix(ubuntu): publish the kernel and ramdisks of genimage together
genimage copied the kernel to the image directory before it built the
initial ramdisks. When dracut failed for either ramdisk, a new kernel
stayed next to the old ramdisks, and nodeset copied that set. The
legacy ramdisk ignored a failed cpio pipeline and published what the
compressor wrote.

genimage now builds the kernel and both ramdisks in a staging
directory in the image directory. It publishes them together with
publish_staged_boot_files after both ramdisks are built, and writes the
root image check and UFTP markers after that. A failure leaves the
previous kernel and ramdisks in place.
2026-11-05 21:38:54 -03:00
Vinícius Ferrão fe3740f9dc test(genimage): cover the publication of a kernel with several ramdisks 2026-11-05 21:38:54 -03:00
Vinícius Ferrão acc8089c2a refactor(genimage): publish a staged kernel with several initial ramdisks
publish_boot_files publishes one kernel with one initial ramdisk, so a
genimage that builds the statelite and the stateless ramdisk cannot
use it. publish_staged_boot_files publishes the kernel and the ramdisks
of several modes from one staging directory. When a rename fails, it
puts back every file that it already replaced.

publish_boot_files keeps its interface for the openEuler build.
2026-11-05 21:38:54 -03:00
Vinícius Ferrão 9d40a2e0d3 test(ubuntu): cover genimage reuse of a finished root image 2026-11-05 18:39:24 -03:00
Vinícius Ferrão 4ea954099a fix(ubuntu): reuse the root image of an earlier genimage run
genimage ran debootstrap on every run. For Ubuntu 19.04 and later,
debootstrap extracts with tar -k, so a second run on an existing root
image failed at base-files and blamed the mirror.

genimage now skips debootstrap when an earlier run finished it and
updates the image with apt. The image holds the dummy resolv.conf and
the otherpkgs apt sources of that run. Before the first apt command,
genimage removes the apt sources that it writes again later and gives
the image the hosts and resolv.conf of the build host. A .bak file
that an interrupted run left is kept, so the image still gets its own
file back.

genimage stops with an error and leaves the root image unchanged in
three cases. The root image holds another Ubuntu release or
architecture, the debootstrap directory of an unfinished run, or the
bin/uname-binary backup of an interrupted run.
2026-11-05 18:39:24 -03:00
Vinícius Ferrão 38e00d0cf2 test(ubuntu): cover the kernel that genimage publishes 2026-11-05 18:39:24 -03:00
Vinícius Ferrão 3e3ee8f108 fix(ubuntu): publish the newest kernel of a root image
genimage took the last kernel of a sorted file list. When an image
held 6.8.0-99-generic and 6.8.0-100-generic, it published -99 and
built the initrds for it. The uname of the image build also reported
-99 to the package scripts, and it ignored an explicit kernelver.

genimage and that uname now compare kernel releases number by number,
so both choose -100. An explicit kernelver decides for both.
2026-11-05 18:39:24 -03:00