Skip to content

Commit d078aba

Browse files
committed
Migrate to Project Mu
Signed-off-by: Gustave Monce <[email protected]>
1 parent 0e7e24a commit d078aba

File tree

991 files changed

+137592
-108533
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

991 files changed

+137592
-108533
lines changed

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Handle line endings automatically for files detected as text
2+
# and leave all files detected as binary untouched.
3+
* text=auto
4+
*.sh eol=lf

.github/dependabot.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
## @file
2+
# Dependabot configuration file to enable GitHub services for managing and updating
3+
# dependencies.
4+
#
5+
# This dependabot file is limited to syncing the following type of dependencies. Other files
6+
# are already available in Mu DevOps to sync other dependency types.
7+
# - GitHub Actions (`github-actions`)
8+
# - Git Submodules (`gitsubmodule`)
9+
# - Python PIP Modules (`pip`)
10+
#
11+
# - Mu DevOps Repo: https://github.com/microsoft/mu_devops
12+
# - File Sync Settings: https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml
13+
#
14+
# Copyright (c) Microsoft Corporation.
15+
# SPDX-License-Identifier: BSD-2-Clause-Patent
16+
#
17+
# Please see the documentation for all dependabot configuration options:
18+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
19+
##
20+
21+
version: 2
22+
23+
updates:
24+
- package-ecosystem: "github-actions"
25+
directory: "/"
26+
schedule:
27+
interval: "weekly"
28+
day: "monday"
29+
commit-message:
30+
prefix: "GitHub Action"
31+
labels:
32+
- "type:dependencies"
33+
34+
- package-ecosystem: "gitsubmodule"
35+
directory: "/"
36+
schedule:
37+
interval: "daily"
38+
labels:
39+
- "type:submodules"
40+
- "type:dependencies"
41+
42+
- package-ecosystem: "pip"
43+
directory: "/"
44+
schedule:
45+
interval: "daily"
46+
commit-message:
47+
prefix: "pip"
48+
labels:
49+
- "language:python"
50+
- "type:dependencies"

.gitignore

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
11
# Dynamic Generated
2-
Driver/SmBiosTableDxe/ReleaseInfo.h
3-
Application/BdsMenuApp/ReleaseInfo.h
4-
Include/Resources/ReleaseInfo.h
2+
Platforms/Lumia950Pkg/Include/Resources/ReleaseInfo.h
3+
Platforms/Lumia950XLPkg/Include/Resources/ReleaseInfo.h
54

65
# Local
76
.DS_Store
87
.vs
98
.vscode
109

11-
# Variable Services: Defer
12-
Driver/BlockRamVariableDxe
13-
Driver/FaultTolerantWriteDxe
14-
Driver/VariableRuntimeDxe
15-
Library/BlockRamVariableLib
16-
17-
# USB: Defer
18-
Driver/UsbTypeCDxe
19-
20-
# RTC: Defer
21-
Library/QcomPmicRealTimeClockLib
10+
/Build/
11+
.DS_Store
12+
*_extdep/
13+
*.pyc
14+
__pycache__/
15+
tags/
16+
.vscode/
17+
*.bak
18+
BuildConfig.conf
2219

23-
# SSDT
24-
AcpiTables/8992/generated
25-
AcpiTables/8994/generated
26-
AcpiTables/Hapanero/generated
20+
/Conf/
21+
/Lumia/

.gitmodules

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[submodule "MU_BASECORE"]
2+
path = MU_BASECORE
3+
url = https://github.com/microsoft/mu_basecore.git
4+
branch = release/202208
5+
[submodule "Common/MU_TIANO"]
6+
path = Common/MU_TIANO
7+
url = https://github.com/microsoft/mu_tiano_plus.git
8+
branch = release/202208
9+
[submodule "Common/MU"]
10+
path = Common/MU
11+
url = https://github.com/microsoft/mu_plus.git
12+
branch = release/202208
13+
[submodule "Common/MU_OEM_SAMPLE"]
14+
path = Common/MU_OEM_SAMPLE
15+
url = https://github.com/microsoft/mu_oem_sample.git
16+
branch = release/202208
17+
[submodule "Silicon/Arm/MU_TIANO"]
18+
path = Silicon/Arm/MU_TIANO
19+
url = https://github.com/microsoft/mu_silicon_arm_tiano.git
20+
branch = release/202208
21+
[submodule "Features/DFCI"]
22+
path = Features/DFCI
23+
url = https://github.com/microsoft/mu_feature_dfci
24+
[submodule "Features/CONFIG"]
25+
path = Features/CONFIG
26+
url = https://github.com/microsoft/mu_feature_config.git

.pytool/CISettings.py

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
# @file
2+
#
3+
# Copyright (c) Microsoft Corporation.
4+
# SPDX-License-Identifier: BSD-2-Clause-Patent
5+
##
6+
import os
7+
import logging
8+
import io
9+
from edk2toolext.environment import shell_environment
10+
from edk2toolext.invocables.edk2_ci_build import CiBuildSettingsManager
11+
from edk2toolext.invocables.edk2_ci_setup import CiSetupSettingsManager
12+
from edk2toolext.invocables.edk2_setup import SetupSettingsManager, RequiredSubmodule
13+
from edk2toolext.invocables.edk2_update import UpdateSettingsManager
14+
from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager
15+
from edk2toollib.utility_functions import GetHostInfo,RunCmd
16+
17+
18+
class Settings(CiSetupSettingsManager, CiBuildSettingsManager, UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager):
19+
20+
def __init__(self):
21+
self.ActualPackages = []
22+
self.ActualTargets = []
23+
self.ActualArchitectures = []
24+
self.ActualToolChainTag = ""
25+
26+
# ####################################################################################### #
27+
# Extra CmdLine configuration #
28+
# ####################################################################################### #
29+
30+
def AddCommandLineOptions(self, parserObj):
31+
pass
32+
33+
def RetrieveCommandLineOptions(self, args):
34+
pass
35+
36+
# ####################################################################################### #
37+
# Default Support for this Ci Build #
38+
# ####################################################################################### #
39+
40+
def GetPackagesSupported(self):
41+
''' return iterable of edk2 packages supported by this build.
42+
These should be edk2 workspace relative paths '''
43+
44+
return ("Lumia950Pkg","Lumia950XLPkg")
45+
46+
def GetArchitecturesSupported(self):
47+
''' return iterable of edk2 architectures supported by this build '''
48+
return ("AARCH64")
49+
50+
def GetTargetsSupported(self):
51+
''' return iterable of edk2 target tags supported by this build '''
52+
return ("DEBUG", "RELEASE", "NO-TARGET", "NOOPT")
53+
54+
# ####################################################################################### #
55+
# Verify and Save requested Ci Build Config #
56+
# ####################################################################################### #
57+
58+
def SetPackages(self, list_of_requested_packages):
59+
''' Confirm the requested package list is valid and configure SettingsManager
60+
to build the requested packages.
61+
62+
Raise UnsupportedException if a requested_package is not supported
63+
'''
64+
unsupported = set(list_of_requested_packages) - \
65+
set(self.GetPackagesSupported())
66+
if(len(unsupported) > 0):
67+
logging.critical(
68+
"Unsupported Package Requested: " + " ".join(unsupported))
69+
raise Exception("Unsupported Package Requested: " +
70+
" ".join(unsupported))
71+
self.ActualPackages = list_of_requested_packages
72+
73+
def SetArchitectures(self, list_of_requested_architectures):
74+
''' Confirm the requests architecture list is valid and configure SettingsManager
75+
to run only the requested architectures.
76+
77+
Raise Exception if a list_of_requested_architectures is not supported
78+
'''
79+
unsupported = set(list_of_requested_architectures) - \
80+
set(self.GetArchitecturesSupported())
81+
if(len(unsupported) > 0):
82+
logging.critical(
83+
"Unsupported Architecture Requested: " + " ".join(unsupported))
84+
raise Exception(
85+
"Unsupported Architecture Requested: " + " ".join(unsupported))
86+
self.ActualArchitectures = list_of_requested_architectures
87+
88+
def SetTargets(self, list_of_requested_target):
89+
''' Confirm the request target list is valid and configure SettingsManager
90+
to run only the requested targets.
91+
92+
Raise UnsupportedException if a requested_target is not supported
93+
'''
94+
unsupported = set(list_of_requested_target) - \
95+
set(self.GetTargetsSupported())
96+
if(len(unsupported) > 0):
97+
logging.critical(
98+
"Unsupported Targets Requested: " + " ".join(unsupported))
99+
raise Exception("Unsupported Targets Requested: " +
100+
" ".join(unsupported))
101+
self.ActualTargets = list_of_requested_target
102+
103+
# ####################################################################################### #
104+
# Actual Configuration for Ci Build #
105+
# ####################################################################################### #
106+
107+
def GetActiveScopes(self):
108+
''' return tuple containing scopes that should be active for this process '''
109+
scopes = ("cibuild", "edk2-build", "host-based-test")
110+
111+
self.ActualToolChainTag = shell_environment.GetBuildVars().GetValue("TOOL_CHAIN_TAG", "")
112+
113+
if GetHostInfo().os.upper() == "LINUX" and self.ActualToolChainTag.upper().startswith("GCC"):
114+
if "AARCH64" in self.ActualArchitectures:
115+
scopes += ("gcc_aarch64_linux",)
116+
if "ARM" in self.ActualArchitectures:
117+
scopes += ("gcc_arm_linux",)
118+
if "RISCV64" in self.ActualArchitectures:
119+
scopes += ("gcc_riscv64_unknown",)
120+
121+
return scopes
122+
123+
def GetRequiredSubmodules(self):
124+
''' return iterable containing RequiredSubmodule objects.
125+
If no RequiredSubmodules return an empty iterable
126+
'''
127+
rs = []
128+
129+
# To avoid maintenance of this file for every new submodule
130+
# lets just parse the .gitmodules and add each if not already in list.
131+
# The GetRequiredSubmodules is designed to allow a build to optimize
132+
# the desired submodules but it isn't necessary for this repository.
133+
result = io.StringIO()
134+
ret = RunCmd("git", "config --file .gitmodules --get-regexp path",
135+
workingdir=self.GetWorkspaceRoot(), outstream=result)
136+
# Cmd output is expected to look like:
137+
# submodule.CryptoPkg/Library/OpensslLib/openssl.path CryptoPkg/Library/OpensslLib/openssl
138+
# submodule.SoftFloat.path ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3
139+
if ret == 0:
140+
for line in result.getvalue().splitlines():
141+
_, _, path = line.partition(" ")
142+
if path is not None:
143+
if path not in [x.path for x in rs]:
144+
# add it with recursive since we don't know
145+
rs.append(RequiredSubmodule(path, True))
146+
return rs
147+
148+
def GetName(self):
149+
return "Lumia950XLPkg"
150+
151+
def GetDependencies(self):
152+
''' Return Git Repository Dependencies
153+
154+
Return an iterable of dictionary objects with the following fields
155+
{
156+
Path: <required> Workspace relative path
157+
Url: <required> Url of git repo
158+
Commit: <optional> Commit to checkout of repo
159+
Branch: <optional> Branch to checkout (will checkout most recent commit in branch)
160+
Full: <optional> Boolean to do shallow or Full checkout. (default is False)
161+
ReferencePath: <optional> Workspace relative path to git repo to use as "reference"
162+
}
163+
'''
164+
return []
165+
166+
def GetPackagesPath(self):
167+
''' Return a list of workspace relative paths that should be mapped as edk2 PackagesPath '''
168+
169+
# Include all submodule paths
170+
result = ["Platforms"]
171+
for submodule in self.GetRequiredSubmodules():
172+
result.append(submodule.path)
173+
174+
return result
175+
176+
def GetWorkspaceRoot(self):
177+
''' get WorkspacePath '''
178+
return os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
179+
180+
def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list:
181+
''' Filter potential packages to test based on changed files. '''
182+
return []

Common/MU

Submodule MU added at ed5ff84

Common/MU_OEM_SAMPLE

Submodule MU_OEM_SAMPLE added at f273f58

Common/MU_TIANO

Submodule MU_TIANO added at a2e6e20

Features/CONFIG

Submodule CONFIG added at b536668

Features/DFCI

Submodule DFCI added at 3bfb66d

0 commit comments

Comments
 (0)