util/cbfstool: Check for metadata hash in verstage
commitda5d0251f52356bc2acb4217bbc2030581145af1
authorKarthikeyan Ramasubramanian <kramasub@google.com>
Wed, 21 Sep 2022 05:00:00 +0000 (20 23:00 -0600)
committerRaul Rangel <rrangel@chromium.org>
Wed, 26 Oct 2022 15:59:58 +0000 (26 15:59 +0000)
tree6c9dcca87dc54025dc8e95efc5babfa3f207993a
parentab82a9f9b4826ef6449cc5920c1e6c5b2c262aef
util/cbfstool: Check for metadata hash in verstage

Metadata Hash is usually present inside the first segment of BIOS. On
board where vboot starts in bootblock, it is present in bootblock. On
boards where vboot starts before bootblock, it is present in file
containing verstage. Update cbfstool to check for metadata hash in file
containing verstage besides bootblock.

Add a new CBFS file type for the concerned file and exclude it from CBFS
verification.

BUG=b:227809919
TEST=Build and boot to OS in Skyrim with CBFS verification enabled using
x86 and PSP verstages.

Change-Id: Ib4dfba6a9cdbda0ef367b812f671c90e5f90caf8
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/66942
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
src/commonlib/bsd/include/commonlib/bsd/cbfs_serialized.h
util/cbfstool/cbfs.h
util/cbfstool/cbfstool.c