mirror of
https://github.com/linuxboot/heads.git
synced 2024-12-18 20:47:55 +00:00
common recovery shell functions (issue #161)
This commit is contained in:
parent
d73c92e63f
commit
c5c47c6b1c
30
initrd/etc/functions
Executable file
30
initrd/etc/functions
Executable file
@ -0,0 +1,30 @@
|
||||
#!/bin/sh
|
||||
# Shell functions for most initialization scripts
|
||||
|
||||
die() {
|
||||
echo >&2 "$*";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
warn() {
|
||||
echo >&2 "$*";
|
||||
}
|
||||
|
||||
recovery() {
|
||||
echo >&2 "!!!!! $*"
|
||||
|
||||
# Remove any temporary secret files that might be hanging around
|
||||
# but recreate the directory so that new tools can use it.
|
||||
rm -rf /tmp/secret
|
||||
mkdir -p /tmp/secret
|
||||
tpm extend -ix 4 -ic recovery
|
||||
|
||||
echo >&2 "!!!!! Starting recovery shell"
|
||||
sleep 1
|
||||
exec /bin/ash
|
||||
}
|
||||
|
||||
|
||||
pcrs() {
|
||||
head -7 /sys/class/tpm/tpm0/pcrs
|
||||
}
|
Loading…
Reference in New Issue
Block a user