Skip to content

Commit 7ff6ab2

Browse files
IntelBrucexWangmergify[bot]
authored andcommitted
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 <[email protected]> Cc: Sean Rhodes <[email protected]> Cc: James Lu <[email protected]> Cc: Gua Guo <[email protected]> Signed-off-by: BruceX Wang <[email protected]> Reviewed-by: Gua Guo <[email protected]>
1 parent 7e08d17 commit 7ff6ab2

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

UefiPayloadPkg/Tools/MkFitImage.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import libfdt
1111
from ctypes import *
1212
import time
13+
import os
1314

1415
class FIT_IMAGE_INFO_HEADER:
1516
"""Class for user setting data to use MakeFitImage()
@@ -139,6 +140,8 @@ def BuildFitImage(Fdt, InfoHeader):
139140
ImageNode = libfdt.fdt_add_subnode(Fdt, 0, 'images')
140141
for Item in reversed (MultiImage):
141142
Name, Path, BuildFvNode, Description, BinaryData, DataOffset = Item
143+
if os.path.exists (Item[1]) == False:
144+
continue
142145
FvNode = libfdt.fdt_add_subnode(Fdt, ImageNode, Name)
143146
BuildFvNode (Fdt, InfoHeader, FvNode, DataOffset, len(BinaryData), Description)
144147

@@ -149,7 +152,9 @@ def BuildFitImage(Fdt, InfoHeader):
149152
DtbFile.truncate()
150153
DtbFile.write(Fdt)
151154
for Item in MultiImage:
152-
_, _, _, _, BinaryData, _ = Item
155+
_, FilePath, _, _, BinaryData, _ = Item
156+
if os.path.exists (Item[1]) == False:
157+
continue
153158
DtbFile.write(BinaryData)
154159
DtbFile.close()
155160

UefiPayloadPkg/UniversalPayloadBuild.py

-10
Original file line numberDiff line numberDiff line change
@@ -146,16 +146,6 @@ def BuildUniversalPayload(Args):
146146
ModuleReportPath = os.path.join(BuildDir, "UefiUniversalPayloadEntry.txt")
147147
UpldInfoFile = os.path.join(BuildDir, "UniversalPayloadInfo.bin")
148148

149-
if "CLANG_BIN" in os.environ:
150-
LlvmObjcopyPath = os.path.join(os.environ["CLANG_BIN"], "llvm-objcopy")
151-
else:
152-
LlvmObjcopyPath = "llvm-objcopy"
153-
try:
154-
RunCommand('"%s" --version'%LlvmObjcopyPath)
155-
except:
156-
print("- Failed - Please check if LLVM is installed or if CLANG_BIN is set correctly")
157-
sys.exit(1)
158-
159149
Pcds = ""
160150
if (Args.pcd != None):
161151
for PcdItem in Args.pcd:

0 commit comments

Comments
 (0)