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

29370 Commits

Author SHA1 Message Date
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 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 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
Vinícius Ferrão b473ce90d0 fix(ubuntu): lock the root image while genimage builds it
packimage, rmimage and the EL genimage take the image operation lock
of a root image, but the Ubuntu genimage did not. packimage or rmimage
could work on a root image while genimage installed packages in it,
and two genimage or geninitrd runs could change one root image at the
same time.

genimage now takes the lock before it changes the root image, for a
full build and for the --onlyinitrd run of geninitrd, and holds it
until it exits.
2026-11-05 16:59:53 -03:00
Daniel Hilst d45db7a6e4 Merge pull request #8010 from VersatusHPC/docs/mixed-cluster-build-node-perl
docs(mixed-cluster): copy the xCAT Perl library to the image build node
2026-11-05 15:59:48 -03:00
Daniel Hilst d4f080ce77 Merge pull request #8004 from VersatusHPC/fix/ubuntu-subiquity-install-disk
fix(ubuntu): apply partitionfile entries on Subiquity installs
2026-11-05 15:58:54 -03:00
Daniel Hilst ac4a63d67d Merge pull request #8003 from VersatusHPC/docs/riscv64-ubuntu-support-matrix
docs(support-matrix): list Ubuntu 24.04 and 26.04 on riscv64
2026-11-05 15:58:11 -03:00
Vinícius Ferrão 2aa3863881 test(probe): move the detect_dhcpd test to the native tests
The test runs both detect_dhcpd scripts with a fake tcpdump, and its
capture cases need private mount and network namespaces. It now lives in
xCAT-test/native with the other namespace tests, and the pull-request
workflow runs it in its own step. The capture cases keep their own unshare
call, because they add a default route on the loopback interface.
2026-11-03 18:08:30 -03:00
Vinícius Ferrão d4c0b34393 test(debian): run the xcatd init state test in a sandbox
The unit test ran the Debian init helpers in the host shell, with fake
ucf, update-rc.d, systemctl and mv first in the host PATH. It now runs them
with sandbox_run in xCAT-test/native, with the compatibility root apart from
the /etc of the sandbox, and the Debian package lifecycle step runs it.
2026-11-03 18:08:18 -03:00
Vinícius Ferrão 1c2a71d250 test(scriptlib): run the NetworkManager autoconnect test in a sandbox
The unit test sourced scriptlib in the host Bash, with a fake nmcli first
in the host PATH. It now runs the helper with sandbox_run in
xCAT-test/native, and the pull-request workflow runs it in its own step.
2026-11-03 18:08:11 -03:00
Vinícius Ferrão 00fb5843cf docs(ubuntu): describe partitionfile on Subiquity installs
State that on Subiquity installs the partition definition file or script
provides a curtin storage section that replaces the default layout, that
a layout without a match is restricted to the disk a disk entry selects,
that a failed layout or disk entry stops the install, that the first disk
of a disk file is used, and that a disk script runs in the live installer
under dash. Name the file that the disk file and the disk script write as
/tmp/xcat.install_disk, which both Ubuntu installers read, instead of
/tmp/install_disk.
2026-11-03 17:53:21 -03:00
Vinícius Ferrão 75c874ebad test(ubuntu): cover a partitionfile layout on the partitionfile disk
A layout without a match that follows a disk file gets a match on the
disk the file selects, resolved when it is a link, and a use_gap layout
that follows a disk file stops the install. A layout with its own match
and a layout without a disk entry are kept as written.
2026-11-03 17:53:20 -03:00