I'm not sure if I did something very wrong or this is a bug.
I ran:
sudo sdbootutil enroll --method=tpm2 --no-measure-pcr
Then I ran this code:
issue6() {
set -e
# Problem: Aeon should have 'tpm2-measure-pcr=yes' set in /etc/crypttab if using normal encryption mode
# Solution: add tpm2-measure-pcr=yes if tpm2-device=auto is set
if grep '^aeon_root' /etc/crypttab | grep -qF 'tpm2-device=auto'; then
# Default Mode detected, now search for missing config
if ! grep '^aeon_root' /etc/crypttab | grep -qF 'tpm2-measure-pcr=yes'; then
echo 'issue6 detected - tpm2-measure-pcr=yes not set - correcting'
# We find the root device.
rootdev=/dev/$(dmsetup deps -o devname /dev/mapper/aeon_root | cut -d '(' -f2 | cut -d ')' -f1)
# We make a temporary key because when using PCR 15 for the first time a lUKS key is needed.
keyfile=$(mktemp /tmp/aeon-check.XXXXXXXXXX)
# I would use the same method tik uses to create a keyfile but sdbootutil doesn't like it
head -c 1024 /dev/urandom | base64 > "$keyfile"
chmod 400 ${keyfile}
cryptsetup luksAddKey --token-only --batch-mode --new-key-slot=31 ${rootdev} ${keyfile}
sed -i '/^aeon_root/ s/$/,tpm2-measure-pcr=yes/' /etc/crypttab
sdbootutil update-predictions PW=$(< "$keyfile") --measure-pcr
sdbootutil mkinitrd
# Wipe the temporary LUKS key
systemd-cryptenroll --wipe-slot=31 ${rootdev}
rm ${keyfile}
echo 'issue6 corrected'
fi
fi
}
The output of this code was:
+ echo 'issue6 detected - tpm2-measure-pcr=yes not set - correcting'
issue6 detected - tpm2-measure-pcr=yes not set - correcting
++ dmsetup deps -o devname /dev/mapper/aeon_root
++ cut -d '(' -f2
++ cut -d ')' -f1
+ rootdev=/dev/nvme0n1p2
++ mktemp /tmp/aeon-check.XXXXXXXXXX
+ keyfile=/tmp/aeon-check.83ZautLLna
+ head -c 1024 /dev/urandom
+ base64
+ chmod 400 /tmp/aeon-check.83ZautLLna
+ cryptsetup luksAddKey --token-only --batch-mode --new-key-slot=31 /dev/nvme0n1p2 /tmp/aeon-check.83ZautLLna
+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Ol7MmD/XZSqrNW/xoqwxSG4hNw61smhYMfmnvHeziCvqaJcWGAMcMXYSiBkOhDr2i3zK J7a1UtaGN3fSLHq/QCGUdvJYltteXfKRFsiZMOWQXka7jJcPdDFoPZaCwK7h15A514OG/eGYkqz9 w7tQID/Zpw7HPNjSuwEaT0+aGmt5MEVJbqmgNk8PcqaN0wHyOrWacUnzyfBBPM7UsuoB3YHOVTrJ l8ita4uCQAomxD8RvAkJpcO6onG/BkN7WLTUftUtXUafBqmzYcudbV16oS9dP6SOIgeCLJgtpjTh rZGBD3DwCwrXgQ483FHaHZCIpRY2M6qYQVaAtrfyj0Qel7uytC5FWy2z3HYs3uqQWiyBIFdEMw== --measure-pcr
Garbage after device path end, ignoring.
Garbage after device path end, ignoring.
Garbage after device path end, ignoring.
Garbage after device path end, ignoring.
NVIndex policy created
+ sdbootutil mkinitrd
dracut-install: ERROR: installing 'grub2-editenv'
dracut[E]: FAILED: /usr/lib/dracut/dracut-install -D /var/tmp/dracut.dkmhQZh/initramfs -a date btrfs awk grub2-editenv
Garbage after device path end, ignoring.
Garbage after device path end, ignoring.
Garbage after device path end, ignoring.
Garbage after device path end, ignoring.
NVIndex policy created
+ systemd-cryptenroll --wipe-slot=31 /dev/nvme0n1p2
Wiped slot 31.
+ rm /tmp/aeon-check.83ZautLLna
+ echo 'issue6 corrected'
issue6 corrected
+ exec
Everything seems fine so I reboot and I get an error on boot "The validation of PCR 15 failed".
I add "measure-pcr-validator.ignore=yes" into my kernel cmdline, boot, enter the password.
From this point on no matter what I did (update predictions, clear TPM2, re-enroll), I'd always get that error on boot.
I managed to get rid of it by running:
sudo transactional-update dup --continue --non-interactive pkg in --force --recommends patterns-glibc-hwcaps-x86_64_v3
But my system doesn't auto unlock anymore, doesn't matter how much I try re-enrolling.
I'm not sure if I did something very wrong or this is a bug.
I ran:
Then I ran this code:
The output of this code was:
Everything seems fine so I reboot and I get an error on boot "The validation of PCR 15 failed".
I add "measure-pcr-validator.ignore=yes" into my kernel cmdline, boot, enter the password.
From this point on no matter what I did (update predictions, clear TPM2, re-enroll), I'd always get that error on boot.
I managed to get rid of it by running:
But my system doesn't auto unlock anymore, doesn't matter how much I try re-enrolling.