diff --git a/create-luks-tpm.sh b/create-luks-tpm.sh index 34d9e92..a6b015e 100755 --- a/create-luks-tpm.sh +++ b/create-luks-tpm.sh @@ -1,4 +1,4 @@ -#!bin/bash +#!/bin/bash set -e CRYPTFS=/dev/nvme0n1p3 diff --git a/install.sh b/install.sh index 006fc35..76f8496 100755 --- a/install.sh +++ b/install.sh @@ -7,6 +7,8 @@ cp -vf ./update-kernel.sh /usr/sbin || exit 1 cp -vf ./create-luks-tpm.sh /usr/sbin || exit 1 cp -vf ./tpm2-hook.sh /etc/initramfs-tools/hooks/ || exit 2 -sed '/luks/$/,discard,initramfs,keyscript=/usr/sbin/passphrase-from-tpm.sh/' /etc/crypttab +awk -i inplace '/luks/{print $0 ",discard,initramfs,keyscript=/usr/sbin/passphrase-from-tpm.sh"}' /etc/crypttab /usr/sbin/create-luks-tpm.sh +/usr/sbin/update-kernel.sh +echo "Installed successfully! Please reboot and execute update-luks-tpm.sh afterwards" diff --git a/tpm2-hook.sh b/tpm2-hook.sh index 6b9a3b9..264f8b2 100755 --- a/tpm2-hook.sh +++ b/tpm2-hook.sh @@ -3,3 +3,4 @@ if [ "$1" = "prereqs" ]; then exit 0; fi . /usr/share/initramfs-tools/hook-functions copy_exec /usr//bin/tpm2_unseal copy_exec /usr/lib/x86_64-linux-gnu/libtss2-tcti-device.so.0 +copy_exec /usr/sbin/passphrase-from-tpm.sh