Project Mu based OnePlus6T Platform Repo. For Building Project Mu firmware of the OnePlus6T Device.
- Implement configuration of compilation environment with scripts.
- Implement compilation with scripts.
- Use upstream master branch of the OnePlus6TPkg from sdm845Pkg instead of specific modified branches.
GCC | MSVC | |
---|---|---|
Config | YES | YES |
Compile | YES | NO |
Bootable | LIMITED | NO |
This repository is NOT a part of Project Mu, but it depends on some parts of Project Mu.
For more information about these repositories, see Project Mu.
- Upgrade your system to the latest state before you begin installing the necessary packages.
sudo apt-get update sudo apt-get upgrade
- The packages we need to install include Python-3, Git, abootimg .
sudo apt-get install python3 git abootimg python3-venv python3-pip
-
In order to avoid the differences caused by the tool chain, we will use the recommended tool chain to complete the compilation.
-
Download gcc-linaro-7.4.1-x86_64_aarch64-linux-gnu.
wget http://releases.linaro.org/components/toolchain/binaries/7.4-2019.02/aarch64-linux-gnu/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.tar.xz
-
Decompress the package to somewhere you want.
xz -d gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.tar.xz tar xvf gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.tar
-
Add the toolchain to environment variable.
export PATH="$PATH:<Your Toolchain Installation Dir>/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin"
Or you can permanently add the toolchain to the system by modifying the
/etc/ environment
. -
Switch default compiler to cross compiler. Sometimes setting CC variable is invalid, so we have to change cross compiler to local compiler temporarily.
sudo update-alternatives --install /usr/bin/gcc gcc <Your Toolchain Installation Dir>/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc 70 sudo update-alternatives --install /usr/bin/gcc-ar gcc-ar <Your Toolchain Installation Dir>/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc-ar 70
Don't forget to reset the local compiler after using the cross compiler.
-
Create the workspace like this.
/WorkspaceRoot (basic platform) |-- src_of_project |-- venv <-- Virtual environment for Project in workspace root |
-
Run python cmd to create virtual environment.
python3 -m venv <your virtual env name>
-
Activate it for your session.
source <your virtual env name>/bin/activate
-
Download latest Python from https://www.python.org/downloads
https://www.python.org/ftp/python/3.8.2/python-3.8.2-amd64.exe
-
It is recommended you use the following options when installing python:
- include pip support.
- include test support.
- include venv virtual environment support.
-
Download latest Git For Windows from https://git-scm.com/download/win .
https://github.com/git-for-windows/git/releases/download/v2.25.1.windows.1/Git-2.25.1-64-bit.exe
-
It is recommended you use the following options:
- Checkout as is, commit as is.
- Native Channel support (this will help in corp environments).
- Check the box to "Enable Git Credential Manager".
-
Download latest version of VS build Tools to c:\TEMP.
https://aka.ms/vs/16/release/vs_buildtools.exe
-
Install from cmd line with required features (this set will change over time).
C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache --installPath C:\BuildTools \ --add Microsoft.VisualStudio.Component.VC.CoreBuildTools --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 \ --add Microsoft.VisualStudio.Component.Windows10SDK.17763 --add Microsoft.VisualStudio.Component.VC.Tools.ARM \ --add Microsoft.VisualStudio.Component.VC.Tools.ARM64
See component list here for more options. https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2019
-
Download lastest version of NASM (NetWide Assembler).
https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/win64/nasm-2.15.05-installer-x64.exe
-
Add NASM to Widnows Environment variable.
Variable Name: NASM_PREFIX Variable Value: <NASM installation dir>/
-
Create the workspace like this.
/WorkspaceRoot (basic platform) |-- src_of_project |-- venv <-- Virtual environment for Project in workspace root |
-
Run python cmd to create virtual environment.
python -m venv <your virtual env name>
-
Activate it for your session.
<your virtual env name>/Scripts/activate.bat
-
Open cmd prompt at workspace root.
-
Activate your python virtual environment.
-
Install or update Python dependencies using pip.
pip install --upgrade -r pip-requirements.txt
-
Run stuart_setup to download required submodules.
stuart_setup -c .pytool/CISettings.py
-
Run stuart_ci_setup to download CI only dependencies.
stuart_ci_setup -c .pytool/CISettings.py
-
Run stuart_update to download or update binary dependencies.
stuart_update -c .pytool/CISettings.py
-
Run stuart_ci_build to build and test the packages.
stuart_ci_build -c .pytool/CISettings.py
-
Open TestResults.xml in the build output for results (usually in workspace/Build).
-
Open log files to debug any errors.
-
Open cmd prompt at workspace root.
-
Activate your python virtual environment.
-
Install or update Python dependencies using pip.
pip install --upgrade -r pip-requirements.txt
-
Run stuart_setup to download required submodules.
stuart_setup -c Platforms/OnePlus6TPkg/PlatformCI/PlatformBuild.py TOOL_CHAIN_TAG=VS2019
-
Run stuart_update to download or update binary dependencies.
stuart_update -c Platforms/OnePlus6TPkg/PlatformCI/PlatformBuild.py TOOL_CHAIN_TAG=VS2019
-
Run stuart_build to build and test the packages.
stuart_build -c Platforms/OnePlus6TPkg/PlatformCI/PlatformBuild.py TOOL_CHAIN_TAG=VS2019
-
Open the build output for log files to debug any errors (usually in workspace/Build).
- Get the necessary documents.
mkdir img cp Build/OnePlus6TPkg/DEBUG_<your toolchian tag>/FV/ONEPLUS6TPKG_UEFI.fd ./img cp dtb/fajita.dtb ./img echo > ./img/ramdisk
- Using abootimg tool to generate image.
cd img gzip -c < ./ONEPLUS6TPKG_UEFI.fd > "./uefi-fajita.img.gz" cat "./uefi-fajita.img.gz" "./fajita.dtb" > "./uefi-fajita.img.gz-dtb" abootimg --create "./boot-fajita.img" -k "./uefi-fajita.img.gz-dtb" -r ramdisk
- Use FastBoot to start.
fastboot boot boot-fajita.img
- mu: Provids details of project mu.
- mu_tiano_platforms: Provides a template for such firmware projects.
- edk2-sdm845: Most of the code for OnePlus6TPkg comes from sdm845Pkg.
The software is distributed under BSD 2-Clause License.