Skip to content

Commit

Permalink
dracut: fix running with pre-v103 Dracut
Browse files Browse the repository at this point in the history
Signed-off-by: Oldřich Jedlička <[email protected]>
  • Loading branch information
oldium committed Nov 9, 2024
1 parent 4ba3f79 commit d049272
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/luks/dracut/clevis/module-setup.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@
depends() {
local __depends=crypt
if dracut_module_included "systemd"; then
__depends=$(printf '%s systemd-cryptsetup' "${__depends}")
# Dracut v103 introduced a separate systemd-cryptsetup module
systemd_cryptsetup_dir=$(dracut_module_path "systemd-cryptsetup")
if [ -d "$systemd_cryptsetup_dir" ]; then
__depends=$(printf '%s systemd-cryptsetup' "${__depends}")
else
__depends=$(printf '%s systemd' "${__depends}")
fi
fi
echo "${__depends}"
return 255
Expand All @@ -32,7 +38,6 @@ install() {
inst_multiple \
$systemdsystemunitdir/clevis-luks-askpass.service \
$systemdsystemunitdir/clevis-luks-askpass.path \
$systemdsystemunitdir/cryptsetup.target \
@SYSTEMD_REPLY_PASS@ \
@libexecdir@/clevis-luks-askpass

Expand Down

0 comments on commit d049272

Please sign in to comment.