Skip to content

Commit

Permalink
kexec-save-default: fix primary handle once more. Can't wait we get r…
Browse files Browse the repository at this point in the history
…id of this... file must exist and not be empty, and hash output to console must not be silenced

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
  • Loading branch information
tlaurion committed Dec 18, 2024
1 parent 6f5f826 commit 1ac5229
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions initrd/bin/kexec-save-default
Original file line number Diff line number Diff line change
Expand Up @@ -277,14 +277,13 @@ if [ ! -d $paramsdir ]; then
fi

if [ "$CONFIG_TPM2_TOOLS" = "y" ]; then
if [ -f /tmp/secret/primary.handle ]; then
if [ -s /tmp/secret/primary.handle ]; then
DEBUG "Hashing TPM2 primary key handle..."
sha256sum /tmp/secret/primary.handle >"$PRIMHASH_FILE" 2>/dev/null ||
sha256sum /tmp/secret/primary.handle > "$PRIMHASH_FILE" ||
die "ERROR: Failed to Hash TPM2 primary key handle!"
DEBUG "TPM2 primary key handle hash saved to $PRIMHASH_FILE"
DEBUG "Hash content: $(cat $PRIMHASH_FILE)"
else
die "ERROR: TPM2 primary key handle file does not exist!"
die "ERROR: TPM2 primary key handle file does not exist or is empty!"
fi
fi

Expand Down

0 comments on commit 1ac5229

Please sign in to comment.