Dockerfile: Build coreboot from source
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.
--- tools/docker/Dockerfile | 11 +++++++++++ 1 file changed, 11 insertions(+)
tools/docker/Dockerfile +11 -0
@@ -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
Signature · 1 line
2.34.1
PATCH 2/3 CI: Switch to using coreboot from our image
Instead of downloading coreboot binaries from a Google drive location, use the ones we have built ourselves.
--- .azure-pipelines.yml | 7 +++---- .gitlab-ci.yml | 11 +++-------- 2 files changed, 6 insertions(+), 12 deletions(-)
.azure-pipelines.yml +3 -4
@@ -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=download" |xz -dc >\${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom; - wget -O - "https://drive.google.com/uc?id=149Cz-5SZXHNKpi9xg6R_5XITWohu348y&export=download" >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
.gitlab-ci.yml +3 -8
@@ -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=download" | - xz -dc >${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom; - wget -O - - "https://drive.google.com/uc?id=149Cz-5SZXHNKpi9xg6R_5XITWohu348y&export=download" > - 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
Signature · 1 line
2.34.1
PATCH 3/3 CI: Move to latest container image
In reply to Tom RiniThis moves us to our latest container image, which is now based on the current "Jammy" tag.
--- .azure-pipelines.yml | 2 +- .gitlab-ci.yml | 2 +- tools/docker/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
.azure-pipelines.yml +1 -1
@@ -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.
.gitlab-ci.yml +1 -1
@@ -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:
tools/docker/Dockerfile +1 -1
@@ -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 <[email protected]> LABEL Description=" This image is for building U-Boot inside a container"
Signature · 1 line
2.34.1
Quoted 16 lines · Tom Rini
To make CI runs rely less on external servers, build a coreboot release from source and populate
/opt/corebootwith the output.Signed-off-by Tom Rini <[email protected]>--- tools/docker/Dockerfile | 11 +++++++++++ 1 file changed, 11 insertions(+)tools/docker/Dockerfile +0
-0@@ -231,6 +231,17 @@ RUN mkdir /tmp/trace && \ sudo make install && \ rm -rf /tmp/trace
tools/docker/Dockerfile RUN mkdir /tmp/trace && \ · line 243
Quoted 10 lines
tools/docker/Dockerfile +10
-0+# 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.
Signature · 1 line
Tom
Quoted 4 lines · Tom Rini
To make CI runs rely less on external servers, build a coreboot release from source and populate
/opt/corebootwith the output.
Applied to u-boot/master, thanks!
Signature · 1 line
Tom