Bug 2059565

Summary: Installed system not bootable due to wrong kernel arguments in BLS snippets
Product: Red Hat Enterprise Linux 9 Reporter: Christian Kellner <ckellner>
Component: anacondaAssignee: Jiri Konecny <jkonecny>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 9.0CC: bootloader-eng-team, fmartine, jaredz, jkonecny, jrusz, jstodola, lnykryn, mlewando, msekleta, obudai, perobins, pvlasin, pzatko, rharwood, rvykydal
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: anaconda-34.25.0.29-1.el9_0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2065170 (view as bug list) Environment:
Last Closed: 2022-05-17 12:31:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2065170    

Description Christian Kellner 2022-03-01 10:50:36 UTC
Description of problem:

Using an "image installer" built by Image Builder, i.e. basically a bootiso using the liveimg method with a tarball, the installed system is not bootable because it has the wrong kernel command line in the BLS snippet:

[anaconda root@localhost ~]# cat /mnt/sysroot/boot/loader/entries/ffffffffffffffffffffffffffffffff-5.14.0-69.el9.x86_64.conf
title Red Hat Enterprise Linux (5.14.0-69.el9.x86_64) 9.0 (Plow)
version 5.14.0-69.el9.x86_64
linux /vmlinuz-5.14.0-69.el9.x86_64
initrd /initramfs-5.14.0-69.el9.x86_64.img $tuned_initrd
options inst.stage2=hd:LABEL=RHEL-9-0-0-BaseOS-x86_64 inst.ks=hd:LABEL=RHEL-9-0-0-BaseOS-x86_64:/osbuild.ks quiet inst.sshd $tuned_params
grub_users $grub_users
grub_arg --unrestricted
grub_class rhel


It seems that anaconda itself has the right kernel parameters: "crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap" but they don't make it into the BLS snippet.

From what I can see from the code in anaconda https://github.com/rhinstaller/anaconda/blob/612bfee7d37e16d7bfab329b44182a71d04a3344/pyanaconda/modules/storage/bootloader/utils.py#L237 it uses the "kernel-install" machinery which in turn uses "20-grub.install" (https://src.osci.redhat.com/rpms/grub2/blob/rhel-9.0.0/f/20-grub.install). That file, in RHEL 9 and F34+, looks in "/etc/kernel/cmdline", "/usr/lib/kernel/cmdline" and finally in "/proc/cmdline". It *seems* like it falls back to the last one, the actual kernel command line used to boot the iso since that matches the BLS entires of the installed system. None of the first two locations is configured during the installation:

[anaconda root@localhost ~]# ls -la /mnt/sysroot/usr/lib/kernel/
total 12
drwxr-xr-x.  3 root root   43 Mar  1 10:03 .
dr-xr-xr-x. 32 root root 4096 Mar  1 10:03 ..
-rw-r--r--.  1 root root  353 Jan 18 11:35 install.conf
drwxr-xr-x.  2 root root 4096 Mar  1 10:03 install.d
[anaconda root@localhost ~]# ls -la /mnt/sysroot/usr/lib/kernel/install.conf
-rw-r--r--. 1 root root 353 Jan 18 11:35 /mnt/sysroot/usr/lib/kernel/install.conf
[anaconda root@localhost ~]# cat /mnt/sysroot/usr/lib/kernel/install.conf
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it under the
#  terms of the GNU Lesser General Public License as published by the Free
#  Software Foundation; either version 2.1 of the License, or (at your option)
#  any later version.
#
# See kernel-install(8) for details.

#layout=bls|other|...
[anaconda root@localhost ~]# ls -la /mnt/sysroot/etc/
Display all 188 possibilities? (y or n)
[anaconda root@localhost ~]# ls -la /mnt/sysroot/etc/kernel
total 12
drwxr-xr-x.  3 root root   23 Mar  1 10:03 .
drwxr-xr-x. 95 root root 8192 Mar  1 10:24 ..
drwxr-xr-x.  2 root root    6 Feb  8 16:01 install.d
[anaconda root@localhost ~]# ls -la /mnt/sysroot/etc/kernel/install.d/
total 0
drwxr-xr-x. 2 root root  6 Feb  8 16:01 .
drwxr-xr-x. 3 root root 23 Mar  1 10:03 ..
[anaconda root@localhost ~]#

It also seems that grub2-probe fails to pick up correct kernel options for the root filesystem. 

Package versions:
anaconda-34.25.0.27-1.el9.x86_64.rpm
grub2-tools-minimal-2.06-24.el9.x86_64.rpm

The last time this worked in our CI was with snapshots of 20220208, which had the following versions:
anaconda-34.25.0.25-1.el9.x86_64.rpm
grub2-common-2.06-16.el9.noarch


journal of the boot loader installation:
Mar 01 10:22:27 localhost.localdomain anaconda[1849]: anaconda: installation: Task started: Install bootloader (10/17)
Mar 01 10:22:27 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: DEBUG:dasbus.connection:Publishing an object at /org/fedoraproject/Anaconda/Modules/Storage/Task/7.
Mar 01 10:22:27 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: DEBUG:dasbus.connection:Publishing an object at /org/fedoraproject/Anaconda/Modules/Storage/Task/8.
Mar 01 10:22:27 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: DEBUG:dasbus.connection:Publishing an object at /org/fedoraproject/Anaconda/Modules/Storage/Task/9.
Mar 01 10:22:27 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: DEBUG:dasbus.connection:Publishing an object at /org/fedoraproject/Anaconda/Modules/Storage/Task/10.
Mar 01 10:22:27 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:anaconda.threading:Running Thread: AnaTaskThread-CreateRescueImagesTask-1 (140183544038976)
Mar 01 10:22:27 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:anaconda.modules.storage.bootloader.utils:Generating a new machine id.
Mar 01 10:22:27 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:program:Running in chroot '/mnt/sysroot'... systemd-machine-id-setup
Mar 01 10:22:27 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:program:Initializing machine ID from random generator.
Mar 01 10:22:27 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: DEBUG:program:Return code: 0
Mar 01 10:22:27 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: DEBUG:anaconda.modules.storage.bootloader.utils:new-kernel-pkg does not exist, calling scripts directly.
Mar 01 10:22:27 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:anaconda.modules.storage.bootloader.utils:Generating rescue image for 5.14.0-69.el9.x86_64.
Mar 01 10:22:27 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:anaconda.threading:Thread Done: AnaTaskThread-CreateRescueImagesTask-1 (140183544038976)
Mar 01 10:22:28 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:anaconda.threading:Running Thread: AnaTaskThread-ConfigureBootloaderTask-1 (140183544038976)
Mar 01 10:22:28 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: DEBUG:anaconda.modules.storage.bootloader.utils:Configuring the boot loader.
Mar 01 10:22:28 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: DEBUG:anaconda.modules.storage.bootloader.utils:Collecting the OS images for: 5.14.0-69.el9.x86_64
Mar 01 10:22:28 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: DEBUG:anaconda.modules.storage.bootloader.base:new default image: <pyanaconda.modules.storage.bootloader.image.LinuxBootLoaderImage object at 0x7f7f05a664f0>
Mar 01 10:22:28 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: DEBUG:anaconda.modules.storage.bootloader.utils:Writing to /etc/sysconfig/kernel.
Mar 01 10:22:28 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:anaconda.threading:Thread Done: AnaTaskThread-ConfigureBootloaderTask-1 (140183544038976)
Mar 01 10:22:28 localhost.localdomain systemd[1]: systemd-hostnamed.service: Deactivated successfully.
Mar 01 10:22:29 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:anaconda.threading:Running Thread: AnaTaskThread-InstallBootloaderTask-1 (140183544038976)
Mar 01 10:22:29 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: DEBUG:anaconda.modules.storage.bootloader.utils:Installing the boot loader.
Mar 01 10:22:29 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:anaconda.modules.storage.bootloader.utils:boot loader stage1 target device is sda
Mar 01 10:22:29 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:anaconda.modules.storage.bootloader.utils:boot loader stage2 target device is sda1
Mar 01 10:22:29 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:program:Running... xfs_freeze -f /boot
Mar 01 10:22:29 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: DEBUG:program:Return code: 0
Mar 01 10:22:29 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:program:Running... xfs_freeze -u /boot
Mar 01 10:22:29 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: DEBUG:program:Return code: 0
Mar 01 10:22:29 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:anaconda.modules.storage.bootloader.grub2:bootloader.py: mbr will be updated for grub2
Mar 01 10:22:29 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:program:Running in chroot '/mnt/sysroot'... grub2-install --no-floppy /dev/sda
Mar 01 10:22:30 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:program:Installing for i386-pc platform.
Mar 01 10:22:30 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:program:Installation finished. No error reported.
Mar 01 10:22:30 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: DEBUG:program:Return code: 0
Mar 01 10:22:30 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:program:Running... xfs_freeze -f /boot
Mar 01 10:22:30 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: DEBUG:program:Return code: 0
Mar 01 10:22:30 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:program:Running... xfs_freeze -u /boot
Mar 01 10:22:30 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: DEBUG:program:Return code: 0
Mar 01 10:22:30 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:anaconda.modules.storage.bootloader.grub2:bootloader.py: used boot args: crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap
Mar 01 10:22:30 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:program:Running in chroot '/mnt/sysroot'... grub2-set-default 7f5eb91df3fb4830a2e4565e04df0543-5.14.0-69.el9.x86_64
Mar 01 10:22:30 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: DEBUG:program:Return code: 0
Mar 01 10:22:30 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:program:Running in chroot '/mnt/sysroot'... grub2-mkconfig -o /boot/grub2/grub.cfg
Mar 01 10:22:32 localhost.localdomain root[2867]: os-prober: debug: running /usr/libexec/os-probes/mounted/05efi on mounted /dev/sda1
Mar 01 10:22:32 localhost.localdomain root[2867]: 05efi: debug: Not on UEFI platform
Mar 01 10:22:32 localhost.localdomain root[2867]: os-prober: debug: running /usr/libexec/os-probes/mounted/10freedos on mounted /dev/sda1
Mar 01 10:22:32 localhost.localdomain root[2867]: 10freedos: debug: /dev/sda1 is not a FAT partition: exiting
Mar 01 10:22:32 localhost.localdomain root[2867]: os-prober: debug: running /usr/libexec/os-probes/mounted/10qnx on mounted /dev/sda1
Mar 01 10:22:32 localhost.localdomain root[2867]: 10qnx: debug: /dev/sda1 is not a QNX4 partition: exiting
Mar 01 10:22:32 localhost.localdomain root[2867]: os-prober: debug: running /usr/libexec/os-probes/mounted/20macosx on mounted /dev/sda1
Mar 01 10:22:32 localhost.localdomain macosx-prober[2911]: debug: /dev/sda1 is not an HFS+ partition: exiting
Mar 01 10:22:32 localhost.localdomain root[2867]: os-prober: debug: running /usr/libexec/os-probes/mounted/20microsoft on mounted /dev/sda1
Mar 01 10:22:32 localhost.localdomain root[2867]: 20microsoft: debug: /dev/sda1 is not a MS partition: exiting
Mar 01 10:22:32 localhost.localdomain root[2867]: os-prober: debug: running /usr/libexec/os-probes/mounted/30utility on mounted /dev/sda1
Mar 01 10:22:32 localhost.localdomain root[2867]: 30utility: debug: /dev/sda1 is not a FAT partition: exiting
Mar 01 10:22:32 localhost.localdomain root[2867]: os-prober: debug: running /usr/libexec/os-probes/mounted/40lsb on mounted /dev/sda1
Mar 01 10:22:32 localhost.localdomain root[2867]: os-prober: debug: running /usr/libexec/os-probes/mounted/70hurd on mounted /dev/sda1
Mar 01 10:22:32 localhost.localdomain root[2867]: os-prober: debug: running /usr/libexec/os-probes/mounted/80minix on mounted /dev/sda1
Mar 01 10:22:32 localhost.localdomain root[2867]: os-prober: debug: running /usr/libexec/os-probes/mounted/83haiku on mounted /dev/sda1
Mar 01 10:22:32 localhost.localdomain root[2867]: 83haiku: debug: /dev/sda1 is not a BeFS partition: exiting
Mar 01 10:22:32 localhost.localdomain root[2867]: os-prober: debug: running /usr/libexec/os-probes/mounted/90linux-distro on mounted /dev/sda1
Mar 01 10:22:32 localhost.localdomain root[2867]: os-prober: debug: running /usr/libexec/os-probes/mounted/90solaris on mounted /dev/sda1
Mar 01 10:22:32 localhost.localdomain root[2867]: os-prober: debug: running /usr/libexec/os-probes/50mounted-tests on /dev/sda2
Mar 01 10:22:32 localhost.localdomain root[2867]: 50mounted-tests: debug: /dev/sda2 is an LVM member; skipping
Mar 01 10:22:32 localhost.localdomain root[2867]: os-prober: debug: /dev/mapper/rhel-swap: is active swap
Mar 01 10:22:32 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:program:Generating grub configuration file ...
Mar 01 10:22:32 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:program:Adding boot menu entry for UEFI Firmware Settings ...
Mar 01 10:22:32 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:program:done
Mar 01 10:22:32 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: DEBUG:program:Return code: 0
Mar 01 10:22:33 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:program:Running... xfs_freeze -f /boot
Mar 01 10:22:33 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: DEBUG:program:Return code: 0
Mar 01 10:22:33 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:program:Running... xfs_freeze -u /boot
Mar 01 10:22:33 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: DEBUG:program:Return code: 0
Mar 01 10:22:33 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:anaconda.threading:Thread Done: AnaTaskThread-InstallBootloaderTask-1 (140183544038976)
Mar 01 10:22:33 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:anaconda.threading:Running Thread: AnaTaskThread-CreateBLSEntriesTask-1 (140183544038976)
Mar 01 10:22:33 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:anaconda.modules.storage.bootloader.utils:Regenerating BLS info for 5.14.0-69.el9.x86_64
Mar 01 10:22:33 localhost.localdomain org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:program:Running in chroot '/mnt/sysroot'... kernel-install add 5.14.0-69.el9.x86_64 /lib/modules/5.14.0-69.el9.x86_64/vmlinuz
[...] dracut [...]

Additional info:
[anaconda root@localhost ~]# cat /mnt/sysroot/etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap"
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG=true

Comment 1 Jiri Konecny 2022-03-01 11:29:23 UTC
Hello Christian, thanks a lot for this great investigation.

Not sure if this is something Anaconda should solve or it's about the bootloader tools to be solved? Anyway, switching on grub to decide, feel free to return it back in case Anaconda should handle this. Could bootloader team please take a look on this?.

Comment 7 Javier Martinez Canillas 2022-03-04 12:24:53 UTC
Hello Jiri,

(In reply to Jiri Konecny from comment #1)
> Hello Christian, thanks a lot for this great investigation.
> 
> Not sure if this is something Anaconda should solve or it's about the
> bootloader tools to be solved? Anyway, switching on grub to decide, feel
> free to return it back in case Anaconda should handle this. Could bootloader
> team please take a look on this?.

I believe the solution should be twofold, Anaconda should create a /etc/kernel/cmdline
file as mentioned by Christian, since that should be done at installation time.

Then grubby should also update that file (and probably grub2-mkconfig create as well?)
to allow new kernel installs to create BLS snippets that contain the latest params.

Comment 8 Javier Martinez Canillas 2022-03-04 12:27:01 UTC
Actually, after writing the previous comment I realized that Jiri may be correct
and that /etc/kernel/cmdline could just be created by grub2-mkconfig. Since IIRC
Anaconda already runs this during the bootloader configuration phase.

There is no need to duplicate the same logic in the Anaconda bootloader support.

Comment 9 Christian Kellner 2022-03-10 09:47:45 UTC
I tried to understand why this works on Fedora 35 and not RHEL 9 and I think my current hypothesis why it is failing in the bug case:

In either case "20-grub.install" is useless since it uses "/proc/cmdline" (installer kernel command line) because there is no "/etc/kernel/cmdline".

But this is "fixed" via:
  org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:program:Running in chroot '/mnt/sysroot'... grub2-mkconfig -o /boot/grub2/grub.cfg
which calls
  update_bls_cmdline() via "/etc/grub.d/10_linux"
which in turn uses
  local cmdline="root=${LINUX_ROOT_DEVICE} ro ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
and "GRUB_CMDLINE_LINUX" is set by anaconda.

BUT then later in the log we find:
  org.fedoraproject.Anaconda.Modules.Storage[1902]: INFO:program:Running in chroot '/mnt/sysroot'... kernel-install add 5.14.0-69.el9.x86_64 /lib/modules/5.14.0-69.el9.x86_64/vmlinuz
which again calls
  20-grub.install which will use "/proc/cmdline" overwriting the good configuration again.

I don't think that happens on the Fedora case, although Fedora was a different payload so this might also be payload specific.

Comment 13 Christian Kellner 2022-03-10 19:55:31 UTC
We (Achilleas and I) did some more digging and in a bad installer version grub2-mkconfig does not properly update the BLS snippet, because `get_sorted_bls` in `10_linux` returns an empty list. This seems to be due to the fact that `/mnt/sysroot/boot/loader/entries/` has the actual entry with a "wrong" prefix, i.e. "ffffffffffffffffffffffffffffffff-5.14.0-70.el9.x86_64.conf" instead of "${machine_id}-5.14.0-70.el9.x86_64.conf" (like in the "good" image). The initial BLS snippets, if I read anaconda code correctly, are created via 20-grub.install, via kernel-install add called from anaconda `create_bls_entries` in `anaconda/pyanaconda/modules/storage/bootloader/utils.py`.
Now the price question is what did change so that the boot loader entries are created with `ffff..` prefix and not the machine-id. We tried to hunt down code changes in anaconda. Maybe https://github.com/rhinstaller/anaconda/commit/dbac59ad430 but that is from June.

Comment 14 Christian Kellner 2022-03-10 22:47:05 UTC
Digging some more, on the broken installer, manually removing the bls in /boot/loader/entires and then calling 
  kernel-install add 5.14.0-70.el9.x86_64 /lib/modules/5.14.0-70.el9.x86_64/vmlinuz
results in 
  -rw-r--r--. 1 root root 380 Mar 10 17:42 /boot/loader/entries/ffffffffffffffffffffffffffffffff-5.14.0-70.el9.x86_64.conf
with
  options inst.stage2=hd:LABEL=CentOS-Stream-9-BaseOS-x86_64 inst.ks=hd:LABEL=CentOS-Stream-9-BaseOS-x86_64:/osbuild.ks quiet inst.sshd $tuned_params

Comment 15 Christian Kellner 2022-03-10 23:11:39 UTC
kernel-install is part of systemd. The good installer has systemd-249-9.el9.x86_64, the bad one systemd-250-4.el9.x86_64. There has been a change related to machine id in kernel-install: https://github.com/systemd/systemd/commit/357376d0bb525b064f468e0e2af8193b4b90d257 introduced in v250-rc3.
I manually backed this change out and this resulted in the correct behaviour:
-rw-r--r--. 1 root root 380 Mar 10 18:09 fea38a705d7b4b14a842659b7f993cdd-5.14.0-70.el9.x86_64.conf

Comment 16 Christian Kellner 2022-03-10 23:15:59 UTC
Just for the record:

[anaconda root@ibm-p8-kvm-03-guest-02 ~]# cat /etc/machine-info
KERNEL_INSTALL_MACHINE_ID=ffffffffffffffffffffffffffffffff

which due to https://github.com/systemd/systemd/commit/357376d0bb525b064f468e0e2af8193b4b90d257 is now preferred

 # Prefer to use an existing machine ID from /etc/machine-info or /etc/machine-id. If we're using the machine
 # ID /etc/machine-id, try to persist it in /etc/machine-info. If no machine ID is found, try to generate
 # a new machine ID in /etc/machine-info. If that fails, use "Default".

 [ -z "$MACHINE_ID" ] && [ -f /etc/machine-info ] && source /etc/machine-info && MACHINE_ID="$KERNEL_INSTALL_MACHINE_ID"
 [ -z "$MACHINE_ID" ] && [ -f /etc/machine-id ] && read -r MACHINE_ID </etc/machine-id

Comment 17 Christian Kellner 2022-03-10 23:20:35 UTC
I think we are missing this patch https://github.com/rhinstaller/anaconda/commit/35f510934902a63c21c2aea45cf32a543d9e7886

Comment 18 Jiri Konecny 2022-03-11 16:10:42 UTC
Hi Christian, yes it seems that could be the issue.

I will try to test these changes to verify if this is really the issue but it seems to be probable.


However, I would like to know about this from the systemd developers.

Basically, we got that PR is Fedora because Live images (similar to your use-case) were not booting on Fedora. Here is the PR with discussion why is that needed:

https://github.com/rhinstaller/anaconda/pull/3770

However, than I was pinged with another PR coming into systemd which may also change the behavior, there were again some discussion but I must admit that my knowledge in this field is not good enough to decide if it would really require another change from the Anaconda in the future, nor if it goes into RHEL in the future. As I understand it the patch in the Anaconda shouldn't be necessary in a future release?

https://github.com/systemd/systemd/pull/22463#issuecomment-1040585085

Could I please ask systemd for clear verification that backport of the PR above in Anaconda is a correct thing to do and if we should expect another changes required in the Anaconda code in the near future?

Comment 19 Jiri Konecny 2022-03-14 21:32:31 UTC
PR: https://github.com/rhinstaller/anaconda/pull/3957

I did the testing and it seems that backport of PR mentioned in comment 18 with modifications because of compatibility will resolve this issue.

Comment 22 Michal Sekletar 2022-03-16 09:29:18 UTC
(In reply to Jiri Konecny from comment #18)

> 
> Could I please ask systemd for clear verification that backport of the PR
> above in Anaconda is a correct thing to do and if we should expect another
> changes required in the Anaconda code in the near future?

Yes, previous backport was correct thing to do. However, I think that further changes will still be required. AFAICT, right now we will end up in the situation where /etc/machine-id will contain different UUID compared to value of KERNEL_INSTALL_MACHINE_ID (from /etc/machine-info) that is used as a prefix in BLS config file names. This shouldn't cause any obvious failures but is confusing. We will have the discussion with systemd upstream about further steps and we will keep you posted.

Comment 28 Jan Stodola 2022-03-22 09:18:18 UTC
Checked that anaconda-34.25.0.29-1.el9_0 is in nightly compose RHEL-9.0.0-20220322.0

Moving to VERIFIED

Comment 30 errata-xmlrpc 2022-05-17 12:31:03 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (new packages: anaconda), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:2326

Comment 31 Red Hat Bugzilla 2023-09-15 01:52:21 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 365 days