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>
This commit is contained in:
BruceX Wang 2023-10-28 07:04:04 +08:00 committed by mergify[bot]
parent 7e08d17a4a
commit 7ff6ab2b3e
2 changed files with 6 additions and 11 deletions

View File

@ -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()

View File

@ -146,16 +146,6 @@ def BuildUniversalPayload(Args):
ModuleReportPath = os.path.join(BuildDir, "UefiUniversalPayloadEntry.txt")
UpldInfoFile = os.path.join(BuildDir, "UniversalPayloadInfo.bin")
if "CLANG_BIN" in os.environ:
LlvmObjcopyPath = os.path.join(os.environ["CLANG_BIN"], "llvm-objcopy")
else:
LlvmObjcopyPath = "llvm-objcopy"
try:
RunCommand('"%s" --version'%LlvmObjcopyPath)
except:
print("- Failed - Please check if LLVM is installed or if CLANG_BIN is set correctly")
sys.exit(1)
Pcds = ""
if (Args.pcd != None):
for PcdItem in Args.pcd: