Martin Roth (martinroth(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18001
-gerrit
commit 021026ff654887edb60b377647a513e2dac4a456
Author: Martin Roth <gaumless(a)gmail.com>
Date: Fri Dec 30 17:00:19 2016 -0700
util/docker: Update dockerfiles & build method
All files:
- Previously, various things were hardcoded into the docker containers
that made it necessary to update the Dockerfile files for each new
version of the sdk. Turn those into 'Variables" that are updated during
the build step. Because the makefile is piping the dockerfile through
the sed command and back into the docker build command, the normal
docker "COPY" keyword doesn't work.
coreboot-jenkins-node changes:
- Run ssh-keygen -A to explicitly generate the ssh keys. This fixes an
error: Could not load host key: /etc/ssh/ssh_host_dsa_key
coreboot-sdk changes:
- Remove apt-get upgrade command - The Dockerfile guide recommends
not to run this.
- Change libssl-dev to libssl1.0-dev. libssl-dev's header files won't
build the Chrome-EC codebase.
- Add libisl-dev, needed to build the riscv toolchain.
- Build the toolchain using the -b option
- Add environment variables containing the version and commit that the
coreboot-sdk was built from.
Makefile:
- Update targets to use the version and commit variables
Change-Id: I2c1376fe4b791da2a62fca11bc92c4774cbef1c8
Signed-off-by: Martin Roth <gaumless(a)gmail.com>
---
util/docker/Makefile | 31 +++++++++++++++++++++-------
util/docker/coreboot-jenkins-node/Dockerfile | 30 +++++++++++++++++++++------
util/docker/coreboot-sdk/Dockerfile | 27 ++++++++++++++++++------
3 files changed, 69 insertions(+), 19 deletions(-)
diff --git a/util/docker/Makefile b/util/docker/Makefile
index f669b93..7df6851 100644
--- a/util/docker/Makefile
+++ b/util/docker/Makefile
@@ -14,7 +14,13 @@
##
export top=$(abspath $(CURDIR)/../..)
export crossgcc_version=$(shell $(top)/util/crossgcc/buildgcc --version | grep 'cross toolchain' | sed 's/^.*\sv//' | sed 's/\s.*$$//')
-export DOCKER:=$(shell env sh -c "command -v docker")
+export DOCKER:=$(shell $(SHELL) -c "command -v docker")
+
+# Version of the jenkins / sdk container
+export COREBOOT_CONTAINER_VERSION?=$(crossgcc_version)
+
+# Commit id to build from
+export DOCKER_COMMIT?=$(shell git log -n 1 --pretty=%h)
test-docker:
$(if $(DOCKER),,\
@@ -28,16 +34,23 @@ test-docker-login: test-docker
$(error Docker authentication file not found. Run 'docker login'))
coreboot-sdk: test-docker
- $(DOCKER) build -t coreboot/coreboot-sdk:$(crossgcc_version) coreboot-sdk
+ @echo "Building coreboot SDK $(crossgcc_version) from commit $(DOCKER_COMMIT)"
+ cat coreboot-sdk/Dockerfile | \
+ sed "s/{{DOCKER_COMMIT}}/$(DOCKER_COMMIT)/" | \
+ sed "s/{{SDK_VERSION}}/$(COREBOOT_CONTAINER_VERSION)/" | \
+ $(DOCKER) build -t coreboot/coreboot-sdk:$(COREBOOT_CONTAINER_VERSION) -
upload-coreboot-sdk: test-docker-login
- $(DOCKER) push coreboot/coreboot-sdk:$(crossgcc_version)
+ $(DOCKER) push coreboot/coreboot-sdk:$(COREBOOT_CONTAINER_VERSION)
coreboot-jenkins-node: test-docker
- $(DOCKER) build -t coreboot/coreboot-jenkins-node:$(crossgcc_version) coreboot-jenkins-node
+ cat coreboot-jenkins-node/Dockerfile | \
+ sed "s/{{SDK_VERSION}}/$(COREBOOT_CONTAINER_VERSION)/" | \
+ sed "s|{{SSH_KEY}}|$$(cat coreboot-jenkins-node/authorized_keys)|" | \
+ $(DOCKER) build -t coreboot/coreboot-jenkins-node:$(COREBOOT_CONTAINER_VERSION) -
upload-coreboot-jenkins-node: test-docker-login
- $(DOCKER) push coreboot/coreboot-jenkins-node:$(crossgcc_version)
+ $(DOCKER) push coreboot/coreboot-jenkins-node:$(COREBOOT_CONTAINER_VERSION)
docker-killall: test-docker
@if [ -n "$$($(DOCKER) ps | grep 'coreboot')" ]; then \
@@ -52,7 +65,7 @@ clean-coreboot-images: docker-killall
docker-build-coreboot: test-docker
$(DOCKER) run -u root -it -v $(top):/home/coreboot/coreboot \
- --rm coreboot/coreboot-sdk:$(crossgcc_version) \
+ --rm coreboot/coreboot-sdk:$(COREBOOT_CONTAINER_VERSION) \
/bin/bash -c "cd /home/coreboot/coreboot && \
make clean && \
make $(BUILD_CMD)"
@@ -62,7 +75,7 @@ docker-build-coreboot: test-docker
docker-abuild: test-docker
$(DOCKER) run -u root -it -v $(top):/home/coreboot/coreboot \
- --rm coreboot/coreboot-sdk:$(crossgcc_version) \
+ --rm coreboot/coreboot-sdk:$(COREBOOT_CONTAINER_VERSION) \
/bin/bash -c "cd /home/coreboot/coreboot && \
make clean && \
util/abuild/abuild $(ABUILD_ARGS)"
@@ -82,6 +95,10 @@ help:
@echo "Commands for using docker images"
@echo " docker-build-coreboot <BUILD_CMD=target> - Build coreboot under coreboot-sdk"
@echo " docker-abuild <ABUILD_ARGS='-a -B'> - Run abuild under coreboot-sdk"
+ @echo
+ @echo "Variables:"
+ @echo " COREBOOT_CONTAINER_VERSION = $(COREBOOT_CONTAINER_VERSION)"
+ @echo " DOCKER_COMMIT = $(DOCKER_COMMIT)"
.PHONY: test-docker test-docker-login
.PHONY: coreboot-jenkins-node upload-coreboot-jenkins-node
diff --git a/util/docker/coreboot-jenkins-node/Dockerfile b/util/docker/coreboot-jenkins-node/Dockerfile
index b60466d..230842c 100644
--- a/util/docker/coreboot-jenkins-node/Dockerfile
+++ b/util/docker/coreboot-jenkins-node/Dockerfile
@@ -1,5 +1,20 @@
-FROM coreboot/coreboot-sdk:1.42
-MAINTAINER Martin Roth <gaumless(a)gmail.com>
+# This dockerfile is not meant to be used directly by docker. The
+# {{}} varibles are replaced with values by the makefile. Please generate
+# the docker image for this file by running:
+#
+# make coreboot-jenkins-node
+#
+# Variables can be updated on the make command line or left blank to use
+# the default values set by the makefile.
+#
+# SDK_VERSION is used to name the version of the coreboot sdk to use.
+# Typically, this corresponds to the toolchain version.
+# SSH_KEY is the contents of the file coreboot-jenkins-node/authorized_keys
+# Because we're piping the contents of the dockerfile into the
+# docker build command, the 'COPY' keyword isn't valid.
+
+FROM coreboot/coreboot-sdk:{{SDK_VERSION}}
+MAINTAINER Martin Roth <martin(a)coreboot.org>
USER root
# Check to make sure /dev is a tmpfs file system
@@ -10,13 +25,17 @@ RUN apt-get -y update && \
lua5.3 liblua5.3-dev openjdk-8-jre-headless openssh-server && \
apt-get clean
-COPY authorized_keys /home/coreboot/.ssh/authorized_keys
-RUN chown -R coreboot /home/coreboot/.ssh && \
+# Because of the way that the variables are being replaced, docker's 'COPY'
+# command does not work
+RUN mkdir -p /home/coreboot/.ssh && \
+ echo "{{SSH_KEY}}" > /home/coreboot/.ssh/authorized_keys && \
+ chown -R coreboot:coreboot /home/coreboot/.ssh && \
chmod 0700 /home/coreboot/.ssh && \
chmod 0600 /home/coreboot/.ssh/authorized_keys
RUN mkdir /var/run/sshd && \
- chmod 0755 /var/run/sshd
+ chmod 0755 /var/run/sshd && \
+ /usr/bin/ssh-keygen -A
# Build encapsulate tool
ADD https://raw.githubusercontent.com/pgeorgi/encapsulate/master/encapsulate.c /tmp/encapsulate.c
@@ -24,7 +43,6 @@ RUN gcc -o /usr/sbin/encapsulate /tmp/encapsulate.c && \
chown root /usr/sbin/encapsulate && \
chmod +s /usr/sbin/encapsulate
-
VOLUME /data/cache
ENTRYPOINT mkdir /dev/cb-build && chown coreboot /dev/cb-build && /usr/sbin/sshd -p 49151 -D
EXPOSE 49151
diff --git a/util/docker/coreboot-sdk/Dockerfile b/util/docker/coreboot-sdk/Dockerfile
index cb0023c..feaf843 100644
--- a/util/docker/coreboot-sdk/Dockerfile
+++ b/util/docker/coreboot-sdk/Dockerfile
@@ -1,26 +1,39 @@
+# This dockerfile is not meant to be used directly by docker. The
+# {{}} varibles are replaced with values by the makefile. Please generate
+# the docker image for this file by running:
+#
+# make coreboot-sdk
+#
+# Variables can be updated on the make command line or left blank to use
+# the default values set by the makefile.
+#
+# SDK_VERSION is used to name the version of the coreboot sdk to use.
+# Typically, this corresponds to the toolchain version. This
+# is used to identify this docker image.
+# DOCKER_COMMIT is the coreboot Commit-ID to build the toolchain from.
+
FROM debian:sid
-MAINTAINER Martin Roth <gaumless(a)gmail.com>
+MAINTAINER Martin Roth <martin(a)coreboot.org>
RUN \
useradd -p locked -m coreboot && \
apt-get -qq update && \
- apt-get -qq upgrade && \
apt-get -qqy install gcc g++ make patch python diffutils bison flex \
git doxygen ccache subversion p7zip-full unrar-free \
m4 wget curl bzip2 vim-common cmake xz-utils pkg-config \
dh-autoreconf unifont \
- libssl-dev libgmp-dev zlib1g-dev libpci-dev liblzma-dev \
+ libssl1.0-dev libgmp-dev zlib1g-dev libpci-dev liblzma-dev \
libyaml-dev libncurses5-dev uuid-dev libusb-dev libftdi-dev \
libusb-1.0-0-dev libreadline-dev libglib2.0-dev libgmp-dev \
- libelf-dev libxml2-dev libfreetype6-dev && \
+ libelf-dev libxml2-dev libfreetype6-dev libisl-dev && \
apt-get clean
RUN \
cd /root && \
git clone http://review.coreboot.org/coreboot && \
cd coreboot/util/crossgcc && \
- git checkout 589ef9de8fa && \
- make all_without_gdb CPUS=$(nproc) DEST=/opt/xgcc && \
+ git checkout {{DOCKER_COMMIT}} && \
+ make all_without_gdb CPUS=$(nproc) DEST=/opt/xgcc BUILDGCC_OPTIONS=-b && \
cd /root && \
rm -rf coreboot
@@ -31,4 +44,6 @@ RUN mkdir /home/coreboot/.ccache && \
VOLUME /home/coreboot/.ccache
ENV PATH $PATH:/opt/xgcc/bin
+ENV SDK_VERSION={{SDK_VERSION}}
+ENV SDK_COMMIT={{DOCKER_COMMIT}}
USER coreboot
the following patch was just integrated into master:
commit 047c2f44b00c49f32d7eb7eb111d83dee882218f
Author: Martin Roth <martinroth(a)google.com>
Date: Wed Dec 14 10:16:26 2016 -0700
util/abuild: Print list of failed boards at the end of the abuild
When running abuild outside of jenkins, because all of the builds are
printed intermixed, it's easy to miss when a board has failed the build
by looking at the output. This saves a list of failed builds and prints
the list at the end of the run.
- Add a command line option to mark when abuild is being called
recursively.
- Add all failed builds to a list.
- Print the list when a non-recursive abuild run exits.
Change-Id: Icb40ed8083a57bbcde49297d2b0814f98dcbb6c8
Signed-off-by: Martin Roth <martinroth(a)google.com>
Reviewed-on: https://review.coreboot.org/17890
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h(a)gmx.de>
See https://review.coreboot.org/17890 for details.
-gerrit
the following patch was just integrated into master:
commit e6bd18f6b527ed7760de097e528d47d9d5865734
Author: Sebastian 'Swift Geek' Grzywna <swiftgeek(a)gmail.com>
Date: Sun Jan 8 03:42:30 2017 +0100
util/autoport: Fix gfx dump of log_maker
Variable name of inteltoolArgs was fixed.
The way of passing arguments to inteltool was changed from "-a -f"
to "-af" which is better as the string seems to be parsed
as a single argument.
Change-Id: I0c48fb1e912261748ba9e2b91c291bac28b9e856
Signed-off-by: Sebastian 'Swift Geek' Grzywna <swiftgeek(a)gmail.com>
Reviewed-on: https://review.coreboot.org/18050
Reviewed-by: Stefan Tauner <stefan.tauner(a)gmx.at>
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h(a)gmx.de>
See https://review.coreboot.org/18050 for details.
-gerrit
the following patch was just integrated into master:
commit ed840023a84915ece4bc63edffef979926107d55
Author: Robbie Zhang <robbie.zhang(a)intel.com>
Date: Fri Dec 23 11:43:07 2016 -0800
chromeos: Implement locating and decoding wifi sar data from VPD
A VPD entry "wifi_sar" needs to be created which contains a heximal
encoded string in length of 40 bytes. get_wifi_sar_limits() function
retrieves and decodes the data from the VPD entry, which would later
be consumed by platform code.
BUG=chrome-os-partner:60821
TEST=Build and boot lars and reef
Change-Id: I923b58a63dc1f8a7fdd685cf1c618b2fdf4e7061
Signed-off-by: Robbie Zhang <robbie.zhang(a)intel.com>
Reviewed-on: https://review.coreboot.org/17958
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
See https://review.coreboot.org/17958 for details.
-gerrit