OvmfPkg/EmuVariableFvbRuntimeDxe: always format an auth varstore header
In this patch, we extend commit
d92eaabefbe0 ("OvmfPkg: simplify
VARIABLE_STORE_HEADER generation", 2016-02-05) to
EmuVariableFvbRuntimeDxe.
This is the difference between FvAndVarTemplate and
FvAndAuthenticatedVarTemplate:
> --- non-auth 2017-05-05 22:32:06.
001512283 +0200
> +++ auth 2017-05-05 22:32:18.
841364882 +0200
> @@ -1,7 +1,7 @@
> //
> - // Templates for standard (non-authenticated) variable FV header
> + // Templates for authenticated variable FV header
> //
> - STATIC FVB_FV_HDR_AND_VARS_TEMPLATE FvAndVarTemplate = {
> + STATIC FVB_FV_HDR_AND_VARS_TEMPLATE FvAndAuthenticatedVarTemplate = {
> { // EFI_FIRMWARE_VOLUME_HEADER FvHdr;
> // UINT8 ZeroVector[16];
> { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
> @@ -34,7 +34,7 @@
> EFI_FVH_REVISION,
>
> // EFI_FV_BLOCK_MAP_ENTRY BlockMap[1];
> - {
> + {
> {
> 2, // UINT32 NumBlocks;
> EMU_FVB_BLOCK_SIZE // UINT32 Length;
> @@ -44,8 +44,8 @@
> // EFI_FV_BLOCK_MAP_ENTRY EndBlockMap;
> { 0, 0 }, // End of block map
> { // VARIABLE_STORE_HEADER VarHdr;
> - // EFI_GUID Signature;
> - EFI_VARIABLE_GUID,
> + // EFI_GUID Signature; // need authenticated variables for secure boot
> + EFI_AUTHENTICATED_VARIABLE_GUID,
>
> // UINT32 Size;
> (
After this change, using "-bios", the variable driver logs:
- with the SB feature enabled:
> Variable driver will work with auth variable format!
> Variable driver will work with auth variable support!
- with the SB feature disabled:
> Variable driver will work with auth variable format!
> Variable driver will continue to work without auth variable support!
Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>