This commit is contained in:
shimunn 2019-09-21 01:01:29 +02:00
parent 78d5eafc9a
commit afcb48110b
Signed by: shimun
GPG Key ID: E81D8382DC2F971B
2 changed files with 6 additions and 5 deletions

View File

@ -5,6 +5,6 @@ Description=Wait for a FIDO2 device to be connected
Type=oneshot
Environment=CON_MSG="Please connect your authenicator"
ExecStartPre=/usr/bin/plymouth display-message --text "${CON_MSG}"
ExecStart=/bin/bash -c 'while ! fido2luks connected; do sleep 1; done'
ExecStart=/bin/bash -c 'while ! /usr/bin/fido2luks connected; do /usr/bin/sleep 1; done'
ExecStopPost=/usr/bin/plymouth hide-message --text "${CON_MSG}"

View File

@ -1,6 +1,6 @@
#!/bin/bash
NORMAL_DIR="/run/systemd/system"
NORMAL_DIR="/tmp//run/systemd/system"
LUKS_2FA_WANTS="/etc/systemd/system/luks-2fa.target.wants"
CRYPTSETUP="/usr/lib/systemd/systemd-cryptsetup"
@ -23,7 +23,7 @@ generate_service () {
printf -- "[Unit]"
printf -- "\nDescription=%s" "2fa for luks"
printf -- "\nBindsTo=%s" "$target_dev"
printf -- "\nAfter=%s cryptsetup-pre.target fido2-connected.service systemd-journald.socket" "$target_dev" #TODO: create service to wait or authenicator
printf -- "\nAfter=%s cryptsetup-pre.target systemd-journald.socket" "$target_dev" #TODO: create service to wait or authenicator
printf -- "\nBefore=%s umount.target luks-2fa.target" "$crypto_target_service"
printf -- "\nConflicts=umount.target"
printf -- "\nDefaultDependencies=no"
@ -50,7 +50,7 @@ generate_service () {
printf -- "\nConditionPathExists=!/dev/mapper/luks-%s" "$target_uuid"
} > "${sd_dir}/${crypto_target_service}.d/drop-in.conf"
ln -sf "$sd_service" "${LUKS_2FA_WANTS}/"
# ln -sf "$sd_service" "${LUKS_2FA_WANTS}/"
}
parse_cmdline () {
@ -81,4 +81,5 @@ generate_from_cmdline () {
done
}
generate_from_cmdline
#generate_from_cmdline
generate_service CRED UUID $timeout