Retry CircleCI for 4.11 on Debian 11 docker

- Add kgpe-d16 patch to remove HID for PCI devices (successful build on top of #1101 and #1012 per https://app.circleci.com/pipelines/github/tlaurion/heads/937/workflows/de49bea0-3f58-4a91-8891-87622f5a0eed)
- CircleCI modified to build for coreboot 4.11 kgpe-d16_workstation on top of 4.15 passed workspace
- CircleCI modified so that we still archive all the logs in artifacts for the current build even if failing. We now exit 1 after having archived all the log files under build/
- Add xx30 vbios extract scripts to test. Expecting musl-cross target to fail since make and gawk aren't built
- CircleCI: gawk was not installed in apt statements under Debian. Installing
- Makefile: seperate and fix local make and gawk building pror of using. Otherwise, impossible to build musl-cross target seperatly.
  - Also give some debugging info at start of Heads builds to tell which local gawk and make are used, also telling which make call will be propagated in the rest of the builds
  - Fix gawk version checking, reporting bad version even if 4.2.1 as expected on debian-10 (debian-10 OS deploys gawk and make in version 4.2.1)
- CircleCI: Changing musl-cross taget to bootstrap (gawk+make) and musl-cross-make (bootstrap_musl-cross-make) for clarity
This commit is contained in:
Thierry Laurion 2022-01-31 10:57:24 -05:00 committed by tlaurion
parent 4b260071c3
commit f9d143d77a
4 changed files with 82 additions and 76 deletions

View File

@ -13,7 +13,7 @@ commands:
command: |
ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime
apt update
apt install -y build-essential zlib1g-dev uuid-dev libdigest-sha-perl libelf-dev bc bzip2 bison flex git gnupg iasl m4 nasm patch python python2 python3 wget gnat cpio ccache pkg-config cmake libusb-1.0-0-dev autoconf texinfo ncurses-dev doxygen graphviz udev libudev1 libudev-dev automake libtool rsync innoextract sudo
apt install -y build-essential zlib1g-dev uuid-dev libdigest-sha-perl libelf-dev bc bzip2 bison flex git gnupg gawk iasl m4 nasm patch python python2 python3 wget gnat cpio ccache pkg-config cmake libusb-1.0-0-dev autoconf texinfo ncurses-dev doxygen graphviz udev libudev1 libudev-dev automake libtool rsync innoextract sudo
- run:
name: Make Board
command: |
@ -37,7 +37,7 @@ commands:
jobs:
prep_env:
docker:
- image: debian:10
- image: debian:11
resource_class: large
steps:
- run:
@ -45,7 +45,7 @@ jobs:
command: |
ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime
apt update
apt install -y build-essential zlib1g-dev uuid-dev libdigest-sha-perl libelf-dev bc bzip2 bison flex git gnupg iasl m4 nasm patch python python2 python3 wget gnat cpio ccache pkg-config cmake libusb-1.0-0-dev autoconf texinfo ncurses-dev doxygen graphviz udev libudev1 libudev-dev automake libtool rsync innoextract sudo
apt install -y build-essential zlib1g-dev uuid-dev libdigest-sha-perl libelf-dev bc bzip2 bison flex git gnupg gawk iasl m4 nasm patch python python2 python3 wget gnat cpio ccache pkg-config cmake libusb-1.0-0-dev autoconf texinfo ncurses-dev doxygen graphviz udev libudev1 libudev-dev automake libtool rsync innoextract sudo
- checkout
- run:
@ -112,7 +112,7 @@ jobs:
build_and_persist:
docker:
- image: debian:10
- image: debian:11
resource_class: large
parameters:
target:
@ -132,7 +132,7 @@ jobs:
build:
docker:
- image: debian:10
- image: debian:11
resource_class: large
parameters:
target:
@ -148,7 +148,7 @@ jobs:
save_cache:
docker:
- image: debian:10
- image: debian:11
resource_class: large
steps:
- attach_workspace:
@ -192,9 +192,9 @@ workflows:
# Prerequisites
- build_and_persist:
name: heads_musl-cross
name: bootstrap_musl-cross-make
target: x230-hotp-maximized
subcommand: musl-cross
subcommand: bootstrap musl-cross
requires:
- prep_env
@ -204,7 +204,7 @@ workflows:
target: x230-hotp-maximized
subcommand: ""
requires:
- heads_musl-cross
- bootstrap_musl-cross-make
# Coreboot 4.15
- build_and_persist:

134
Makefile
View File

@ -39,39 +39,72 @@ BUILD_LOG := $(shell mkdir -p "$(log_dir)" )
WGET ?= wget
# Timestamps should be in ISO format
DATE=`date --rfc-3339=seconds`
# 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)
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
# Check we have a suitable version of gawk
# that's at least the same major version
LOCAL_GAWK_VERSION := $(shell gawk --version 2>/dev/null | head -1 | cut -d' ' -f3 | cut -d, -f1)
LOCAL_GAWK_MAJOR_VERSION := $(patsubst .%,.,$(LOCAL_GAWK_VERSION))
include modules/gawk
# Wrong version
ifeq "" "$(filter $(LOCAL_GAWK_MAJOR_VERSION).%,$(gawk_version))"
ifeq "" "$(filter $(make_version)%,$(LOCAL_MAKE_VERSION))"
# This is incorrect local version of make
# Wrong make version detected -- build our local version
# and re-invoke the Makefile with it instead.
$(eval $(shell echo >&2 "$(DATE) Wrong OS deployed make detected: $(LOCAL_MAKE_VERSION). Building and using $(make_version)..." ))
HEADS_MAKE := $(build)/$(make_dir)/make
# How to download and build the correct version of make
$(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: $(build)/$(make_dir)/.extract
( cd "$(dir $@)" ; patch -p1 ) < "patches/make-$(make_version).patch"
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)
# Once we have a proper Make, we can just pass arguments into it
all linux cpio run: $(HEADS_MAKE)
LANG=C MAKE=$(HEADS_MAKE) $(HEADS_MAKE) $(MAKE_JOBS) $@
%.clean %.vol %.menuconfig: $(HEADS_MAKE)
LANG=C MAKE=$(HEADS_MAKE) $(HEADS_MAKE) $@
bootstrap: $(HEADS_MAKE)
endif
# Wrong gawk version
ifeq "" "$(filter $(LOCAL_GAWK_MAJOR_VERSION)%,$(gawk_version))"
# Wrong gawk version detected -- build our local version
# and re-invoke the Makefile with it instead.
$(eval $(shell echo >&2 "$(DATE) Wrong gawk detected: $(LOCAL_GAWK_VERSION)"))
$(eval $(shell echo >&2 "$(DATE) Wrong OS deployed gawk detected: $(LOCAL_GAWK_VERSION). Building and using $(gawk_version)..."))
HEADS_GAWK := $(build)/$(gawk_dir)/gawk
# Once we have a suitable version of gawk, we can rerun make
all linux cpio run: $(HEADS_GAWK)
LANG=C HEADS_GAWK=$(HEADS_GAWK) $(MAKE) $(MAKE_JOBS) $@
%.clean %.vol %.menuconfig: $(HEADS_GAWK)
LANG=C HEADS_GAWK=$(HEADS_GAWK) $(MAKE) $@
bootstrap: $(HEADS_GAWK)
# How to download and build the correct version of gawk
$(packages)/$(gawk_tar):
$(WGET) -O "$@.tmp" "$(gawk_url)"
@ -100,8 +133,15 @@ $(HEADS_GAWK): $(build)/$(gawk_dir)/.configured
2>&1 \
| tee "$(log_dir)/gawk.log" \
$(VERBOSE_REDIRECT)
endif
# Once we have a suitable version of gawk, we can rerun make
all linux cpio run: $(HEADS_GAWK)
LANG=C HEADS_GAWK=$(HEADS_GAWK) $(MAKE) $(MAKE_JOBS) $@
%.clean %.vol %.menuconfig: $(HEADS_GAWK)
LANG=C HEADS_GAWK=$(HEADS_GAWK) $(MAKE) $@
bootstrap: $(HEADS_GAWK)
endif
BOARD ?= qemu-coreboot
CONFIG := $(pwd)/boards/$(BOARD)/$(BOARD).config
@ -189,6 +229,16 @@ ifneq "$(HEADS_GAWK)" ""
CROSS_TOOLS_NOCC += AWK=$(HEADS_GAWK)
endif
ifneq "$(HEADS_MAKE)" ""
MAKE=$(HEADS_MAKE)
endif
#Some debugging info in link with locally built versions and usage for the rest Heads build:
$(eval $(shell echo >&2 "$(DATE) Local built HEADS_GAWK only if different then provided by OS: $(HEADS_GAWK)"))
$(eval $(shell echo >&2 "$(DATE) Local built HEADS_MAKE only if different then provided by OS: $(HEADS_MAKE)"))
$(eval $(shell echo >&2 "$(DATE) Heads build system will call make from now on as: MAKE: $(MAKE)." ))
CROSS_TOOLS := \
CC="$(heads_cc)" \
$(CROSS_TOOLS_NOCC) \
@ -655,49 +705,3 @@ real.clean:
fi; \
done
cd install && rm -rf -- *
else
# Wrong make version detected -- build our local version
# and re-invoke the Makefile with it instead.
$(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 linux cpio run: $(HEADS_MAKE)
LANG=C MAKE=$(HEADS_MAKE) $(HEADS_MAKE) $(MAKE_JOBS) $@
%.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
$(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: $(build)/$(make_dir)/.extract
( cd "$(dir $@)" ; patch -p1 ) < "patches/make-$(make_version).patch"
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)
endif

View File

@ -17,7 +17,8 @@ extractdir=$(mktemp -d)
cd "$extractdir"
echo "### Installing basic dependencies"
sudo apt update && sudo apt install -y wget ruby ruby-dev ruby-bundler p7zip-full upx-ucl
sudo apt update && sudo apt install -y wget ruby ruby-dev bundler ruby-bundler p7zip-full upx-ucl
sudo gem install bundler:1.17.3
echo "### Downloading rom-parser dependency"
wget https://github.com/awilliam/rom-parser/archive/"$ROMPARSER".zip

View File

@ -18,7 +18,8 @@ extractdir=$(mktemp -d)
cd "$extractdir"
echo "### Installing basic dependencies"
sudo apt update && sudo apt install -y wget ruby ruby-dev ruby-bundler p7zip-full upx-ucl
sudo apt update && sudo apt install -y wget ruby ruby-dev bundler ruby-bundler p7zip-full upx-ucl
sudo gem install bundler:1.17.3
echo "### Downloading rom-parser dependency"
wget https://github.com/awilliam/rom-parser/archive/"$ROMPARSER".zip