dbus-broker fails in dracut's initramfs

Description:

The removal of the dbus.service alias, specific to Archlinux (https://gitlab.archlinux.org/archlinux/packaging/packages/dbus-broker/-/blob/main/0001-units-Enable-statically.patch?ref_type=heads#L22) makes it fail in an initramfs created by dracut.

In Archlinux, instead of using the installation alias, it's manually linked as part of the package (https://gitlab.archlinux.org/archlinux/packaging/packages/dbus-broker/-/blob/main/0001-units-Enable-statically.patch?ref_type=heads#L33)

The issue is that dracut copies the dbus-broker systemd unit files (but NOT the overrides[*]), in an environment used to create the initramfs, and then runs "systemctl enable" in that environment (which would run [Install] and thus Alias in that initramfs environment). As a result: the archlinux's static symlink is not taken into account an there is no dbus.service in the initramfs. This lead to dbus.socket to refuse to start.

Since this bug specific to Archlinux (https://gitlab.archlinux.org/archlinux/packaging/packages/dbus-broker/-/blob/main/0001-units-Enable-statically.patch), I'm reporting it here and not upstream.

dbus is required in the initramfs by the dracut NetworkManager module, which is needed by the clevis module, to decrypt the root filesystem during boot. No dbus => No automatic decryption of the root file system.

[*] My first reflex was to create an override (/etc/systemd/system/dbus-broker.d/override.conf) to re-add the missing alias, but this file is not being copied into the initramfs environment. So this workaround does not work

I'm reporting the bug here in the hope that the dbus-broker Archlinux patch gets removed, maybe ?

Additional info:

  • package version(s): dbus-broker 36-1
  • config and/or log files: can provide on demand
  • link to upstream bug report, if any: [specific to Arch]

Steps to reproduce:

  1. Install an Archlinux with dbus-broker and dracut
  2. Use the dracut command to create an initramfs that requires dbus. The easiest is probably `dracut -m dbus /boot/initramfs-linux.img $(uname -r)
  3. reboot (tip the rd.break boot parameter to jump to a shell inside the initramfs environment to allow looking into the reason for failure)
  4. see the dbus service fail to start