-> WIP
This commit is contained in:
parent
78d5eafc9a
commit
afcb48110b
@ -5,6 +5,6 @@ Description=Wait for a FIDO2 device to be connected
|
|||||||
Type=oneshot
|
Type=oneshot
|
||||||
Environment=CON_MSG="Please connect your authenicator"
|
Environment=CON_MSG="Please connect your authenicator"
|
||||||
ExecStartPre=/usr/bin/plymouth display-message --text "${CON_MSG}"
|
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}"
|
ExecStopPost=/usr/bin/plymouth hide-message --text "${CON_MSG}"
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
NORMAL_DIR="/run/systemd/system"
|
NORMAL_DIR="/tmp//run/systemd/system"
|
||||||
LUKS_2FA_WANTS="/etc/systemd/system/luks-2fa.target.wants"
|
LUKS_2FA_WANTS="/etc/systemd/system/luks-2fa.target.wants"
|
||||||
|
|
||||||
CRYPTSETUP="/usr/lib/systemd/systemd-cryptsetup"
|
CRYPTSETUP="/usr/lib/systemd/systemd-cryptsetup"
|
||||||
@ -23,7 +23,7 @@ generate_service () {
|
|||||||
printf -- "[Unit]"
|
printf -- "[Unit]"
|
||||||
printf -- "\nDescription=%s" "2fa for luks"
|
printf -- "\nDescription=%s" "2fa for luks"
|
||||||
printf -- "\nBindsTo=%s" "$target_dev"
|
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 -- "\nBefore=%s umount.target luks-2fa.target" "$crypto_target_service"
|
||||||
printf -- "\nConflicts=umount.target"
|
printf -- "\nConflicts=umount.target"
|
||||||
printf -- "\nDefaultDependencies=no"
|
printf -- "\nDefaultDependencies=no"
|
||||||
@ -50,7 +50,7 @@ generate_service () {
|
|||||||
printf -- "\nConditionPathExists=!/dev/mapper/luks-%s" "$target_uuid"
|
printf -- "\nConditionPathExists=!/dev/mapper/luks-%s" "$target_uuid"
|
||||||
} > "${sd_dir}/${crypto_target_service}.d/drop-in.conf"
|
} > "${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 () {
|
parse_cmdline () {
|
||||||
@ -81,4 +81,5 @@ generate_from_cmdline () {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
generate_from_cmdline
|
#generate_from_cmdline
|
||||||
|
generate_service CRED UUID $timeout
|
||||||
|
Loading…
x
Reference in New Issue
Block a user