Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-59137

[EDGE] Installing an edge-commit via Anaconda "failed to write boot loader configuration"

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • None
    • rhel-9.4
    • anaconda
    • None
    • Yes
    • Important
    • rhel-sst-installer
    • ssg_front_door
    • None
    • False
    • Hide

      None

      Show
      None
    • No
    • Red Hat Enterprise Linux
    • None
    • None
    • None
    • Unspecified Release Note Type - Unknown
    • All
    • None

      What were you trying to do that didn't work?

      After composing a RHEL 9.4 "edge-commit" and installing it with an `ostreesetup` command, the Anaconda installer fails with the following message:

      failed to write boot loader configuration 

      The same RHEL 9.4 edge commit can be installed successfully with a RHEL 9.3 Anaconda installer.

      What is the impact of this issue to you?

      Installation is aborted and cannot be performed.

      Please provide the package NVR for which the bug is seen:

      anaconda-34.25.4.9

      How reproducible is this bug?:

      Always

      Steps to reproduce

      • Install OSbuild Composer, create a very simple blueprint, push it, and "compose start" an "edge-commit" image type.
      • Install an http server, untar and share the resulting "edge-commit".
      • Create a simple kickstart named "edge.ks" to deploy the said edge-commit repo
      ostreesetup --osname="rhel" --remote="edge" --url="http://192.168.122.1/repo/" --ref="rhel/9/x86_64/edge" --nogpg
      • Use a RHEL 9.4 boot ISO and append the following parameter to the cmdline:
      inst.ks=http://192.168.122.1/edge.ks 

      Expected results

      11:23:30,274 INF program: Running in chroot '/mnt/sysroot'... bootupctl backend install --auto --write-uuid --device /dev/vda /
      11:23:30,345 INF program: Installed greenboot.cfg
      11:23:30,346 INF program: Installed: grub.cfg
      11:23:30,346 INF program: Installed: "redhat/grub.cfg"
      11:23:30,346 DBG program: Return code: 0 

      Actual results

      From program.log:

      06:55:09,248 INF program: Running in chroot '/mnt/sysroot'... bootupctl backend install --auto --write-uuid --device /dev/vda /
      06:55:09,258 INF program: error: boot data installation failed: installing component EFI: No update metadata for component EFI found 

      From syslog:

      06:55:09,208 WARNING org.fedoraproject.Anaconda.Modules.Storage:DEBUG:anaconda.modules.storage.bootloader.installation:Will not install regular bootloader for ostree with bootupd 

      Additional notes

      Stracing this `bootupctl` command within the chroot shows an `EFI.json` or a `BIOS.json` are missing:

      11:08:44.558642 openat(3</>, "usr/lib/bootupd/updates/EFI.json", O_RDONLY|O_NOFOLLOW|O_CLOEXEC) = -1 ENOENT (No such file or directory) <0.000037>
      error: boot data installation failed: installing component EFI: No update metadata for component EFI found

      This is due to a recent change in:

      anaconda-34.25.4.9/pyanaconda/modules/payloads/payload/rpm_ostree/installation.py 

      in `_install_bootupd()` which now behaves differently if the `bootupd` package is installed (this is the case in an `edge-commit` image type).

      The patch I suggested to the customer consists in generating the missing {BIOS,EFI}.json metadata files using a dedicated `bootupctl` command.

      --- anaconda-34.25.4.9/pyanaconda/modules/payloads/payload/rpm_ostree/installation.py.orig	2024-09-17 12:38:24.926080554 +0200
      +++ anaconda-34.25.4.9/pyanaconda/modules/payloads/payload/rpm_ostree/installation.py	2024-09-17 13:14:49.640073437 +0200
      @@ -431,6 +431,30 @@
               dev_data = DeviceData.from_structure(device_tree.GetDeviceData(bootloader.Drive))
       
               rc = execWithRedirect(
      +            "mount",
      +            [
      +                "-o",
      +                "remount,rw",
      +                "/usr",
      +            ],
      +            root=self._sysroot
      +        )
      +
      +        rc = execWithRedirect(
      +            "bootupctl",
      +            [
      +                "backend",
      +                "generate-update-metadata",
      +                "/",
      +            ],
      +            root=self._sysroot
      +        )
      +
      +        if rc:
      +            raise BootloaderInstallationError(
      +                "failed to generate bootupd BIOS and EFI metadata")
      +
      +        rc = execWithRedirect(
                   "bootupctl",
                   [
                       "backend", 

      Note that it is not ideal that these files are located in /usr/lib/bootupd.

      As an unsupported workaround, I will attach it as a fixboot.img which can be used with:

      inst.updates=fixboot.img
      

      "Use it at your own risk".

              anaconda-maint-list anaconda-maint-list
              rhn-support-cbesson Christophe Besson
              anaconda-maint-list anaconda-maint-list
              Release Test Team Release Test Team
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: