Skip to content

Commit

Permalink
modules/linuxboot: Use a specific commit
Browse files Browse the repository at this point in the history
* add linuxboot-edk2 module (if not building latest git)
* patch linuxboot-edk2 Makefile to not conflict with ours
* update linuxboot build dir in circleci and boards/winterfell

Signed-off-by: Nathan Rennie-Waldock <[email protected]>
  • Loading branch information
NHellFire committed Oct 19, 2020
1 parent 54b862a commit 5b7eb07
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
command: |
make \
BOARD=qemu-linuxboot \
`/bin/pwd`/build/linuxboot-git/build/qemu/.configured \
`/bin/pwd`/build/linuxboot-b5376a441e8e85cbf722e943bb8294958e87c784/build/qemu/.configured \
# Run first to avoid too many processes
- run:
Expand Down
2 changes: 1 addition & 1 deletion boards/winterfell/winterfell.config
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ dxe_offset := 860000
dxe_size := 6a0000
flash-dxe: $(build)/$(BOARD)/linuxboot.rom
( echo u$(dxe_offset) $(dxe_size) ; \
pv $(build)/linuxboot-git/build/$(BOARD)/dxe.vol \
pv $(build)/linuxboot-b5376a441e8e85cbf722e943bb8294958e87c784/build/$(BOARD)/dxe.vol \
) > /dev/ttyACM0

flash: $(build)/$(BOARD)/linuxboot.rom
Expand Down
32 changes: 30 additions & 2 deletions modules/linuxboot
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
modules-$(CONFIG_LINUXBOOT) += linuxboot

linuxboot_version := git
linuxboot_repo := https://github.com/osresearch/linuxboot
#linuxboot_version := git
#linuxboot_repo := https://github.com/osresearch/linuxboot

linuxboot_version := b5376a441e8e85cbf722e943bb8294958e87c784
linuxboot_hash := ccbe2a1ce344dd5831a774a038ed619f988029cc123a87202d62f3d0ec7aad62
linuxboot_tar := linuxboot-$(linuxboot_version).tar.gz
linuxboot_url := https://github.com/osresearch/linuxboot/archive/$(linuxboot_version).tar.gz

linuxboot_base_dir := linuxboot-$(linuxboot_version)

# linuxboot builds are specialized on a per-target basis.
Expand Down Expand Up @@ -77,3 +83,25 @@ linuxboot.run: $(build)/$(BOARD)/linuxboot.rom
INITRD=$(build)/$(BOARD)/initrd.cpio.xz \
CUSTOM=$(CUSTOMPWD) \
run

# If we are not building from a git checkout,
# we must also download the linuxboot-edk2 tree
ifneq "$(linuxboot_version)" "git"

linuxboot_depends += linuxboot-edk2
modules-$(CONFIG_LINUXBOOT) += linuxboot-edk2

linuxboot-edk2_version := b7c299e4799012e8a20958a68693ab95b7626aa9
linuxboot-edk2_hash := 78f48f46414b019b5fcd2d7049fd79e955d25f2965123d0bbdf7226564db33e5

linuxboot-edk2_tar := linuxboot-edk2-$(linuxboot-edk2_version).tar.gz
linuxboot-edk2_url := https://github.com/linuxboot/edk2/archive/$(linuxboot-edk2_version).tar.gz
linuxboot-edk2_dir := $(linuxboot_base_dir)/edk2

# We don't need to build edk2 ourselves
# It will be done as part of the linuxboot build process
linuxboot-edk2_output := .git
linuxboot-edk2_target := .git
linuxboot-edk2_configure := echo -e '\n.git:\n\ttouch .git' >> Makefile

endif
2 changes: 2 additions & 0 deletions modules/linuxboot-edk2
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# empty placeholder file
# This submodule is defined in modules/linuxboot if necessary
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
From d1a4d98a9ddf8e7e7f1e00ca2c143b5d5dc01afd Mon Sep 17 00:00:00 2001
From: Nathan Rennie-Waldock <[email protected]>
Date: Sun, 18 Oct 2020 23:58:29 +0100
Subject: [PATCH] Makefile: Rename configured stamp to avoid conflict with
heads build system

Signed-off-by: Nathan Rennie-Waldock <[email protected]>
---
Makefile | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 2c58529031..d400904442 100644
--- a/Makefile
+++ b/Makefile
@@ -26,16 +26,16 @@ $(EDK2_OUTPUTS): build-dxe
ia32:
build -a IA32

-build-dxe: .configured
+build-dxe: .edk2-configured
cd MdeModulePkg ; build

-build-cpu: .configured
+build-cpu: .edk2-configured
cd UefiCpuPkg ; build
-build-quark: .configured
+build-quark: .edk2-configured
cd QuarkPlatformPkg ; build
build: build-dxe

- .configured:
+ .edk2-configured:
$(MAKE) -C BaseTools
. ./edksetup.sh
touch $@
--
2.25.1

0 comments on commit 5b7eb07

Please sign in to comment.