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

11121 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
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 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 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 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 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 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 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 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 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 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 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 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 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 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
Vinícius Ferrão f1d8641672 fix(ubuntu): keep a partitionfile layout on the partitionfile disk
A Subiquity layout written with "layout:" and no "match" goes to the
largest disk. With a d: or s:d: entry in linuximage.partitionfile, that
disk need not be the one the entry selected, so the install could wipe a
disk the entry was meant to keep it off.

When a disk entry is configured, give such a layout a match on the
selected disk. Refuse a use_gap layout in that case, because some
Subiquity releases ignore match in use_gap mode and would install into
free space on another disk. A layout with its own match, a "config:"
layout and a layout without a disk entry are kept as written.
2026-11-03 17:53:20 -03:00
Vinícius Ferrão 45546220be fix(ubuntu): stop a Subiquity install when a partitionfile entry fails
A disk script or layout script that failed, or a disk or layout entry that
held nothing usable, left the disk getinstdisk chose or the default layout
in place, and the install went on to wipe that disk. A layout whose
storage section is missing or empty is worse: Subiquity then puts LVM on
the largest disk. The entry exists to keep the install off some disks, so
these fallbacks can destroy the disk it protects. A valid layout that
started a YAML document also broke the install, because it was appended
to autoinstall.yaml as a second document.

When a disk or layout entry is configured, require it to succeed and to
write a disk name, or a storage section with a config or a layout, and
stop the pre-install script with an error otherwise. Subiquity then stops
before it partitions. Rewrite an accepted layout as a YAML fragment that
holds only the storage section. Without an entry, the detected disk and
the default layout are used as before.
2026-11-03 17:53:20 -03:00
Vinícius Ferrão e87c72c38d fix(template): read each partitionfile entry with its own s: prefix
linuximage.partitionfile takes a comma-separated list of layout, d: disk
and c: configuration entries, any of them prefixed with s: for a script.
The Ubuntu layout step chose between decoding a layout file and running a
layout script by the s: prefix of the last entry in the whole list, so a
layout file followed by an s:d: disk script was run as a script, and a
layout script followed by a d: disk file was copied into the layout as
text. The parser also kept a script flag set by an earlier entry of the
same kind after a later entry replaced it.

Give each kind the prefix of the entry that is used, the last one of that
kind, and decode the Ubuntu layout by it.
2026-11-03 17:53:19 -03:00
Vinícius Ferrão 1f990063f5 fix(ubuntu): apply partitionfile entries on Subiquity installs
linuximage.partitionfile had no effect on Ubuntu 20.04 and later installs.
The Subiquity pre-install script decodes each entry with base64decode,
which uses read -n, and Subiquity runs the script under dash, which has no
read -n. A layout file decoded to an empty storage config, which stops the
install, and a layout script or disk script decoded to nothing. The d: and
s:d: disk step also ran after the script had written the storage config,
so a disk file could not change the disk that getinstdisk chose, which
prefers a disk that already holds an operating system.

Decode with coreutils base64, which the live system ships, and run the
disk step before the storage config is written. The storage config uses
the first disk the disk file names, because the layout uses one disk, and
names it by its device node: Subiquity matches the path literally and
finds no disk for a /dev/disk/by-id link.
2026-11-03 17:53:19 -03:00
Daniel Hilst 557a39dd0c Merge pull request #8013 from VersatusHPC/feat/openeuler-riscv64
feat(openeuler): support riscv64 compute nodes
2026-11-03 13:17:33 -03:00
Daniel Hilst a82d521152 Merge pull request #8009 from VersatusHPC/fix/el10-initrd-network-handoff
fix(netboot): drop the dhclient and ifcfg handoff from EL10 initrds
2026-11-03 13:15:15 -03:00
Daniel Hilst 3ab5de330d Merge pull request #8008 from VersatusHPC/fix/el10-netboot-auto-default
fix(netboot): keep EL10 diskless nodes from DHCP on every port
2026-11-03 13:14:44 -03:00
Daniel Hilst f5db4cb78f Merge pull request #8005 from VersatusHPC/fix/riscv64-efi-boot-entries
fix(install): keep the riscv64 boot entries of other disks
2026-11-03 13:14:14 -03:00
Daniel Hilst f76458fb4b Merge pull request #8002 from VersatusHPC/fix/go-xcat-apt-install
fix(go-xcat): install from apt without apt-key and skip missing packages
2026-11-03 13:13:49 -03:00
Daniel Hilst 753ec32eb5 Merge pull request #8001 from VersatusHPC/fix/riscv64-intel-net-drivers
fix(netboot): give riscv64 images the Intel 700 and 800 series drivers
2026-11-03 13:13:21 -03:00
Daniel Hilst 4e13265ed2 Merge pull request #8000 from VersatusHPC/fix/ipmi-sdr-reservation
fix(ipmi): read the SDR when the BMC grants an unadvertised reservation
2026-11-03 13:12:34 -03:00
Vinícius Ferrão 3505c49b9a fix(anaconda): refuse to mix the RVA20 and RVA23 openEuler media
openEuler publishes RVA20 and RVA23 builds of each riscv64 release. Both
carry the same .treeinfo identity, so copycds copies the second one into
the directory of the first, and the result is a repository with packages
of two builds.

copycds now compares the .discinfo description, RVA23 or empty, with the
copy already in the target directory, and refuses a different build. Media
of the same build, and every other architecture, copy as before.
2026-11-02 19:55:57 -03:00
Vinícius Ferrão 4f8d099b19 fix(install): start kdump on openEuler nodes only with dump memory
On riscv64, an installed openEuler node reserves no dump memory, so
kdump.service fails and the node boots degraded.

The openEuler kickstart %post adds the kdump.service drop-in that
stateless images get. It runs before post.rhels8, which ends the %post
script with exit 0. A node whose command line carries crashkernel= or
fadump= still starts kdump.
2026-11-02 19:55:56 -03:00
Vinícius Ferrão 48c4f81b82 fix(netboot): start kdump on stateless nodes only with dump memory
openEuler diskless images enable kdump.service, which @core brings in. A
stateless command line reserves dump memory only through linuximage.dump
or addkcmdline, so on every other node kdump.service fails and the node
boots degraded.

genimage adds a kdump.service drop-in with triggering conditions on
crashkernel and fadump, so the service is skipped when the command line
has neither. POWER firmware-assisted dumps, which xCAT configures with
fadump= and no crashkernel=, still start. An image without kdump.service
is unchanged.
2026-11-02 19:37:46 -03:00
Vinícius Ferrão 0c9860fcfa fix(netboot): build and pack openEuler riscv64 diskless images
genimage and packimage admit openEuler images only for x86_64 and
ppc64le. For the riscv64 osimage that copycds creates, genimage stops with
"Unsupported openEuler release or architecture" and packimage with
"Unsupported openEuler image release or architecture".

Admit riscv64 in both commands.
2026-11-02 17:48:53 -03:00
Vinícius Ferrão a3d3926c70 fix(anaconda): publish the riscv64 boot loader of openEuler media
copycds looks for EFI/BOOT/grubriscv64.efi on riscv64 media. openEuler
media carry the same image as EFI/BOOT/grubriscv64.EFI, so copycds
publishes no grub2.riscv64. A management node with only openEuler media
then has no riscv64 network boot loader.

Match the image name case-insensitively, as UEFI does.
2026-11-02 17:48:53 -03:00
Vinícius Ferrão 2fb4e3b89a fix(anaconda): accept the openEuler riscv64 media
openEuler publishes 24.03 LTS installation media for riscv64, but the
openEuler media check admits only x86_64 and ppc64le. copycds stops with
"Unsupported openEuler architecture in .treeinfo".

Admit riscv64 as well. aarch64 stays refused.
2026-11-02 17:48:52 -03:00
Vinícius Ferrão 1e1ed51601 fix(go-xcat): keep tput errors out of the package table
list_xcat_packages reads the terminal width with tput cols. With an
unknown or unset TERM, tput prints "unknown terminal" or "No value for
$TERM" in the middle of the go-xcat output.

Check the terminal type with tput longname, with its output discarded,
before reading the width. tput cols keeps its stderr, because the tput
of ncurses 5 (EL7) reads the width through stderr. With stderr
discarded, it reports 80 columns on a wider terminal.
2026-10-30 21:02:43 -03:00
Vinícius Ferrão 3d30d5fd86 fix(go-xcat): read apt candidates in the C locale
check_repo_version_apt looks for the "Candidate:" label of apt-cache
policy. A translated apt prints that label in the user's language. The
package table of go-xcat check, install and update then showed every
package as "(not found)" in the repositories.

Run apt-cache policy with LC_ALL="C" inside check_repo_version_apt, so
that every caller gets the untranslated labels. Drop the LC_ALL=C that
the install filter added.
2026-10-30 21:02:42 -03:00
Vinícius Ferrão 1c42a2c729 fix(netboot): drop the dhclient and ifcfg handoff from EL10 initrds
The dracut_105 xcatroot scripts and the statelite xcat-prepivot.sh
copied dhclient leases and wrote an ifcfg file for the boot interface.
EL10 has no dhclient and no ifcfg plugin. The copy failed with "cannot
stat" on every boot, and the ifcfg write failed on a directory that the
image does not have. NetworkManager in the initrd already hands the boot
interface to the NetworkManager of the root image.

The scripts no longer copy leases or write ifcfg files.
2026-10-30 17:51:15 -03:00
Vinícius Ferrão 9da20e00cd fix(netboot): keep EL10 diskless nodes from DHCP on every port
NetworkManager in an EL10 diskless image made a DHCP profile for every
Ethernet port without one. A port with a link but no DHCP server kept
NetworkManager-wait-online from finishing, so the node booted degraded.
Diskful nodes are not affected, because anaconda writes a profile for
every port.

genimage now sets no-auto-default=* in the NetworkManager configuration
of EL10 images. The boot interface keeps the profile from the initial
ramdisk. The other interfaces get only the profiles that the image or
the xCAT network configuration gives them.
2026-10-30 17:43:53 -03:00
Vinícius Ferrão 2536ccc134 fix(netboot): write keyfiles for the otherifce interfaces of EL10 images
genimage wrote an ifcfg file for each interface that otherifce or
genimage -r names. EL10 reads no ifcfg files, and its images have no
network-scripts directory. Such an interface got DHCP only from the
profile that NetworkManager makes for any port without one.

genimage now writes a NetworkManager keyfile with DHCP for each of these
interfaces on EL10 and later. A rebuild replaces the keyfiles of the
earlier build. Older releases still get the same ifcfg files.
2026-10-30 17:43:53 -03:00
Vinícius Ferrão c3e322de96 fix(install): stop nodeset when a template has no root password
A #CRYPT# template entry rendered as an empty string when the passwd
table had no row for its key. An EL kickstart then held a bare
"rootpw --iscrypted", and anaconda stopped with "A single argument is
expected for the rootpw command". nodeset reported no error.

nodeset now reports the missing passwd row and writes no boot
configuration for the node, as it does for a missing #TABLE# field.
#CRYPTORLOCKED# still renders a locked password.
2026-10-30 17:43:41 -03:00
Vinícius Ferrão 2f160aea37 fix(install): keep the riscv64 boot entries of other disks
The EL10 riscv64 fix-up removed every UEFI boot entry for shimx64,
grubx64 or grubriscv64, on any disk. The default partition layout
installs to one disk and keeps the others, so an operating system on
another disk lost its boot entry.

The fix-up now removes only the entries on the ESP of the new install.
Anaconda removes the entries with its own label before it adds its own,
so an install that recreated the ESP leaves no old entry behind. When
lsblk reports no partition GUID for the ESP, the fix-up removes nothing
and still adds the new entry.
2026-10-30 15:55:05 -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
Vinícius Ferrão 15f208ad0c fix(go-xcat): skip packages the apt repositories do not provide
On apt, go-xcat handed its whole list to one apt-get install, so a package the
repositories lack aborted the install. ipxe-xcat is in the install list but
not in the latest apt repositories, and no riscv64 apt repository has
xcat-genesis-openembedded-riscv64.

Install the packages that have a candidate and warn about each one that has
none, as dnf --setopt=strict=0 already does on EL. A missing xcat metapackage
still stops the install, because it depends on every package a management
node needs. A failed apt-cache policy query also stops it, so a broken cache
is not taken for missing packages. The query runs in the C locale, because a
translated apt prints no "Candidate:" label.
2026-10-29 20:32:05 -03:00
Vinícius Ferrão f937b60a71 fix(go-xcat): install the apt key without apt-key
apt 3, which Ubuntu 26.04 ships, has no apt-key, so go-xcat stopped with
"import xcat apt key failed" before it configured a repository. On Ubuntu
18.04 to 24.04, apt-key also fails when gnupg is not installed, and go-xcat
does not install it.

Decode the armored key with base64 and install it as the binary keyring
/etc/apt/trusted.gpg.d/xcat.gpg. Every apt release reads that file, while
apt 1.0 and 1.2 on Ubuntu 14.04 and 16.04 ignore an armored key there. The
key stays trusted for all repositories, as it was with apt-key. A complete
uninstall removes the key with the repository files.

As with apt-key, a download that holds no public key stops go-xcat and
leaves the installed key in place. go-xcat refuses a download whose armored
blocks do not all end with their END line, as a truncated download does. It
accepts the keyring only when it starts with a public key packet, the check
apt applies to a binary keyring.
2026-10-29 20:32:04 -03:00