linux编译lz,linux EDKII 编译

http://blog.csdn.net/xtdumpling/article/details/5569610

Introduction

These are instructions for setting up EDK II build environment on Ubuntu, and building OVMF images for use with qemu.

Initial set up

Recent EDK2 checkouts (as of 2 Sept 2012) are known to build correctly on precise.

Install required packages

sudo apt-get install build-essential git uuid-dev iasl

Get the latest source for EDKII

In a suitable working directory (~/src/ in this case, but you can alter this) checkout the latest EDKII source:

$ mkdir ~/src $ cd ~/src $ git clone git://github.com/tianocore/edk2.git $ cd edk2

The following instructions assume that you remain in the ~/src/edk2 directory

Compile base tools

For MS

Windows, prebuilt binaries of the base tools are shipped with the

source; on Ubuntu the base tools required for building EDKII need to be

built first.

$ make -C BaseTools

Set up build target

To set up the build target you need to modify the conf file Conf/target.txt. This will enable the firmware package to be built and set up the compiler version used.

$ vi Conf/target.txt

Find

ACTIVE_PLATFORM       = Nt32Pkg/Nt32Pkg.dsc

and replace it with

ACTIVE_PLATFORM       = MdeModulePkg/MdeModulePkg.dsc

Find

TARGET_ARCH           = IA32

and replace it with 'X64' for 64bit or 'IA32 X64' to build both architectures.

TARGET_ARCH           = X64

Set up build environment

You need to set EDK_TOOLS_PATH and set up the build environment by running the edksetup.sh script provided in the source. This script will copy template and configuration files to edk2/Conf directory.

$ . edksetup.sh

EmulatorPkg provides an environment where a UEFI environment can be

emulated under an environment where a full UEFI compatible

environment is not possible.

On systems with the bash shell you can use EmulatorPkg/build.sh to simplify

building and running EmulatorPkg.

For example, to build + run:

$ EmulatorPkg/build.sh

$ EmulatorPkg/build.sh run

Build a full system firmware image (OVMF)

The Open Virtual Machine Firmware (or "OVMF") can be used to enable UEFI within virtual machines. It provides libraries and drivers related to virtual machines. Currently OVMF support QEMU for emulating UEFI on IA32 and X86-64 based systems. You could also build OVMF with source level debugging enabled.

Set up build target

You can build OVMF for IA32 or X64 architechtures. In this example we will build OVMF for X64 architecture.

You will need to modify Conf/target.txt and replace ACTIVE_PLATFORM with the right dsc file. $ vi Conf/target.txt

Find ACTIVE_PLATFORM       = MdeModulePkg/MdeModulePkg.dsc

replace with ACTIVE_PLATFORM       = OvmfPkg/OvmfPkgX64.dsc  This will set the Target Arch to X64, PEI code to X64 and DXE/UEFI code to X64.

Build a full system firmware image (OVMF)

The Open Virtual Machine Firmware (or "OVMF") can be used to enable UEFI within virtual machines.

It provides libraries and drivers related to virtual machines. Currently OVMF support QEMU for emulating UEFI on IA32 and X86-64 based systems.

You could also build OVMF with source level debugging enabled.

Set up build target

You can build OVMF for IA32 or X64 architechtures. In this example we will build OVMF for X64 architecture. You will need to modify Conf/target.

txt and replace ACTIVE_PLATFORM with the right dsc file.

$ vi Conf/target.txt

Find

ACTIVE_PLATFORM       = MdeModulePkg/MdeModulePkg.dsc

replace with

ACTIVE_PLATFORM       = OvmfPkg/OvmfPkgX64.dsc

This will set the Target Arch to X64, PEI code to X64 and DXE/UEFI code to X64.

Build OvmfPkg

$ cd OvmfPkg

$ buildOn an i7 with 16GB RAM the total build time is less than 30 seconds. The firmware image produced will be located in Build/OvmfX64/DEBUG_GCC46/FV/OVMF.fd.

If you'd like debug output on the serial console, use the DEBUG_ON_SERIAL_PORT option:

$ build -DDEBUG_ON_SERIAL_PORT=TRUE

Building OvmfPkg with Secure Boot support

If you wish to build OVMF with Secure Boot, you must follow the openssl installation instructions found in CryptoPkg/Library/OpensslLib/Patch-HOWTO.txt,

and build with the SECURE_BOOT_ENABLE option:

$ cd OvmfPkg

$ build -DSECURE_BOOT_ENABLE=TRUE

If you see an error that "the required fv image size exceeds the set fv image size" consult .

This issue has been fixed in recent builds.

Running UEFI in QEMU

See the page for running the OVMF images under qemu.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值