From 292a8bec81219e5edab19187e3550605a0ce82b5 Mon Sep 17 00:00:00 2001 From: Trammell hudson Date: Tue, 18 Sep 2018 06:33:15 -0400 Subject: [PATCH 01/18] patch for __alloca missing on ubuntu 18.04 (#352) --- Makefile | 52 ++++++++++++++++++++++++---------------- modules/make | 4 ++-- patches/make-4.2.1.patch | 11 +++++++++ 3 files changed, 45 insertions(+), 22 deletions(-) create mode 100644 patches/make-4.2.1.patch diff --git a/Makefile b/Makefile index 6b5825e1..4c262b5d 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,8 @@ CPUS := $(shell nproc) # Create the log directory if it doesn't already exist BUILD_LOG := $(shell mkdir -p "$(log_dir)" ) +WGET ?= wget + # Check that we have a correct version of make # that matches at least the major version LOCAL_MAKE_VERSION := $(shell $(MAKE) --version | head -1 | cut -d' ' -f3) @@ -230,10 +232,10 @@ define define_module = # wget creates it early, so we have to cleanup if it fails $(packages)/$($1_tar): $(call do,WGET,$($1_url),\ - if ! wget -O "$$@" $($1_url) ; then \ - rm -f "$$@" ; \ + if ! $(WGET) -O "$$@.tmp" $($1_url) ; then \ exit 1 ; \ - fi \ + fi ; \ + mv "$$@.tmp" "$@" \ ) $(packages)/.$1-$($1_version)_verify: $(packages)/$($1_tar) echo "$($1_hash) $$^" | sha256sum --check - @@ -555,30 +557,40 @@ $(eval $(shell echo >&2 "$(DATE) Wrong make detected: $(LOCAL_MAKE_VERSION)")) HEADS_MAKE := $(build)/$(make_dir)/make # Once we have a proper Make, we can just pass arguments into it -all bootstrap linux cpio: $(HEADS_MAKE) +all linux cpio run: $(HEADS_MAKE) LANG=C MAKE=$(HEADS_MAKE) $(HEADS_MAKE) $(MAKE_JOBS) $@ -%.clean %.vol: $(HEADS_MAKE) +%.clean %.vol %.menuconfig: $(HEADS_MAKE) LANG=C MAKE=$(HEADS_MAKE) $(HEADS_MAKE) $@ +bootstrap: $(HEADS_MAKE) + # How to download and build the correct version of make -$(HEADS_MAKE): $(build)/$(make_dir)/Makefile +$(packages)/$(make_tar): + $(WGET) -O "$@.tmp" "$(make_url)" + if ! echo "$(make_hash) $@.tmp" | sha256sum --check -; then \ + exit 1 ; \ + fi + mv "$@.tmp" "$@" + +$(build)/$(make_dir)/.extract: $(packages)/$(make_tar) + tar xf "$<" -C "$(build)" + touch "$@" + +$(build)/$(make_dir)/.patch: patches/make-$(make_version).patch $(build)/$(make_dir)/.extract + ( cd "$(dir $@)" ; patch -p1 ) < "$<" + touch "$@" + +$(build)/$(make_dir)/.configured: $(build)/$(make_dir)/.patch + cd "$(dir $@)" ; \ + ./configure 2>&1 \ + | tee "$(log_dir)/make.configure.log" \ + $(VERBOSE_REDIRECT) + touch "$@" + +$(HEADS_MAKE): $(build)/$(make_dir)/.configured make -C "$(dir $@)" $(MAKE_JOBS) \ 2>&1 \ | tee "$(log_dir)/make.log" \ $(VERBOSE_REDIRECT) -$(build)/$(make_dir)/Makefile: $(packages)/$(make_tar) - tar xf "$<" -C build/ - cd "$(dir $@)" ; ./configure \ - 2>&1 \ - | tee "$(log_dir)/make.configure.log" \ - $(VERBOSE_REDIRECT) - -$(packages)/$(make_tar): - wget -O "$@" "$(make_url)" - if ! echo "$(make_hash) $@" | sha256sum --check -; then \ - $(MV) "$@" "$@.failed"; \ - false; \ - fi - endif diff --git a/modules/make b/modules/make index 460c0b31..81e30562 100644 --- a/modules/make +++ b/modules/make @@ -3,11 +3,11 @@ # target platform. #modules += make -make_version := 4.2 +make_version := 4.2.1 make_dir := make-$(make_version) make_tar := make-$(make_version).tar.bz2 make_url := http://gnu.mirror.constant.com/make/$(make_tar) -make_hash := 4e5ce3b62fe5d75ff8db92b7f6df91e476d10c3aceebf1639796dc5bfece655f +make_hash := d6e262bf3601b42d2b1e4ef8310029e1dcf20083c5446b4b7aa67081fdffc589 # This is built for the local machine, not the target, so it doesn't have any # of the build instructions. diff --git a/patches/make-4.2.1.patch b/patches/make-4.2.1.patch new file mode 100644 index 00000000..61a3581f --- /dev/null +++ b/patches/make-4.2.1.patch @@ -0,0 +1,11 @@ +--- clean/make-4.2/glob/glob.c 2013-10-20 17:14:38.000000000 +0000 ++++ make-4.2/glob/glob.c 2018-09-18 10:16:03.860886356 +0000 +@@ -208,7 +208,7 @@ + #endif /* __GNU_LIBRARY__ || __DJGPP__ */ + + +-#if !defined __alloca && !defined __GNU_LIBRARY__ ++#if !defined __alloca && defined __GNU_LIBRARY__ + + # ifdef __GNUC__ + # undef alloca From 5555e9e8ac605905b927a9f7d2c3e34657e03f43 Mon Sep 17 00:00:00 2001 From: Trammell hudson Date: Tue, 18 Sep 2018 06:55:16 -0400 Subject: [PATCH 02/18] circleci needs to use the new 4.2.1 make --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4d32df58..40fe728b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,19 +35,19 @@ jobs: - run: name: Bootstrap make command: | - make `pwd`/build/make-4.2/make + make `pwd`/build/make-4.2.1/make - run: name: Bootstrap musl command: | - ./build/make-4.2/make -j4 musl-cross V=1 + ./build/make-4.2.1/make -j4 musl-cross V=1 - run: name: qemu-coreboot command: | - ./build/make-4.2/make -j4 BOARD=qemu-coreboot V=1 + ./build/make-4.2.1/make -j4 BOARD=qemu-coreboot V=1 - run: name: qemu-linuxboot command: | - ./build/make-4.2/make -j4 BOARD=qemu-linuxboot V=1 + ./build/make-4.2.1/make -j4 BOARD=qemu-linuxboot V=1 workflows: version: 2 build_and_test: From c494d0a5fdd33e22c1e0e9f95e8b71b9319783fd Mon Sep 17 00:00:00 2001 From: Trammell hudson Date: Tue, 18 Sep 2018 07:14:02 -0400 Subject: [PATCH 03/18] fix wget and allow packages to be overridden --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4c262b5d..984b2515 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ all: ifneq "$(TOOLCHAIN)" "" $(info Using $(TOOLCHAIN) for cross compiler and packages) -packages := $(TOOLCHAIN)/packages +packages ?= $(TOOLCHAIN)/packages CROSS := $(TOOLCHAIN)/crossgcc/x86_64-linux-musl/bin/x86_64-linux-musl- endif @@ -235,7 +235,7 @@ define define_module = if ! $(WGET) -O "$$@.tmp" $($1_url) ; then \ exit 1 ; \ fi ; \ - mv "$$@.tmp" "$@" \ + mv "$$@.tmp" "$$@" \ ) $(packages)/.$1-$($1_version)_verify: $(packages)/$($1_tar) echo "$($1_hash) $$^" | sha256sum --check - From e03f375bfdaa392c29a6cc23dfd4bdfe85ca9fcd Mon Sep 17 00:00:00 2001 From: Trammell hudson Date: Tue, 18 Sep 2018 07:14:39 -0400 Subject: [PATCH 04/18] use osresearch/heads-builder docker image with pre-built compilers --- .circleci/config.yml | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 40fe728b..903d0474 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2 jobs: build: docker: - - image: ubuntu:16.04 + - image: osresearch/heads-builder:18.04 steps: - run: name: Install dependencies @@ -29,25 +29,34 @@ jobs: gnat \ cpio \ ccache \ + lzma \ - checkout - run: name: Bootstrap make command: | - make `pwd`/build/make-4.2.1/make - - run: - name: Bootstrap musl - command: | - ./build/make-4.2.1/make -j4 musl-cross V=1 + make bootstrap - run: name: qemu-coreboot command: | - ./build/make-4.2.1/make -j4 BOARD=qemu-coreboot V=1 + ./build/make-4.2.1/make \ + -j4 \ + V=1 \ + TOOLCHAIN=/home/builder/heads \ + packages=`pwd`/packages \ + BOARD=qemu-coreboot \ + - run: name: qemu-linuxboot command: | - ./build/make-4.2.1/make -j4 BOARD=qemu-linuxboot V=1 + ./build/make-4.2.1/make \ + -j4 \ + V=1 \ + TOOLCHAIN=/home/builder/heads \ + packages=`pwd`/packages \ + BOARD=qemu-linuxboot \ + workflows: version: 2 build_and_test: From f712d7aefeb6bd4c87abc4883ed0a18b3add3bc2 Mon Sep 17 00:00:00 2001 From: Trammell hudson Date: Tue, 18 Sep 2018 07:24:19 -0400 Subject: [PATCH 05/18] move limits.h dependency into modules/linux --- modules/linux | 10 ++++++++++ modules/musl | 9 --------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/modules/linux b/modules/linux index c1b18a22..28257909 100644 --- a/modules/linux +++ b/modules/linux @@ -34,6 +34,16 @@ linux_configure := \ linux_output += arch/x86/boot/bzImage +# Once we have extracted the kernel tar file, install the headers +# so that other submodules can make use of them. +$(INSTALL)/include/linux/limits.h: $(build)/$(linux_base_dir)/.canary + $(MAKE) \ + -C "$(build)/$(linux_base_dir)" \ + INSTALL_HDR_PATH="$(INSTALL)" \ + O="$(linux_dir)" \ + KCONFIG_CONFIG="$(pwd)/$(linux_kconfig)" \ + headers_install + # qemu linux_modules-$(CONFIG_LINUX_E1000) += drivers/net/ethernet/intel/e1000/e1000.ko diff --git a/modules/musl b/modules/musl index a0e449cf..eec76de3 100644 --- a/modules/musl +++ b/modules/musl @@ -39,12 +39,3 @@ musl_depends := musl-cross # Fake a target so that musl will force a header install by the # Linux kernel sources. $(build)/$(musl_dir)/.build: $(INSTALL)/include/linux/limits.h - -$(INSTALL)/include/linux/limits.h: $(build)/$(linux_base_dir)/.canary - $(MAKE) \ - -C "$(build)/$(linux_base_dir)" \ - INSTALL_HDR_PATH="$(INSTALL)" \ - O="$(linux_dir)" \ - KCONFIG_CONFIG="$(pwd)/$(linux_kconfig)" \ - headers_install - From 606600586c3a3ab18d2debf501cd6899fa369cec Mon Sep 17 00:00:00 2001 From: Trammell hudson Date: Tue, 18 Sep 2018 09:27:18 -0400 Subject: [PATCH 06/18] coreboot-gcc target --- .circleci/config.yml | 14 ++++++++++---- modules/coreboot | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 903d0474..5bbb3409 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,13 +34,19 @@ jobs: - checkout - run: - name: Bootstrap make + name: coreboot gcc command: | - make bootstrap + /home/builder/heads/build/make-4.2.1/make \ + V=1 \ + TOOLCHAIN=/home/builder/heads \ + packages=`pwd`/packages \ + BOARD=qemu-coreboot \ + coreboot-gcc \ + - run: name: qemu-coreboot command: | - ./build/make-4.2.1/make \ + /home/builder/heads/build/make-4.2.1/make \ -j4 \ V=1 \ TOOLCHAIN=/home/builder/heads \ @@ -50,7 +56,7 @@ jobs: - run: name: qemu-linuxboot command: | - ./build/make-4.2.1/make \ + /home/builder/heads/build/make-4.2.1/make \ -j4 \ V=1 \ TOOLCHAIN=/home/builder/heads \ diff --git a/modules/coreboot b/modules/coreboot index d785abbc..1326e9d6 100644 --- a/modules/coreboot +++ b/modules/coreboot @@ -40,6 +40,7 @@ coreboot_output := coreboot.rom coreboot_depend += linux initrd # hack to force a build dependency on the cross compiler +coreboot-gcc: $(build)/$(coreboot_base_dir)/util/crossgcc/xgcc/bin/i386-elf-gcc $(build)/$(coreboot_dir)/.configured: $(build)/$(coreboot_base_dir)/util/crossgcc/xgcc/bin/i386-elf-gcc $(build)/$(coreboot_base_dir)/util/crossgcc/xgcc/bin/i386-elf-gcc: $(build)/$(coreboot_base_dir)/.canary echo '******* Building crossgcc-i386 (this might take a while) ******' From d3bf7aab64b6c75b56433b4bf2d39ceced1fae69 Mon Sep 17 00:00:00 2001 From: Trammell hudson Date: Tue, 18 Sep 2018 09:59:09 -0400 Subject: [PATCH 07/18] does tput cause the problem with circleci? --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5bbb3409..e3ea72d6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -37,6 +37,7 @@ jobs: name: coreboot gcc command: | /home/builder/heads/build/make-4.2.1/make \ + TERM=dumb \ V=1 \ TOOLCHAIN=/home/builder/heads \ packages=`pwd`/packages \ @@ -47,6 +48,7 @@ jobs: name: qemu-coreboot command: | /home/builder/heads/build/make-4.2.1/make \ + TERM=dumb \ -j4 \ V=1 \ TOOLCHAIN=/home/builder/heads \ @@ -57,6 +59,7 @@ jobs: name: qemu-linuxboot command: | /home/builder/heads/build/make-4.2.1/make \ + TERM=dumb \ -j4 \ V=1 \ TOOLCHAIN=/home/builder/heads \ From 553964157b5bf6b2de9c65c0ed65f6abf89d538d Mon Sep 17 00:00:00 2001 From: Trammell hudson Date: Tue, 18 Sep 2018 10:43:36 -0400 Subject: [PATCH 08/18] use a smaller image, maybe we will not run out of space --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e3ea72d6..50df8692 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2 jobs: build: docker: - - image: osresearch/heads-builder:18.04 + - image: osresearch/heads-ubuntu:18.04 steps: - run: name: Install dependencies From 7a39cc78f4140756cecb3d36783a0845e49d2889 Mon Sep 17 00:00:00 2001 From: Trammell hudson Date: Tue, 18 Sep 2018 12:08:16 -0400 Subject: [PATCH 09/18] create hashes and store them in the circleci artifacts --- .circleci/config.yml | 38 ++++++++++++++++++++++++++------------ Makefile | 27 ++++++++++++++++++++++----- 2 files changed, 48 insertions(+), 17 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 50df8692..55a71062 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2 jobs: build: docker: - - image: osresearch/heads-ubuntu:18.04 + - image: ubuntu:18.04 steps: - run: name: Install dependencies @@ -33,38 +33,52 @@ jobs: - checkout + - run: + name: Bootstrap make + command: | + make bootstrap + + - run: + name: Bootstrap musl + command: | + ./build/make-4.2.1/make \ + -j4 \ + V=1 \ + BOARD=qemu-coreboot \ + musl-cross + - run: name: coreboot gcc command: | - /home/builder/heads/build/make-4.2.1/make \ - TERM=dumb \ + ./build/make-4.2.1/make \ V=1 \ - TOOLCHAIN=/home/builder/heads \ - packages=`pwd`/packages \ BOARD=qemu-coreboot \ coreboot-gcc \ - run: name: qemu-coreboot command: | - /home/builder/heads/build/make-4.2.1/make \ + ./build/make-4.2.1/make \ TERM=dumb \ -j4 \ V=1 \ - TOOLCHAIN=/home/builder/heads \ - packages=`pwd`/packages \ BOARD=qemu-coreboot \ + - store-artifacts: + path: build/qemu-coreboot/coreboot.rom + - store-artifacts: + path: build/qemu-coreboot/hashes.txt - run: name: qemu-linuxboot command: | - /home/builder/heads/build/make-4.2.1/make \ - TERM=dumb \ + ./build/make-4.2.1/make \ -j4 \ V=1 \ - TOOLCHAIN=/home/builder/heads \ - packages=`pwd`/packages \ BOARD=qemu-linuxboot \ + - store-artifacts: + path: build/qemu-linuxboot/linuxboot.rom + - store-artifacts: + path: build/qemu-linuxboot/hashes.txt workflows: version: 2 diff --git a/Makefile b/Makefile index 984b2515..3ef4ee29 100644 --- a/Makefile +++ b/Makefile @@ -31,14 +31,14 @@ include modules/make ifneq "" "$(filter $(make_version)%,$(LOCAL_MAKE_VERSION))" +# Timestamps should be in ISO format +DATE=`date --rfc-3339=seconds` + # This is the correct version of Make BOARD ?= qemu-coreboot CONFIG := $(pwd)/boards/$(BOARD)/$(BOARD).config -# Create the board output directory if it doesn't already exist -BOARD_LOG := $(shell mkdir -p "$(build)/$(BOARD)" ) - ifneq "y" "$(shell [ -r '$(CONFIG)' ] && echo y)" $(error $(CONFIG): board configuration does not exist) endif @@ -58,8 +58,15 @@ GIT_STATUS := $(shell \ echo dirty ; \ fi) -# Timestamps should be in ISO format -DATE=`date --rfc-3339=seconds` +# record the build date / git hashes and other files here +HASHES := $(build)/$(BOARD)/hashes.txt + +# Create the board output directory if it doesn't already exist +BOARD_LOG := $(shell \ + mkdir -p "$(build)/$(BOARD)" ; \ + echo "$(DATE) $(GIT_HASH) $(GIT_STATUS)" > "$(HASHES)" ; \ +) + # If V is set in the environment, do not redirect the tee # command to /dev/null. @@ -129,6 +136,9 @@ else $(error "$(BOARD): neither CONFIG_COREBOOT nor CONFIG_LINUXBOOT is set?") endif +all: + sha256sum $< | tee -a "$(HASHES)" + # Disable all built in rules .INTERMEDIATE: .SUFFIXES: @@ -182,6 +192,12 @@ define do-cpio = echo "$(DATE) UNCHANGED $(1:$(pwd)/%=%)" ; \ rm "$1.tmp" ; \ fi + $(call do,HASHES, $1,\ + ( cd "$2"; \ + find . -type f -print0 \ + | xargs -0 sha256sum \ + >> "$(HASHES)" \ + ) endef define do-copy = @@ -472,6 +488,7 @@ $(build)/$(initrd_dir)/initrd.cpio.xz: $(initrd-y) -9 \ | dd bs=512 conv=sync status=none > "$@.tmp" \ ) + sha256sum "$@" | tee -a "$(HASHES)" @if ! cmp --quiet "$@.tmp" "$@" ; then \ mv "$@.tmp" "$@" ; \ sha256sum "$(@:$(pwd)/%=%)" ; \ From eafe001097687a19915610bb954d3dc365308806 Mon Sep 17 00:00:00 2001 From: Trammell hudson Date: Tue, 18 Sep 2018 12:09:16 -0400 Subject: [PATCH 10/18] fix yaml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 55a71062..545fe0ce 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -42,7 +42,7 @@ jobs: name: Bootstrap musl command: | ./build/make-4.2.1/make \ - -j4 \ + -j4 \ V=1 \ BOARD=qemu-coreboot \ musl-cross From 54748c663adcad63b2ddeeeff588ab3dafa0213d Mon Sep 17 00:00:00 2001 From: Trammell hudson Date: Tue, 18 Sep 2018 12:09:47 -0400 Subject: [PATCH 11/18] hash the kernel --- modules/linux | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/linux b/modules/linux index 28257909..40a8d4c7 100644 --- a/modules/linux +++ b/modules/linux @@ -155,6 +155,7 @@ $(build)/$(BOARD)/modules.cpio: $(build)/$(linux_dir)/.build $(build)/$(BOARD)/bzImage: $(build)/$(linux_dir)/.build $(call do-copy,$(dir $<)/$(linux_output),$@) @touch $@ # force a timestamp update + sha256sum "$@" | tee -a "$(HASHES)" # menuconfig target allows us to easily reconfigure this Linux kernel From a5a11e82130643356583345187ab106a7659b2b0 Mon Sep 17 00:00:00 2001 From: Trammell hudson Date: Tue, 18 Sep 2018 12:35:19 -0400 Subject: [PATCH 12/18] fix missing ) in hashes --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3ef4ee29..ee1aa9f7 100644 --- a/Makefile +++ b/Makefile @@ -196,7 +196,7 @@ define do-cpio = ( cd "$2"; \ find . -type f -print0 \ | xargs -0 sha256sum \ - >> "$(HASHES)" \ + ) >> "$(HASHES)" \ ) endef From fdb8268fc99dd09f1c637290b6aa580119e801e8 Mon Sep 17 00:00:00 2001 From: Trammell hudson Date: Tue, 18 Sep 2018 13:07:14 -0400 Subject: [PATCH 13/18] remove coreboot-gcc target (it will be built anyway) and add x230 --- .circleci/config.yml | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 545fe0ce..30d6e22b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -47,13 +47,6 @@ jobs: BOARD=qemu-coreboot \ musl-cross - - run: - name: coreboot gcc - command: | - ./build/make-4.2.1/make \ - V=1 \ - BOARD=qemu-coreboot \ - coreboot-gcc \ - run: name: qemu-coreboot @@ -63,11 +56,13 @@ jobs: -j4 \ V=1 \ BOARD=qemu-coreboot \ + - store-artifacts: path: build/qemu-coreboot/coreboot.rom - store-artifacts: path: build/qemu-coreboot/hashes.txt + - run: name: qemu-linuxboot command: | @@ -75,11 +70,27 @@ jobs: -j4 \ V=1 \ BOARD=qemu-linuxboot \ + - store-artifacts: path: build/qemu-linuxboot/linuxboot.rom - store-artifacts: path: build/qemu-linuxboot/hashes.txt + + - run: + name: x230 + command: | + ./build/make-4.2.1/make \ + -j4 \ + V=1 \ + BOARD=x230 \ + + - store-artifacts: + path: build/x230/coreboot.rom + - store-artifacts: + path: build/x230/hashes.txt + + workflows: version: 2 build_and_test: From 66b51d3296569d55b174a7c7f4431f01d52321f7 Mon Sep 17 00:00:00 2001 From: Trammell hudson Date: Tue, 18 Sep 2018 13:07:40 -0400 Subject: [PATCH 14/18] quiet hashing process slightly --- Makefile | 12 +++++++----- modules/linux | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index ee1aa9f7..7ea55f22 100644 --- a/Makefile +++ b/Makefile @@ -137,7 +137,7 @@ $(error "$(BOARD): neither CONFIG_COREBOOT nor CONFIG_LINUXBOOT is set?") endif all: - sha256sum $< | tee -a "$(HASHES)" + @sha256sum $< | tee -a "$(HASHES)" # Disable all built in rules .INTERMEDIATE: @@ -192,10 +192,13 @@ define do-cpio = echo "$(DATE) UNCHANGED $(1:$(pwd)/%=%)" ; \ rm "$1.tmp" ; \ fi - $(call do,HASHES, $1,\ + @sha256sum "$1" | tee -a "$(HASHES)" + $(call do,HASHES , $1,\ ( cd "$2"; \ + echo "-----" ; \ find . -type f -print0 \ - | xargs -0 sha256sum \ + | xargs -0 sha256sum ; \ + echo "-----" ; \ ) >> "$(HASHES)" \ ) endef @@ -488,14 +491,13 @@ $(build)/$(initrd_dir)/initrd.cpio.xz: $(initrd-y) -9 \ | dd bs=512 conv=sync status=none > "$@.tmp" \ ) - sha256sum "$@" | tee -a "$(HASHES)" @if ! cmp --quiet "$@.tmp" "$@" ; then \ mv "$@.tmp" "$@" ; \ - sha256sum "$(@:$(pwd)/%=%)" ; \ else \ echo "$(DATE) UNCHANGED $(@:$(pwd)/%=%)" ; \ rm "$@.tmp" ; \ fi + @sha256sum "$(@:$(pwd)/%=%)" | tee -a "$(HASHES)" # # The heads.cpio is built from the initrd directory in the diff --git a/modules/linux b/modules/linux index 40a8d4c7..f8817935 100644 --- a/modules/linux +++ b/modules/linux @@ -155,7 +155,7 @@ $(build)/$(BOARD)/modules.cpio: $(build)/$(linux_dir)/.build $(build)/$(BOARD)/bzImage: $(build)/$(linux_dir)/.build $(call do-copy,$(dir $<)/$(linux_output),$@) @touch $@ # force a timestamp update - sha256sum "$@" | tee -a "$(HASHES)" + @sha256sum "$@" | tee -a "$(HASHES)" # menuconfig target allows us to easily reconfigure this Linux kernel From 866358d5c7c6297e8be627d0c8fcfa31f90f8636 Mon Sep 17 00:00:00 2001 From: Trammell hudson Date: Tue, 18 Sep 2018 15:12:41 -0400 Subject: [PATCH 15/18] rollback to 16.04? --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 30d6e22b..c5a03219 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2 jobs: build: docker: - - image: ubuntu:18.04 + - image: ubuntu:16.04 steps: - run: name: Install dependencies From 9ab033aa06ebca1b5272ed8e334fb516f0d8e308 Mon Sep 17 00:00:00 2001 From: Trammell hudson Date: Tue, 18 Sep 2018 15:59:48 -0400 Subject: [PATCH 16/18] use externally built coreboot compilers --- .circleci/config.yml | 18 ++++++++++-------- modules/coreboot | 25 ++++++++++++++++++++++--- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c5a03219..91732e56 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2 jobs: build: docker: - - image: ubuntu:16.04 + - image: osresearch/heads-ubuntu:16.04 steps: - run: name: Install dependencies @@ -36,25 +36,25 @@ jobs: - run: name: Bootstrap make command: | - make bootstrap + make -j4 bootstrap - run: - name: Bootstrap musl + name: Bootstrap coreboot-gcc command: | ./build/make-4.2.1/make \ - -j4 \ + TOOLCHAIN=/home/builder/heads \ V=1 \ BOARD=qemu-coreboot \ - musl-cross + coreboot-gcc - run: name: qemu-coreboot command: | ./build/make-4.2.1/make \ - TERM=dumb \ - -j4 \ + TOOLCHAIN=/home/builder/heads \ V=1 \ + -j4 \ BOARD=qemu-coreboot \ - store-artifacts: @@ -67,8 +67,9 @@ jobs: name: qemu-linuxboot command: | ./build/make-4.2.1/make \ - -j4 \ + TOOLCHAIN=/home/builder/heads \ V=1 \ + -j4 \ BOARD=qemu-linuxboot \ - store-artifacts: @@ -81,6 +82,7 @@ jobs: name: x230 command: | ./build/make-4.2.1/make \ + TOOLCHAIN=/home/builder/heads \ -j4 \ V=1 \ BOARD=x230 \ diff --git a/modules/coreboot b/modules/coreboot index 1326e9d6..79c38cd3 100644 --- a/modules/coreboot +++ b/modules/coreboot @@ -39,14 +39,33 @@ coreboot_target := \ coreboot_output := coreboot.rom coreboot_depend += linux initrd +COREBOOT_XGCC_REL := $(coreboot_base_dir)/util/crossgcc/xgcc +COREBOOT_XGCC_PATH := $(build)/$(COREBOOT_XGCC_REL) +COREBOOT_XGCC := $(COREBOOT_XGCC_PATH)/bin/i386-elf-gcc + # hack to force a build dependency on the cross compiler -coreboot-gcc: $(build)/$(coreboot_base_dir)/util/crossgcc/xgcc/bin/i386-elf-gcc -$(build)/$(coreboot_dir)/.configured: $(build)/$(coreboot_base_dir)/util/crossgcc/xgcc/bin/i386-elf-gcc -$(build)/$(coreboot_base_dir)/util/crossgcc/xgcc/bin/i386-elf-gcc: $(build)/$(coreboot_base_dir)/.canary +coreboot-gcc $(build)/$(coreboot_dir)/.configured: $(COREBOOT_XGCC) + +ifeq "$(TOOLCHAIN)" "" +# Force a rebuild of the entire coreboot toolchain +$(COREBOOT_XGCC): $(build)/$(coreboot_base_dir)/.canary echo '******* Building crossgcc-i386 (this might take a while) ******' $(MAKE) -C "$(build)/$(coreboot_base_dir)" CPUS=`nproc` crossgcc-i386 #echo '******* Building crossgcc-arm (this might take a while) ******' #$(MAKE) -C "$(build)/$(coreboot_base_dir)" crossgcc-arm +else +# Use the pre-build one from the external toolchain build +$(COREBOOT_XGCC): + if [ ! -e "$(TOOLCHAIN)/$(COREBOOT_XGCC_REL)" ]; then \ + echo >&2 "ERROR: TOOLCHAIN=$(TOOLCHAIN) does not have coreboot" ; \ + exit 1 ; \ + fi + if [ ! -e "$(COREBOOT_XGCC_PATH)" ]; then \ + ln -s \ + "$(TOOLCHAIN)/build/$(coreboot_base_dir)/util/crossgcc/xgcc" \ + "$(COREBOOT_XGCC_PATH)" ; \ + fi +endif # Force a rebuild if the inputs have changed $(build)/$(coreboot_dir)/.build: \ From 6183d58ecc2923df97ee9fccf8282df1af1ee03a Mon Sep 17 00:00:00 2001 From: Trammell hudson Date: Tue, 18 Sep 2018 16:04:28 -0400 Subject: [PATCH 17/18] fix config spacing and path to xgcc --- .circleci/config.yml | 10 +++++----- modules/coreboot | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 91732e56..c23a19e1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -42,7 +42,7 @@ jobs: name: Bootstrap coreboot-gcc command: | ./build/make-4.2.1/make \ - TOOLCHAIN=/home/builder/heads \ + TOOLCHAIN=/home/builder/heads \ V=1 \ BOARD=qemu-coreboot \ coreboot-gcc @@ -52,7 +52,7 @@ jobs: name: qemu-coreboot command: | ./build/make-4.2.1/make \ - TOOLCHAIN=/home/builder/heads \ + TOOLCHAIN=/home/builder/heads \ V=1 \ -j4 \ BOARD=qemu-coreboot \ @@ -67,9 +67,9 @@ jobs: name: qemu-linuxboot command: | ./build/make-4.2.1/make \ - TOOLCHAIN=/home/builder/heads \ + TOOLCHAIN=/home/builder/heads \ V=1 \ - -j4 \ + -j4 \ BOARD=qemu-linuxboot \ - store-artifacts: @@ -82,7 +82,7 @@ jobs: name: x230 command: | ./build/make-4.2.1/make \ - TOOLCHAIN=/home/builder/heads \ + TOOLCHAIN=/home/builder/heads \ -j4 \ V=1 \ BOARD=x230 \ diff --git a/modules/coreboot b/modules/coreboot index 79c38cd3..a021cf5c 100644 --- a/modules/coreboot +++ b/modules/coreboot @@ -56,13 +56,13 @@ $(COREBOOT_XGCC): $(build)/$(coreboot_base_dir)/.canary else # Use the pre-build one from the external toolchain build $(COREBOOT_XGCC): - if [ ! -e "$(TOOLCHAIN)/$(COREBOOT_XGCC_REL)" ]; then \ + if [ ! -e "$(TOOLCHAIN)/build/$(COREBOOT_XGCC_REL)" ]; then \ echo >&2 "ERROR: TOOLCHAIN=$(TOOLCHAIN) does not have coreboot" ; \ exit 1 ; \ fi if [ ! -e "$(COREBOOT_XGCC_PATH)" ]; then \ ln -s \ - "$(TOOLCHAIN)/build/$(coreboot_base_dir)/util/crossgcc/xgcc" \ + "$(TOOLCHAIN)/build/$(COREBOOT_XGCC_REL)" \ "$(COREBOOT_XGCC_PATH)" ; \ fi endif From aeb59e1b4852aea6aeb7f771e96d94d0ea2e1c9b Mon Sep 17 00:00:00 2001 From: Trammell hudson Date: Tue, 18 Sep 2018 16:06:35 -0400 Subject: [PATCH 18/18] coreboot must be extracted before the xgcc symlink --- modules/coreboot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/coreboot b/modules/coreboot index a021cf5c..b6c4a672 100644 --- a/modules/coreboot +++ b/modules/coreboot @@ -55,7 +55,7 @@ $(COREBOOT_XGCC): $(build)/$(coreboot_base_dir)/.canary #$(MAKE) -C "$(build)/$(coreboot_base_dir)" crossgcc-arm else # Use the pre-build one from the external toolchain build -$(COREBOOT_XGCC): +$(COREBOOT_XGCC): $(build)/$(coreboot_base_dir)/.canary if [ ! -e "$(TOOLCHAIN)/build/$(COREBOOT_XGCC_REL)" ]; then \ echo >&2 "ERROR: TOOLCHAIN=$(TOOLCHAIN) does not have coreboot" ; \ exit 1 ; \