Skip to content

Commit 564ef2a

Browse files
committed
fix(rhel): address several RHEL/Rocky 10 post-install issues
* Replace in-place edit of /etc/systemd/logind.conf with a drop-in under /etc/systemd/logind.conf.d/. Recent systemd versions (RHEL/Rocky 10, Fedora 39+) moved logind.conf to /usr/lib/systemd/ and no longer ship it under /etc/, so the previous sed call failed with "No such file or directory". * Locate grub.cfg by probing the well-known UEFI vendor and BIOS paths directly instead of keying off the installer's /sys/firmware/efi and running find. On RHEL/Rocky 10 UEFI installs this was silently skipping the grub2-mkconfig regeneration, leaving the console ordering change in /etc/default/grub unapplied. * Drop the dead "yum erase authconfig" call. authconfig has not existed since RHEL 8 (replaced by authselect), so the call was a no-op on every supported target.
1 parent f66f73e commit 564ef2a

2 files changed

Lines changed: 31 additions & 15 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010

1111
### Fixed
1212

13+
* `lf-rhel.cfg`: Fix `grub2-mkconfig` being silently skipped on RHEL/Rocky 10 UEFI installs. The previous check keyed off the installer's `/sys/firmware/efi` and only looked at one path; it now probes the well-known UEFI vendor directories and the BIOS path directly, so the console-ordering change in `/etc/default/grub` is actually reflected in the generated `grub.cfg`
1314
* `lf-rhel.cfg`: Fix post-install failure on RHEL 10 / Rocky 10 cloud installs. The previous `%post --nochroot` block copied `dynamic.ks` and `70-install-ssh-keys.ks` into `/root` of the installed system for auditing and kept breaking across Anaconda versions (first `/proc/mounts` parsing, then mount-point layout). The archival is now performed by a chrooted `%post` hook generated in `%pre` under `/usr/share/anaconda/post-scripts/`, with the content embedded via base64-decoded heredoc. The same kickstart now works on RHEL/Rocky 8, 9 and 10
15+
* `lf-rhel.cfg`: Fix `sed: can't read /etc/systemd/logind.conf` on RHEL/Rocky 10 cloud installs. Recent systemd versions no longer ship `logind.conf` under `/etc/`; the `NAutoVTs=0` override is now applied via a drop-in at `/etc/systemd/logind.conf.d/10-lf-no-auto-vts.conf`, which works on all supported systemd versions
16+
17+
### Removed
18+
19+
* `lf-rhel.cfg`: Drop the dead `yum erase authconfig` call from the cloud post-install script. `authconfig` has not existed since RHEL 8 (replaced by `authselect`), so the call was a no-op on every supported target
1420

1521

1622
## [1.2.0] - 2026-04-15

lf-rhel.cfg

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,6 @@ echo "Removing firewalld"
256256
# yum -C -y remove "firewalld*" --setopt="clean_requirements_on_remove=1"
257257
yum --cacheonly -y erase "firewalld*"
258258

259-
# Another one needed at install time but not after that, and it pulls
260-
# in some unneeded deps (like, newt and slang)
261-
echo "Removing authconfig"
262-
yum --cacheonly -y erase authconfig
263-
264259
echo "Removing avahi"
265260
yum --cacheonly -y remove avahi\\*
266261

@@ -278,10 +273,18 @@ systemctl enable cloud-final
278273
systemctl enable rngd
279274

280275
echo "Getty fixes"
281-
# although we want console output going to the serial console, we don't
282-
# actually have the opportunity to login there. FIX.
283-
# we don't really need to auto-spawn _any_ gettys.
284-
sed --in-place 's/^#NAutoVTs=.*/NAutoVTs=0/' /etc/systemd/logind.conf
276+
# We don't need autospawned gettys on cloud/virtual instances: although we
277+
# route console output to the serial console, we don't actually have the
278+
# opportunity to log in there. Use a logind drop-in instead of editing
279+
# /etc/systemd/logind.conf in place, because recent systemd versions
280+
# (shipped with RHEL/Rocky 10 and Fedora 39+) moved the stock logind.conf
281+
# to /usr/lib/systemd/ and no longer ship it under /etc/. Drop-ins in
282+
# /etc/systemd/logind.conf.d/ work on all supported systemd versions.
283+
mkdir -p /etc/systemd/logind.conf.d
284+
cat > /etc/systemd/logind.conf.d/10-lf-no-auto-vts.conf << EOF
285+
[Login]
286+
NAutoVTs=0
287+
EOF
285288

286289
echo "Network fixes"
287290
# initscripts don't like this file to be missing.
@@ -341,15 +344,22 @@ echo 'Adjust console output in /etc/default/grub and regenerate grub config'
341344
# If init script messages need to be seen on the serial console as well, it should be made
342345
# the primary by swapping the order of the console parameters:
343346
sed --in-place 's/console=ttyS0,115200n8 console=tty0/console=tty0 console=ttyS0,115200n8/' /etc/default/grub
344-
if [ -d /sys/firmware/efi/ ]; then
345-
grub_config_file=$(find /boot/efi -name grub.cfg)
346-
else
347-
grub_config_file=$(find /boot/ -name grub.cfg)
348-
fi
347+
# Locate grub.cfg by checking well-known locations directly. The previous
348+
# approach keyed off the installer's /sys/firmware/efi and called find, which
349+
# missed the UEFI grub.cfg on RHEL/Rocky 10 installs and silently skipped the
350+
# grub2-mkconfig regeneration. Check the UEFI vendor directories first, then
351+
# the BIOS location.
352+
grub_config_file=
353+
for candidate in /boot/efi/EFI/*/grub.cfg /boot/grub2/grub.cfg; do
354+
if [ -f "$candidate" ]; then
355+
grub_config_file="$candidate"
356+
break
357+
fi
358+
done
349359
if [ -z "$grub_config_file" ]; then
350360
echo 'Could not find a grub.cfg in /boot. Skipping grub2-mkconfig'
351361
else
352-
grub2-mkconfig --output=$grub_config_file
362+
grub2-mkconfig --output="$grub_config_file"
353363
fi
354364

355365
echo "Removing random-seed so it's not the same in every image"

0 commit comments

Comments
 (0)