Skip to content

Commit

Permalink
utility_functions: Force GetHostInfo() to return MacOs (#257)
Browse files Browse the repository at this point in the history
platform.uname() returns Darwin instead of MacOs due to backwards compatibility. Force GetHostInfo() to return MacOs rather than Darwin as darwin is the kernal, not the OS.
  • Loading branch information
Javagedes authored Feb 6, 2023
1 parent e1645a4 commit abce13c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions edk2toollib/utility_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ def GetHostInfo():
arch = None
bit = None

# For backwards compatibility, platform.uname() returns Darwin for macs, which is the kernal rather then the OS.
# Due to this, we manually fix it.
if os == "Darwin":
os = "MacOs"

if ("x86" in processor_info.lower()) or ("AMD" in processor_info.upper()) or ("INTEL" in processor_info.upper()):
arch = "x86"
elif ("ARM" in processor_info.upper()) or ("AARCH" in processor_info.upper()):
Expand Down

0 comments on commit abce13c

Please sign in to comment.