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:
parent
7e08d17a4a
commit
7ff6ab2b3e
|
@ -10,6 +10,7 @@ from os.path import exists
|
||||||
import libfdt
|
import libfdt
|
||||||
from ctypes import *
|
from ctypes import *
|
||||||
import time
|
import time
|
||||||
|
import os
|
||||||
|
|
||||||
class FIT_IMAGE_INFO_HEADER:
|
class FIT_IMAGE_INFO_HEADER:
|
||||||
"""Class for user setting data to use MakeFitImage()
|
"""Class for user setting data to use MakeFitImage()
|
||||||
|
@ -139,6 +140,8 @@ def BuildFitImage(Fdt, InfoHeader):
|
||||||
ImageNode = libfdt.fdt_add_subnode(Fdt, 0, 'images')
|
ImageNode = libfdt.fdt_add_subnode(Fdt, 0, 'images')
|
||||||
for Item in reversed (MultiImage):
|
for Item in reversed (MultiImage):
|
||||||
Name, Path, BuildFvNode, Description, BinaryData, DataOffset = Item
|
Name, Path, BuildFvNode, Description, BinaryData, DataOffset = Item
|
||||||
|
if os.path.exists (Item[1]) == False:
|
||||||
|
continue
|
||||||
FvNode = libfdt.fdt_add_subnode(Fdt, ImageNode, Name)
|
FvNode = libfdt.fdt_add_subnode(Fdt, ImageNode, Name)
|
||||||
BuildFvNode (Fdt, InfoHeader, FvNode, DataOffset, len(BinaryData), Description)
|
BuildFvNode (Fdt, InfoHeader, FvNode, DataOffset, len(BinaryData), Description)
|
||||||
|
|
||||||
|
@ -149,7 +152,9 @@ def BuildFitImage(Fdt, InfoHeader):
|
||||||
DtbFile.truncate()
|
DtbFile.truncate()
|
||||||
DtbFile.write(Fdt)
|
DtbFile.write(Fdt)
|
||||||
for Item in MultiImage:
|
for Item in MultiImage:
|
||||||
_, _, _, _, BinaryData, _ = Item
|
_, FilePath, _, _, BinaryData, _ = Item
|
||||||
|
if os.path.exists (Item[1]) == False:
|
||||||
|
continue
|
||||||
DtbFile.write(BinaryData)
|
DtbFile.write(BinaryData)
|
||||||
DtbFile.close()
|
DtbFile.close()
|
||||||
|
|
||||||
|
|
|
@ -146,16 +146,6 @@ def BuildUniversalPayload(Args):
|
||||||
ModuleReportPath = os.path.join(BuildDir, "UefiUniversalPayloadEntry.txt")
|
ModuleReportPath = os.path.join(BuildDir, "UefiUniversalPayloadEntry.txt")
|
||||||
UpldInfoFile = os.path.join(BuildDir, "UniversalPayloadInfo.bin")
|
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 = ""
|
Pcds = ""
|
||||||
if (Args.pcd != None):
|
if (Args.pcd != None):
|
||||||
for PcdItem in Args.pcd:
|
for PcdItem in Args.pcd:
|
||||||
|
|
Loading…
Reference in New Issue