Skip to content

[EFIDroid] Build system

Michael Zimmermann edited this page Dec 15, 2017 · 29 revisions

Directory structure

  • build/ Build system
  • device/[VENDOR]/[CODENAME]/ Device config
  • modules/ userspace modules
  • out/ auto generated build directory
  • prebuilts/ toolchains
  • uefi/apps/ UEFI Apps
  • uefi/edk2/ UEFI main code (Tianocore EDKII)
  • uefi/edk2packages/ additional EDKII packages

Make targets

most important targets

  • edk2: make a bootable Android image with UEFI which can be flashed or sideloaded from fastboot

Type make help to get a full list of targets

cleanup targets

You can add the clean or distclean suffix to most build targets to cleanup a target's build files.

To clean/distclean all targets, run "clean" or "distclean"

Makefiles

Device configs

See Device-Config-documentation for more information

Modules

When projects provide their own 'CMakeLists.txt' you don't have do worry about anything. If not we're not gonna fork these projects just to add our makefile because EFIDroid's build system is designed to build projects 'from outside' so we can easily update projects using repo manifests and have less maintenance work.

In this case you can create a directory 'build/moduleconfigs/[NAME]' where '[NAME]' is the name of the directory in 'modules/'. Inside that directory you can create a 'EFIDroid.ini'. Look at the existing modules for the usage.

All CMake modules can use libraries registered to the build system without any additional work.

Compiling for a device

first, setup your environment:

source build/envsetup.sh

then run lunch to select your device and buildtype. You can pass the parameter --toolchain if you want to use another toolchain from build/config.ini. if don't have the device in your tree use the parameter --online to include all officially supported devices from github in the list. It will be downloaded automatically when building for the first time.

lunch

build commands

after sourcing 'build/envsetup.sh' you have a few extra tools for building:

croot

this gets you back to the root directory of the build tree

mkefidroid

this lets you initiate a build from any directory

lunch

this configures the build system for a specific device

Clone this wiki locally