b35982 98dracut-systemd: don't wait for root device if remote cryptsetup active

1 file Authored by Jonathan Lebon 4 years ago, Committed by Packit Service 4 years ago,
    98dracut-systemd: don't wait for root device if remote cryptsetup active
    
    This is a plain and simple hack around dependency issues between dracut
    and systemd.
    
    When using Tang-pinned LUKS root devices, we want to rely on
    `systemd-cryptsetup@.service` to unlock it. However, that service only
    runs `After=remote-fs-pre.target`, while `dracut-initqueue.service` has
    `Before=remote-fs-pre.target` (which makes sense because we don't want
    to attempt networked root devices before networking is up).
    
    However, the rootfs-generator here wants to make sure that the root
    device exists *before* exiting the initqueue via an initqueue/finished
    "devexists" hook. This will never work though because by design
    `systemd-cryptsetup@.service`, which unlocks the root device, won't run
    until after we exit.
    
    So we have a dependency cycle:
    
        initqueue -> devexists hook -> root device ->
            systemd-cryptsetup@.service -> remote-fs-pre.target -> initqueue
    
    There's no clean way to break this. The root issue is that there's no
    way right now to split sequencing of systemd services across the
    initqueue/online and initqueue/finished events because it's all bundled
    in a single service. (The deeper root issue of course is that we have
    two init systems. :) ).
    
    Here we do a tactical fix: if there's a `systemd-cryptsetup@.service`
    instance, let's assume it's for the root device and skip waiting for it
    to show up if it depends on `remote-fs-pre.target`.
    
    (cherry picked from commit 512c51d2677dd1637cc203e3676fefb50a3d73d0)
    
    Resolves: #1897384
    
    patch_name: 0098.patch
    present_in_specfile: true
    location_in_specfile: 98
    squash_commits: true