Skip to content

Commit

Permalink
feat: add optional pin for luks tpm2 unlock just command (#297)
Browse files Browse the repository at this point in the history
Co-authored-by: Kyle Gospodnetich <[email protected]>
  • Loading branch information
qoijjj and KyleGospo authored Aug 19, 2024
1 parent d223e9d commit 86be586
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion build/ublue-os-luks/luks-enable-tpm2-autounlock
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ else
exit 1
fi

SET_PIN_ARG=""
read -p "Would you like to set a pin? " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
SET_PIN_ARG=" --tpm2-with-pin=yes "
fi

# Specify Crypt Disk by-uuid
CRYPT_DISK="/dev/disk/by-uuid/$DISK_UUID"

Expand All @@ -63,7 +70,7 @@ fi

## Run crypt enroll
echo "Enrolling TPM2 unlock requires your existing LUKS2 unlock password"
systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs=7 "$CRYPT_DISK"
systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs=7 "$SET_PIN_ARG" "$CRYPT_DISK"


if lsinitrd 2>&1 | grep -q tpm2-tss > /dev/null; then
Expand Down

0 comments on commit 86be586

Please sign in to comment.