[PATCH 1/3] Dockerfile: Build coreboot from source

To make CI runs rely less on external servers, build a coreboot release from source and populate /opt/coreboot with the output.
Signed-off-by: Tom Rini trini@konsulko.com --- tools/docker/Dockerfile | 11 +++++++++++ 1 file changed, 11 insertions(+)
diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile index 6122776bc64d..3d044657406e 100644 --- a/tools/docker/Dockerfile +++ b/tools/docker/Dockerfile @@ -231,6 +231,17 @@ RUN mkdir /tmp/trace && \ sudo make install && \ rm -rf /tmp/trace
+# Build coreboot +RUN wget -O - https://coreboot.org/releases/coreboot-4.22.01.tar.xz | tar -C /tmp -xJ && \ + cd /tmp/coreboot-4.22.01 && \ + make crossgcc-i386 CPUS=$(nproc) && \ + make -C payloads/coreinfo olddefconfig && \ + make -C payloads/coreinfo && \ + make olddefconfig && \ + make -j $(nproc) && \ + sudo mkdir /opt/coreboot && \ + sudo cp build/coreboot.rom build/cbfstool /opt/coreboot/ + # Create our user/group RUN echo uboot ALL=NOPASSWD: ALL > /etc/sudoers.d/uboot RUN useradd -m -U uboot

Instead of downloading coreboot binaries from a Google drive location, use the ones we have built ourselves.
Signed-off-by: Tom Rini trini@konsulko.com --- .azure-pipelines.yml | 7 +++---- .gitlab-ci.yml | 11 +++-------- 2 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index e2646783ee62..aebcc8908687 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -236,10 +236,9 @@ stages: cp images/spi-nor.img ${UBOOT_TRAVIS_BUILD_DIR}/; fi if [[ "${TEST_PY_BD}" == "coreboot" ]]; then - wget -O - "https://drive.google.com/uc?id=1uJ2VkUQ8czWFZmhJQ90Tp8V_zrJ6BrBH&export=..." |xz -dc >${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom; - wget -O - "https://drive.google.com/uc?id=149Cz-5SZXHNKpi9xg6R_5XITWohu348y&export=..." >cbfstool; - chmod a+x cbfstool; - ./cbfstool ${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom add-flat-binary -f ${UBOOT_TRAVIS_BUILD_DIR}/u-boot.bin -n fallback/payload -c LZMA -l 0x1110000 -e 0x1110000; + cp /opt/coreboot/coreboot.rom ${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom; + /opt/coreboot/cbfstool ${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom remove -n fallback/payload; + /opt/coreboot/cbfstool ${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom add-flat-binary -f ${UBOOT_TRAVIS_BUILD_DIR}/u-boot.bin -n fallback/payload -c LZMA -l 0x1110000 -e 0x1110000; fi virtualenv -p /usr/bin/python3 /tmp/venv . /tmp/venv/bin/activate diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 278a2e2bbf31..66f3cb14b03a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -70,14 +70,9 @@ stages: cp images/spi-nor.img ${UBOOT_TRAVIS_BUILD_DIR}/; fi - if [[ "${TEST_PY_BD}" == "coreboot" ]]; then - wget -O - - "https://drive.google.com/uc?id=1uJ2VkUQ8czWFZmhJQ90Tp8V_zrJ6BrBH&export=..." | - xz -dc >${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom; - wget -O - - "https://drive.google.com/uc?id=149Cz-5SZXHNKpi9xg6R_5XITWohu348y&export=..." > - cbfstool; - chmod a+x cbfstool; - ./cbfstool ${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom add-flat-binary -f ${UBOOT_TRAVIS_BUILD_DIR}/u-boot.bin -n fallback/payload -c LZMA -l 0x1110000 -e 0x1110000; + cp /opt/coreboot/coreboot.rom ${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom; + /opt/coreboot/cbfstool ${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom remove -n fallback/payload; + /opt/coreboot/cbfstool ${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom add-flat-binary -f ${UBOOT_TRAVIS_BUILD_DIR}/u-boot.bin -n fallback/payload -c LZMA -l 0x1110000 -e 0x1110000; fi - virtualenv -p /usr/bin/python3 /tmp/venv - . /tmp/venv/bin/activate

This moves us to our latest container image, which is now based on the current "Jammy" tag.
Signed-off-by: Tom Rini trini@konsulko.com --- .azure-pipelines.yml | 2 +- .gitlab-ci.yml | 2 +- tools/docker/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index aebcc8908687..7c3172610ee6 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -2,7 +2,7 @@ variables: windows_vm: windows-2019 ubuntu_vm: ubuntu-22.04 macos_vm: macOS-12 - ci_runner_image: trini/u-boot-gitlab-ci-runner:jammy-20240111-17Jan2024 + ci_runner_image: trini/u-boot-gitlab-ci-runner:jammy-20240125-12Feb2024 # Add '-u 0' options for Azure pipelines, otherwise we get "permission # denied" error when it tries to "useradd -m -u 1001 vsts_azpcontainer", # since our $(ci_runner_image) user is not root. diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 66f3cb14b03a..6ab3bb5ec2aa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,7 +10,7 @@ default:
# Grab our configured image. The source for this is found # in the u-boot tree at tools/docker/Dockerfile -image: ${MIRROR_DOCKER}/trini/u-boot-gitlab-ci-runner:jammy-20240111-17Jan2024 +image: ${MIRROR_DOCKER}/trini/u-boot-gitlab-ci-runner:jammy-20240125-12Feb2024
# We run some tests in different order, to catch some failures quicker. stages: diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile index 3d044657406e..274255456619 100644 --- a/tools/docker/Dockerfile +++ b/tools/docker/Dockerfile @@ -2,7 +2,7 @@ # This Dockerfile is used to build an image containing basic stuff to be used # to build U-Boot and run our test suites.
-FROM ubuntu:jammy-20240111 +FROM ubuntu:jammy-20240125 MAINTAINER Tom Rini trini@konsulko.com LABEL Description=" This image is for building U-Boot inside a container"

On Tue, Feb 13, 2024 at 09:39:26AM -0500, Tom Rini wrote:
To make CI runs rely less on external servers, build a coreboot release from source and populate /opt/coreboot with the output.
Signed-off-by: Tom Rini trini@konsulko.com
tools/docker/Dockerfile | 11 +++++++++++ 1 file changed, 11 insertions(+)
diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile index 6122776bc64d..3d044657406e 100644 --- a/tools/docker/Dockerfile +++ b/tools/docker/Dockerfile @@ -231,6 +231,17 @@ RUN mkdir /tmp/trace && \ sudo make install && \ rm -rf /tmp/trace
+# Build coreboot +RUN wget -O - https://coreboot.org/releases/coreboot-4.22.01.tar.xz | tar -C /tmp -xJ && \
- cd /tmp/coreboot-4.22.01 && \
- make crossgcc-i386 CPUS=$(nproc) && \
- make -C payloads/coreinfo olddefconfig && \
- make -C payloads/coreinfo && \
- make olddefconfig && \
- make -j $(nproc) && \
- sudo mkdir /opt/coreboot && \
- sudo cp build/coreboot.rom build/cbfstool /opt/coreboot/
And I forgot an "rm -rf /tmp/coreboot-4.22.01" at the end here which I'll add while merging if there's no further comments.
participants (1)
-
Tom Rini