From cfefdde5efeb326f672a4c5e1aceebde935b41f6 Mon Sep 17 00:00:00 2001 From: Sergio Correia Date: Tue, 16 Jan 2024 16:03:19 +0000 Subject: [PATCH] luks: move dracut out of systemd directory Prepare to decouple dracut and systemd unlockers. --- src/luks/{systemd => }/dracut/clevis-pin-null/meson.build | 0 .../dracut/clevis-pin-null/module-setup.sh.in | 0 src/luks/{systemd => }/dracut/clevis-pin-sss/meson.build | 0 .../{systemd => }/dracut/clevis-pin-sss/module-setup.sh.in | 0 src/luks/{systemd => }/dracut/clevis-pin-tang/meson.build | 0 .../dracut/clevis-pin-tang/module-setup.sh.in | 0 src/luks/{systemd => }/dracut/clevis-pin-tpm2/meson.build | 0 .../dracut/clevis-pin-tpm2/module-setup.sh.in | 0 src/luks/{systemd => }/dracut/clevis/clevis-hook.sh.in | 0 src/luks/{systemd => }/dracut/clevis/meson.build | 0 src/luks/{systemd => }/dracut/clevis/module-setup.sh.in | 7 ++++--- src/luks/{systemd => }/dracut/meson.build | 0 src/luks/meson.build | 3 +++ src/luks/systemd/meson.build | 1 - 14 files changed, 7 insertions(+), 4 deletions(-) rename src/luks/{systemd => }/dracut/clevis-pin-null/meson.build (100%) rename src/luks/{systemd => }/dracut/clevis-pin-null/module-setup.sh.in (100%) rename src/luks/{systemd => }/dracut/clevis-pin-sss/meson.build (100%) rename src/luks/{systemd => }/dracut/clevis-pin-sss/module-setup.sh.in (100%) rename src/luks/{systemd => }/dracut/clevis-pin-tang/meson.build (100%) rename src/luks/{systemd => }/dracut/clevis-pin-tang/module-setup.sh.in (100%) rename src/luks/{systemd => }/dracut/clevis-pin-tpm2/meson.build (100%) rename src/luks/{systemd => }/dracut/clevis-pin-tpm2/module-setup.sh.in (100%) rename src/luks/{systemd => }/dracut/clevis/clevis-hook.sh.in (100%) rename src/luks/{systemd => }/dracut/clevis/meson.build (100%) rename src/luks/{systemd => }/dracut/clevis/module-setup.sh.in (91%) rename src/luks/{systemd => }/dracut/meson.build (100%) diff --git a/src/luks/systemd/dracut/clevis-pin-null/meson.build b/src/luks/dracut/clevis-pin-null/meson.build similarity index 100% rename from src/luks/systemd/dracut/clevis-pin-null/meson.build rename to src/luks/dracut/clevis-pin-null/meson.build diff --git a/src/luks/systemd/dracut/clevis-pin-null/module-setup.sh.in b/src/luks/dracut/clevis-pin-null/module-setup.sh.in similarity index 100% rename from src/luks/systemd/dracut/clevis-pin-null/module-setup.sh.in rename to src/luks/dracut/clevis-pin-null/module-setup.sh.in diff --git a/src/luks/systemd/dracut/clevis-pin-sss/meson.build b/src/luks/dracut/clevis-pin-sss/meson.build similarity index 100% rename from src/luks/systemd/dracut/clevis-pin-sss/meson.build rename to src/luks/dracut/clevis-pin-sss/meson.build diff --git a/src/luks/systemd/dracut/clevis-pin-sss/module-setup.sh.in b/src/luks/dracut/clevis-pin-sss/module-setup.sh.in similarity index 100% rename from src/luks/systemd/dracut/clevis-pin-sss/module-setup.sh.in rename to src/luks/dracut/clevis-pin-sss/module-setup.sh.in diff --git a/src/luks/systemd/dracut/clevis-pin-tang/meson.build b/src/luks/dracut/clevis-pin-tang/meson.build similarity index 100% rename from src/luks/systemd/dracut/clevis-pin-tang/meson.build rename to src/luks/dracut/clevis-pin-tang/meson.build diff --git a/src/luks/systemd/dracut/clevis-pin-tang/module-setup.sh.in b/src/luks/dracut/clevis-pin-tang/module-setup.sh.in similarity index 100% rename from src/luks/systemd/dracut/clevis-pin-tang/module-setup.sh.in rename to src/luks/dracut/clevis-pin-tang/module-setup.sh.in diff --git a/src/luks/systemd/dracut/clevis-pin-tpm2/meson.build b/src/luks/dracut/clevis-pin-tpm2/meson.build similarity index 100% rename from src/luks/systemd/dracut/clevis-pin-tpm2/meson.build rename to src/luks/dracut/clevis-pin-tpm2/meson.build diff --git a/src/luks/systemd/dracut/clevis-pin-tpm2/module-setup.sh.in b/src/luks/dracut/clevis-pin-tpm2/module-setup.sh.in similarity index 100% rename from src/luks/systemd/dracut/clevis-pin-tpm2/module-setup.sh.in rename to src/luks/dracut/clevis-pin-tpm2/module-setup.sh.in diff --git a/src/luks/systemd/dracut/clevis/clevis-hook.sh.in b/src/luks/dracut/clevis/clevis-hook.sh.in similarity index 100% rename from src/luks/systemd/dracut/clevis/clevis-hook.sh.in rename to src/luks/dracut/clevis/clevis-hook.sh.in diff --git a/src/luks/systemd/dracut/clevis/meson.build b/src/luks/dracut/clevis/meson.build similarity index 100% rename from src/luks/systemd/dracut/clevis/meson.build rename to src/luks/dracut/clevis/meson.build diff --git a/src/luks/systemd/dracut/clevis/module-setup.sh.in b/src/luks/dracut/clevis/module-setup.sh.in similarity index 91% rename from src/luks/systemd/dracut/clevis/module-setup.sh.in rename to src/luks/dracut/clevis/module-setup.sh.in index bfe657c1..b69e534a 100755 --- a/src/luks/systemd/dracut/clevis/module-setup.sh.in +++ b/src/luks/dracut/clevis/module-setup.sh.in @@ -27,7 +27,10 @@ install() { if dracut_module_included "systemd"; then inst_multiple \ $systemdsystemunitdir/clevis-luks-askpass.service \ - $systemdsystemunitdir/clevis-luks-askpass.path + $systemdsystemunitdir/clevis-luks-askpass.path \ + @SYSTEMD_REPLY_PASS@ \ + @libexecdir@/clevis-luks-askpass + systemctl -q --root "$initdir" add-wants cryptsetup.target clevis-luks-askpass.path else inst_hook initqueue/online 60 "$moddir/clevis-hook.sh" @@ -36,8 +39,6 @@ install() { inst_multiple \ /etc/services \ - @SYSTEMD_REPLY_PASS@ \ - @libexecdir@/clevis-luks-askpass \ clevis-luks-common-functions \ grep sed cut \ clevis-decrypt \ diff --git a/src/luks/systemd/dracut/meson.build b/src/luks/dracut/meson.build similarity index 100% rename from src/luks/systemd/dracut/meson.build rename to src/luks/dracut/meson.build diff --git a/src/luks/meson.build b/src/luks/meson.build index e06fa125..8a8394e0 100644 --- a/src/luks/meson.build +++ b/src/luks/meson.build @@ -34,6 +34,9 @@ clevis_luks_unbind = configure_file(input: 'clevis-luks-unbind.in', if libcryptsetup.found() and luksmeta.found() subdir('systemd') + # systemd should come before dracut in order to set up + # variables like SYSTEMD_REPLY_PASS. + subdir('dracut') subdir('udisks2') bins += clevis_luks_unbind diff --git a/src/luks/systemd/meson.build b/src/luks/systemd/meson.build index e3b3d918..b10494e3 100644 --- a/src/luks/systemd/meson.build +++ b/src/luks/systemd/meson.build @@ -10,7 +10,6 @@ sd_reply_pass = find_program( if systemd.found() and sd_reply_pass.found() data.set('SYSTEMD_REPLY_PASS', sd_reply_pass.path()) - subdir('dracut') unitdir = systemd.get_pkgconfig_variable('systemdsystemunitdir')