BaseTools: not report error for the optional items in the FmpTokens

<FmpTokens> in the FDF spec defined some optional items, eg: IMAGE_INDEX,
HARDWARE_INSTANCE. but current tool report error if no such item is exist
in the FDF file.

Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=293
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Yonghong Zhu
2017-01-04 10:40:54 +08:00
parent 9fba84ac6e
commit 9ce9bf5339
2 changed files with 11 additions and 10 deletions

View File

@ -1,7 +1,7 @@
## @file
# generate capsule
#
# Copyright (c) 2007-2016, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2007-2017, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@ -186,7 +186,11 @@ class CapsulePayload(CapsuleData):
def GenCapsuleSubItem(self, AuthData=[]):
if not self.Version:
self.Version = 0x00000002
self.Version = '0x00000002'
if not self.ImageIndex:
self.ImageIndex = '0x1'
if not self.HardwareInstance:
self.HardwareInstance = '0x0'
ImageFileSize = os.path.getsize(self.ImageFile)
if AuthData:
# the ImageFileSize need include the full authenticated info size. From first bytes of MonotonicCount to last bytes of certificate.