mirror of
https://github.com/linuxboot/heads.git
synced 2024-12-23 23:02:26 +00:00
b500505312
Most logic throughout Heads doesn't need to know TPM1 versus TPM2 (and shouldn't, the differences should be localized). Some checks were incorrect and are fixed by this change. Most checks are now unchanged relative to master. There are not that many places outside of tpmr that need to differentiate TPM1 and TPM2. Some of those are duplicate code that should be consolidated (seal-hotpkey, unseal-totp, unseal-hotp), and some more are probably good candidates for abstracting in tpmr so the business logic doesn't have to know TPM1 vs. TPM2. Previously, CONFIG_TPM could be variously 'y', 'n', or empty. Now it is always 'y' or 'n', and 'y' means "any TPM". Board configs are unchanged, setting CONFIG_TPM2_TOOLS=y implies CONFIG_TPM=y so this doesn't have to be duplicated and can't be mistakenly mismatched. There were a few checks for CONFIG_TPM = n that only coincidentally worked for TPM2 because CONFIG_TPM was empty (not 'n'). This test is now OK, but the checks were also cleaned up to '!= "y"' for robustness. Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
16 lines
258 B
Bash
Executable File
16 lines
258 B
Bash
Executable File
#!/bin/bash
|
|
# Boot a USB installation
|
|
|
|
. /etc/functions
|
|
. /tmp/config
|
|
|
|
TRACE "Under /bin/usb-init"
|
|
|
|
if [ "$CONFIG_TPM" = "y" ]; then
|
|
# Extend PCR4 as soon as possible
|
|
tpmr extend -ix 4 -ic usb
|
|
fi
|
|
|
|
media-scan usb
|
|
recovery "Something failed during USB boot"
|