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

ConditionFirstBoot does not work in disk images produced by Image Builder

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • rhel-10.0
    • osbuild-composer
    • None
    • No
    • None
    • rhel-sst-image-builder
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • None

      Systemd units with ConditionFirstBoot=yes are not ever triggered when embedded in an image built by Image Builder.

      The issue is that the rpm stage in osbuild create an empty machine-id (see here and here). However, systemd doesn't consider this setup as a first boot (see the machine-id man page). According to the man page, we should put "uninitialized\n" in the file instead.

      Note that according to the man page, it's also possible not to create the file at all to trigger ConditionFirstBoot correctly. However, I recall reading somewhere that this is not ideal, because if initramfs is mounted RO, systemd cannot bind-mount a generated machine-id in /etc. This might not be issue in RHEL because IIRC we don't mount initramfs RO, but it might be better to be safe rather than sorry.

      I think we should definitely fix this for EL10, but I'm honestly worried about backporting this to EL8 and EL9 because it can start triggering services that weren't being started before.

              thozza@redhat.com Tomas Hozza
              obudai@redhat.com Ondrej Budai
              Osbuilders Bot Account Osbuilders Bot Account
              Release Test Team Release Test Team
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: