mirror of
https://github.com/linuxboot/heads.git
synced 2024-12-18 20:47:55 +00:00
wget and measure files into the PCR
This commit is contained in:
parent
b0d2d4b5ba
commit
c3757650fd
22
initrd/bin/wget-measure.sh
Executable file
22
initrd/bin/wget-measure.sh
Executable file
@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
# get a file and extend a TPM PCR
|
||||
|
||||
die() {
|
||||
echo >&2 "$@"
|
||||
exit 1
|
||||
}
|
||||
|
||||
INDEX="$1"
|
||||
URL="$2"
|
||||
|
||||
if [ -z "$INDEX" -o -z "$URL" ]; then
|
||||
die "Usage: $0 pcr-index url"
|
||||
fi
|
||||
|
||||
|
||||
wget "$URL" || die "$URL: failed"
|
||||
|
||||
FILE="`basename "$URL"`"
|
||||
tpm extend -ix "$INDEX" -if "$FILE" || die "$FILE: tpm extend failed"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user