blob: 5a44c5eaec8bc5b9b0d4b2a815cc4f4db3371b4e [file] [log] [blame]
Manish V Badarkheb87f37b2021-11-10 18:53:05 +00001#
2# Copyright (c) 2021, Arm Limited. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6# Expect script for Linux/Buildroot using Measured Boot & fTPM
Manish V Badarkhefc146c42021-11-24 15:34:00 +00007# It is a copy of linux-tpm.exp which doesn't check PCR0,PCR1
8# value, as that doesn't apply to this config
Manish V Badarkheb87f37b2021-11-10 18:53:05 +00009#
10
11# Parse the event log from the debug logs and store the digests
12# so they can be matched later with what the fTPM read.
13expect_string+=('m;Booting Trusted Firmware;Booting BL31;Digest(\s|\w)*:\s(\w{2}\s){16}@: (\w{2}\s){16}@Event(\s|\w)*:\s\w+\s')
14
15# Wait for the login prompt
16expect_string+=("i;buildroot login:")
17
18# Login then load the fTPM driver
19# Note: Do not check sanity of PCR0
20expect_string+=("i;#;;;root")
21expect_string+=("i;;;;ftpm")
22
23# Iterate over the rest of PCRs and check that they all are zeros.
24zero_pcr="(\s00){16}\s+(00\s){16}"
Manish V Badarkhefc146c42021-11-24 15:34:00 +000025for i in $(seq 2 11); do
Manish V Badarkheb87f37b2021-11-10 18:53:05 +000026 expect_string+=("i;#")
27 expect_string+=("i;${zero_pcr};;;pcrread -ha $i")
28done
Chris Kay07756bc2022-11-24 17:21:48 +000029
30expect_string+=("i;#;;;@") # Flush newline after final prompt