Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/luks/dracut/clevis-pin-tang/module-setup.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
cat > "${initdir}/${systemdsystemunitdir}/clevis-luks-askpass.path.d/network-online.conf" <<EOF
[Unit]
After=network-online.target
Wants=network-online.target
EOF
fi
fi

inst_multiple \
Expand Down
Loading