build edk2 as a module for the r630 NERF firmware

This commit is contained in:
Trammell hudson 2017-09-20 14:26:38 -04:00
parent bda821dbb9
commit 81a7f18b86
Failed to extract signature
4 changed files with 138 additions and 1 deletions

72
config/edk2.config Normal file
View File

@ -0,0 +1,72 @@
#
# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
#
# ALL Paths are Relative to WORKSPACE
# Separate multiple LIST entries with a SINGLE SPACE character, do not use comma characters.
# Un-set an option by either commenting out the line, or not setting a value.
#
# PROPERTY Type Use Description
# ---------------- -------- -------- -----------------------------------------------------------
# ACTIVE_PLATFORM Filename Recommended Specify the WORKSPACE relative Path and Filename
# of the platform description file that will be used for the
# build. This line is required if and only if the current
# working directory does not contain one or more description
# files.
ACTIVE_PLATFORM = MdeModulePkg/MdeModulePkg.dsc
# TARGET List Optional Zero or more of the following: DEBUG, RELEASE, NOOPT
# UserDefined; separated by a space character.
# If the line is missing or no value is specified, all
# valid targets specified in the platform description file
# will attempt to be built. The following line will build
# DEBUG platform target.
TARGET = DEBUG
# TARGET_ARCH List Optional What kind of architecture is the binary being target for.
# One, or more, of the following, IA32, IPF, X64, EBC, ARM
# or AArch64.
# Multiple values can be specified on a single line, using
# space charaters to separate the values. These are used
# during the parsing of a platform description file,
# restricting the build output target(s.)
# The Build Target ARCH is determined by (precedence high to low):
# Command-line: -a ARCH option
# target.txt: TARGET_ARCH values
# DSC file: [Defines] SUPPORTED_ARCHITECTURES tag
# If not specified, then all valid architectures specified
# in the platform file, for which tools are available, will be
# built.
TARGET_ARCH = X64
# TOOL_DEFINITION_FILE Filename Optional Specify the name of the filename to use for specifying
# the tools to use for the build. If not specified,
# WORKSPACE/Conf/tools_def.txt will be used for the build.
TOOL_CHAIN_CONF = Conf/tools_def.txt
# TAGNAME List Optional Specify the name(s) of the tools_def.txt TagName to use.
# If not specified, all applicable TagName tools will be
# used for the build. The list uses space character separation.
TOOL_CHAIN_TAG = GCC5
# MAX_CONCURRENT_THREAD_NUMBER NUMBER Optional The number of concurrent threads. Recommend to set this
# value to one more than the number of your compurter
# cores or CPUs. Less than 2 means disable multithread build.
MAX_CONCURRENT_THREAD_NUMBER = 10
# BUILD_RULE_CONF Filename Optional Specify the file name to use for the build rules that are followed
# when generating Makefiles. If not specified, the file:
# WORKSPACE/Conf/build_rule.txt will be used
BUILD_RULE_CONF = Conf/build_rule.txt

32
config/edk2.makefile Normal file
View File

@ -0,0 +1,32 @@
# Wrapper around the edk2 "build" script to generate
# the few files that we actually want and avoid rebuilding
# if we don't have to.
PWD := $(shell pwd)
EDK2_OUTPUT_DIR := $(PWD)/Build/MdeModule/DEBUG_GCC5/X64/MdeModulePkg/Core
EDK2_BIN_DIR := $(PWD)/BaseTools/BinWrappers/PosixLike
export PATH := $(EDK2_BIN_DIR):$(PATH)
export CONFIG_PATH := $(PWD)/Conf
export EDK_TOOLS_PATH := $(PWD)/BaseTools
export WORKSPACE := $(PWD)
EDK2_BINS += Dxe/DxeMain/DEBUG/DxeCore.efi
EDK2_BINS += RuntimeDxe/RuntimeDxe/DEBUG/RuntimeDxe.efi
EDK2_OUTPUTS = $(addprefix $(EDK2_OUTPUT_DIR)/,$(EDK2_BINS))
# build takes too long, so we check to see if our executables exist
# before we start a build. run the clean target if they must be rebuilt
all: $(EDK2_OUTPUTS)
ls -Fla $(EDK2_OUTPUTS)
cp -a $(EDK2_OUTPUTS) .
$(EDK2_OUTPUTS):
build
clean:
$(RM) $(EDK2_OUTPUTS)
real-clean: clean
build clean

View File

@ -1,7 +1,9 @@
# Configuration for a Dell R630
# flashrom doesn't work on this mainboard
# and it is NERF, not coreboot.
BOARD=x230
BOARD=r630
CONFIG_EDK2=y
#CONFIG_CRYPTSETUP=y
#CONFIG_FLASHROM=y

31
modules/edk2 Normal file
View File

@ -0,0 +1,31 @@
# This is only needed for building NERF firmware
# coreboot systems do not require this tree
modules-$(CONFIG_EDK2) += edk2
edk2_branch := UDK2017
edk2_version := git
edk2_repo := --branch $(edk2_branch) --depth 1 https://github.com/tianocore/edk2
edk2_dir := edk2-$(edk2_branch)
# we don't build with our cross compiler since there isn't a host versus
# target difference in their makefiles.
#edk2_depends := musl-cross
edk2_configure := \
$(MAKE) \
-C BaseTools \
&& pwd \
&& cp ../../config/edk2.config ./Conf/target.txt \
&& cp ../../config/edk2.makefile ./Makefile \
&& . ./edksetup.sh
edk2_target := \
all
NO:=\
obj=./$(BOARD) \
DOTCONFIG=../../config/edk2-$(BOARD).config \
BUILD_TIMELESS=1 \
CFLAGS_x86_32="$(EXTRA_FLAGS)" \
CFLAGS_x86_64="$(EXTRA_FLAGS)" \
$(MAKE_JOBS)