summaryrefslogtreecommitdiff
path: root/payloads/external/tianocore/Makefile
diff options
context:
space:
mode:
authorMatt DeVillier <matt.devillier@gmail.com>2019-02-20 23:46:15 -0600
committerPatrick Georgi <pgeorgi@google.com>2019-02-26 11:13:11 +0000
commit38b6ccfed9d0a9ff0605f2def02033cc9523ee94 (patch)
tree71c476ddefd29a5aa6993ab1e24b52615fef499a /payloads/external/tianocore/Makefile
parentda7ffb48b2c84191b29dca41e6cdce5eb05524a1 (diff)
payloads/tianocore: default to MrChromebox's working branch
Rather than attempt to maintain patches against upstream Tianocore, use MrChromebox's coreboot framebuffer branch as the default build target. Rework the Makefile to default to MrChromebox's coreboot_fb branch, but also allow for aribitrary commits from upstream Tianocore to be used as build targets. Ensure the branch is synced on each build, as long as working directory is clean, and that switching between commits or trees is handled sanely. Eliminate TIANOCORE_MASTER as a selectable build target, since unpatched it is unlikely to boot on any device. It can easily be specified via the 'revision' option if desired. Test: build for the default stable target, for upstream/master as the specified revision, and for an arbitrary valid commit hash. Change-Id: I4a83db3cd64c7d5b652c6e95780d10051f143e88 Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-on: https://review.coreboot.org/c/31543 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'payloads/external/tianocore/Makefile')
-rw-r--r--payloads/external/tianocore/Makefile65
1 files changed, 27 insertions, 38 deletions
diff --git a/payloads/external/tianocore/Makefile b/payloads/external/tianocore/Makefile
index bd02f48e03..87c48b1e0d 100644
--- a/payloads/external/tianocore/Makefile
+++ b/payloads/external/tianocore/Makefile
@@ -16,15 +16,15 @@
# force the shell to bash - the edksetup.sh script doesn't work with dash
export SHELL := env bash
-# STABLE_COMMIT_ID represent official edk2 release, currently UDK2018
-STABLE_COMMIT_ID=3e72ffe8afdd03f1f89eba65c921cbdcb004cfee
-TAG-$(CONFIG_TIANOCORE_MASTER)=origin/master
-TAG-$(CONFIG_TIANOCORE_STABLE)=$(STABLE_COMMIT_ID)
-TAG-$(CONFIG_TIANOCORE_REVISION)=$(CONFIG_TIANOCORE_REVISION_ID)
-
project_name=Tianocore
project_dir=$(CURDIR)/tianocore
-project_git_repo=https://github.com/tianocore/edk2
+project_git_repo=https://github.com/mrchromebox/edk2
+project_git_branch=coreboot_fb
+upstream_git_repo=https://github.com/tianocore/edk2
+
+# STABLE revision is MrChromebox's coreboot framebuffer (coreboot_fb) branch
+TAG-$(CONFIG_TIANOCORE_STABLE)=origin/$(project_git_branch)
+TAG-$(CONFIG_TIANOCORE_REVISION)=$(CONFIG_TIANOCORE_REVISION_ID)
export EDK_TOOLS_PATH=$(project_dir)/BaseTools
@@ -44,39 +44,28 @@ else
BUILD_STR=-a IA32 -a X64 -t COREBOOT -p CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc -b $(BUILD_TYPE) $(TIMER)
endif
-all: build
+all: clean build
$(project_dir):
echo " Cloning $(project_name) from Git"
- git clone $(project_git_repo) $(project_dir)
-
-fetch: $(project_dir)
- cd $(project_dir); \
- git show $(TAG-y) >/dev/null 2>&1 ; \
- if [ $$? -ne 0 ] || [ "$(TAG-y)" = "origin/master" ]; then \
- echo " Fetching new commits from the $(project_name) repo"; \
- git fetch; \
- fi
-
-$(project_dir)/.version_$(TAG-y): fetch
- if ! [[ -e $(project_dir)/.version_$(STABLE_COMMIT_ID) ]] || \
- [ "$(TAG-y)" = "origin/master" ] ; then \
- rm -f .version_*; \
- echo " Checking out $(project_name) revision $(TAG-y)"; \
- cd $(project_dir); \
- git checkout master; \
- git branch -D coreboot 2>/dev/null; \
- git checkout -b coreboot $(TAG-y); \
- for patch in $(CURDIR)/patches/*.patch; do \
- echo "Applying $$patch"; \
- cd $(project_dir); \
- git am --keep-cr --ignore-space-change $$patch || \
- ( echo " Error when applying patches.\n"; git am --abort; exit 1; ); \
- done; \
- if ! [ "$(TAG-y)" = "origin/master" ] ; then \
- touch $(project_dir)/.version_$(STABLE_COMMIT_ID); \
+ git clone --single-branch --branch $(project_git_branch) $(project_git_repo) $(project_dir); \
+ cd $(project_dir); \
+ git remote add upstream $(upstream_git_repo)
+
+update: $(project_dir)
+ cd $(project_dir); \
+ echo " Fetching new commits from the $(project_name) repo"; \
+ git fetch --multiple origin upstream 2>/dev/null; \
+ if ! git rev-parse --verify -q $(TAG-y) >/dev/null; then \
+ echo " $(TAG-y) is not a valid git reference"; \
+ exit 1; \
fi; \
- fi; \
+ if git describe --all --dirty | grep -qv dirty; then \
+ echo " Checking out $(project_name) revision $(TAG-y)"; \
+ git checkout --detach $(TAG-y); \
+ else \
+ echo " Working directory not clean; will not overwrite"; \
+ fi
checktools:
echo "Checking uuid-dev..."
@@ -89,7 +78,7 @@ checktools:
type nasm > /dev/null 2>&1 && echo " found nasm." || \
( echo " Not found."; echo "Error: Please install nasm."; exit 1 )
-build: $(project_dir)/.version_$(TAG-y) checktools
+build: update checktools
unset CC; $(MAKE) -C $(project_dir)/BaseTools
echo " build $(project_name) $(TAG-y)"
cd $(project_dir); \
@@ -109,4 +98,4 @@ clean:
distclean:
rm -rf $(project_dir)
-.PHONY: all fetch checkout checktools config build clean distclean
+.PHONY: all update checktools config build clean distclean