-
Notifications
You must be signed in to change notification settings - Fork 342
Common instructions
A significant portion of the steps are common on the various UNIX-like platforms. You should start with the instructions for the operating system that most closely matches your platform, and it will direct you here at the appropriate time.
bash$ mkdir ~/src bash$ cd ~/src bash$ git clone https://github.com/tianocore/edk2
- Clone the EDK II project repository
- git clone https://github.com/tianocore/edk2
- Change to the edk2 directory
- Build the tools
- make -C BaseTools
- Run the edksetup.sh script
- . edksetup.sh
- Create a workspace directory
- Change to the workspace directory
- Clone the EDK II project repository
- git clone https://github.com/tianocore/edk2
- Clone the edk2-FatPkg repository to “FatPkg”
- git clone https://github.com/tianocore/edk2-FatPkg FatPkg
- Build the tools
- make -C edk2/BaseTools
- Set environment variables
- WORKSPACE – The workspace directory created above
- PACKAGES_PATH – Set it to $WORKSPACE/edk2
export WORKSPACE=/Sample/Path export PACKAGES_PATH=$WORKSPACE/edk2
- Run the edksetup.sh script
- . edk2/edksetup.sh
Sample └───Path (WORKSPACE) ├───edk2 └───FatPkg
bash$ make -C edk2/BaseTools
bash$ cd ~/src/edk2 bash$ export EDK_TOOLS_PATH=$HOME/src/edk2/BaseTools bash$ . edksetup.sh BaseTools
You will need to edit the Conf/tools_def.txt and Conf/target.txt files. These changes will enable the MdeModulePkg to be built using the GCC 4.4 compiler.
For the Conf/target.txt file, find the following lines:
ACTIVE_PLATFORM = Nt32Pkg/Nt32Pkg.dsc TOOL_CHAIN_TAG = MYTOOLS
And change the corresponding lines to match these:
ACTIVE_PLATFORM = MdeModulePkg/MdeModulePkg.dsc TOOL_CHAIN_TAG = GCC44
Note: The 'gcc --version' command can be used to find out your GCC version. Use the GCC45 toolchain for gcc 4.5.* and the GCC46 toolchain for gcc 4.6.*.
Optionally, you may consider finding:
TARGET_ARCH = IA32
...and changing it if your GCC 4.4 installation supports 64-bit builds. You can change it to either 'X64', or even 'IA32 X64' which will build both architectures.
Now you should be able to simply run the build command to compile the MdeModulePkg.
bash$ build
One result of the build is that you should have the HelloWorld UEFI application:
bash$ ls Build/MdeModule/DEBUG_*/*/HelloWorld.efi
Build OVMF
Once your build environment is set up you might be interested in building the OVMF platform which is included in the main edk2 source tree. Since OVMF builds a full system firmware image this may be of interest to UEFI system firmware developers.
Home
Getting Started with EDK II
Build Instructions
EDK II Platforms
EDK II Documents
EDK II Release Planning
Reporting Issues
Reporting Security Issues
Community Information
Inclusive Language
Additional Projects & Tasks
Training
Community Support
Community Virtual Meetings
GHSA GitHub Security Advisories Proceess (Draft)