diff options
author | BruceX Wang <brucex.wang@intel.com> | 2023-10-28 07:04:04 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-10-27 23:36:15 +0000 |
commit | 7ff6ab2b3e09ee7ec0d698398001295b7867b08c (patch) | |
tree | e1e516af852bdd668eb6a1371bc0f56a038af91e /UefiPayloadPkg/Tools/MkFitImage.py | |
parent | 7e08d17a4a535a7abfa58a0606ca1a0e7f5862ad (diff) | |
download | edk2-7ff6ab2b3e09ee7ec0d698398001295b7867b08c.zip edk2-7ff6ab2b3e09ee7ec0d698398001295b7867b08c.tar.gz edk2-7ff6ab2b3e09ee7ec0d698398001295b7867b08c.tar.bz2 |
UefiPayloadPkg: Fix incorrect code on Fit function.
1. Add firmware volume need to check firmware volume exist or not.
2. Remove clang version check dependency.
Cc: Guo Dong <guo.dong@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Cc: Gua Guo <gua.guo@intel.com>
Signed-off-by: BruceX Wang <brucex.wang@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
Diffstat (limited to 'UefiPayloadPkg/Tools/MkFitImage.py')
-rw-r--r-- | UefiPayloadPkg/Tools/MkFitImage.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/UefiPayloadPkg/Tools/MkFitImage.py b/UefiPayloadPkg/Tools/MkFitImage.py index 82ab933..41a2599 100644 --- a/UefiPayloadPkg/Tools/MkFitImage.py +++ b/UefiPayloadPkg/Tools/MkFitImage.py @@ -10,6 +10,7 @@ from os.path import exists import libfdt
from ctypes import *
import time
+import os
class FIT_IMAGE_INFO_HEADER:
"""Class for user setting data to use MakeFitImage()
@@ -139,6 +140,8 @@ def BuildFitImage(Fdt, InfoHeader): ImageNode = libfdt.fdt_add_subnode(Fdt, 0, 'images')
for Item in reversed (MultiImage):
Name, Path, BuildFvNode, Description, BinaryData, DataOffset = Item
+ if os.path.exists (Item[1]) == False:
+ continue
FvNode = libfdt.fdt_add_subnode(Fdt, ImageNode, Name)
BuildFvNode (Fdt, InfoHeader, FvNode, DataOffset, len(BinaryData), Description)
@@ -149,7 +152,9 @@ def BuildFitImage(Fdt, InfoHeader): DtbFile.truncate()
DtbFile.write(Fdt)
for Item in MultiImage:
- _, _, _, _, BinaryData, _ = Item
+ _, FilePath, _, _, BinaryData, _ = Item
+ if os.path.exists (Item[1]) == False:
+ continue
DtbFile.write(BinaryData)
DtbFile.close()
|