Skip to content

Commit

Permalink
UefiPayloadPkg: Fix incorrect code on Fit function.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
IntelBrucexWang authored and mergify[bot] committed Oct 27, 2023
1 parent 7e08d17 commit 7ff6ab2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
7 changes: 6 additions & 1 deletion UefiPayloadPkg/Tools/MkFitImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import libfdt
from ctypes import *
import time
import os

class FIT_IMAGE_INFO_HEADER:
"""Class for user setting data to use MakeFitImage()
Expand Down Expand Up @@ -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)

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

Expand Down
10 changes: 0 additions & 10 deletions UefiPayloadPkg/UniversalPayloadBuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 7ff6ab2

Please sign in to comment.