diff --git a/src/luks/dracut/clevis-pin-tang/module-setup.sh.in b/src/luks/dracut/clevis-pin-tang/module-setup.sh.in index 364f866f..431ac684 100755 --- a/src/luks/dracut/clevis-pin-tang/module-setup.sh.in +++ b/src/luks/dracut/clevis-pin-tang/module-setup.sh.in @@ -25,9 +25,10 @@ depends() { have_tang_bindings() { . clevis-luks-common-functions - local dev + local dev bindings for dev in $(clevis_devices_to_unlock "list-open-devices"); do - if clevis luks list -d "${dev}" -p | grep -q tang; then + bindings="$(clevis luks list -d "${dev}" -p 2>/dev/null)" || : + if echo "${bindings}" | grep -qw tang; then return 0 fi done @@ -37,6 +38,16 @@ have_tang_bindings() { install() { if [ "${hostonly_cmdline}" = "yes" ] && have_tang_bindings; then echo "rd.neednet=1" > "${initdir}/etc/cmdline.d/99clevis-pin-tang.conf" + + if dracut_module_included "systemd"; then + # shellcheck disable=SC2154 # $systemdsystemunitdir is a dracut variable + mkdir -p "${initdir}/${systemdsystemunitdir}/clevis-luks-askpass.path.d" + cat > "${initdir}/${systemdsystemunitdir}/clevis-luks-askpass.path.d/network-online.conf" <