[PATCH 0/5] docker: Update Docker image and fix trace test
From: Simon Glass <simon.glass@canonical.com> Update the CI Docker image for build compatibility: - Pin trace-cmd libraries to pre-BTF versions for Jammy - Update coreboot from 24.08 to 24.12 - Add Arm FVP platform and vexpress test support - Install Rust toolchain for ulib example builds Fix the trace test to handle the new trace-cmd output format which appends caller information to function trace lines. Simon Glass (3): docker: Install Rust toolchain for ulib examples docker: Update Dockerfile for build compatibility test: trace: Handle trace-cmd caller-info output format Tom Rini (2): Dockerfile: Download the Arm FVP and extract it Docker, CI: Add vexpress_fvp / vexpress_fvp_bloblist support .gitlab-ci.yml | 2 +- test/py/tests/test_trace.py | 9 +++--- tools/docker/Dockerfile | 56 +++++++++++++++++++++++++++++-------- 3 files changed, 50 insertions(+), 17 deletions(-) -- 2.43.0 base-commit: c3b3dd0245d3437ba28a2f9110a88a1351c50ba7 branch: dock
From: Tom Rini <trini@konsulko.com> There are some reference platforms from Arm which are not found in QEMU but instead in the FVP tool. As we can make use of this in CI later on, download and extract it in our Dockerfile today. Signed-off-by: Tom Rini <trini@konsulko.com> (cherry picked from commit 01fa1b18ae68381d9d462be66df3943f41426874) Signed-off-by: Simon Glass <simon.glass@canonical.com> --- tools/docker/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile index a30b670b300..0f0c290c232 100644 --- a/tools/docker/Dockerfile +++ b/tools/docker/Dockerfile @@ -241,6 +241,9 @@ RUN git clone https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git /tmp/t cp fiptool /usr/local/bin && \ rm -rf /tmp/tf-a +# Download the Arm Architecture FVP platform. This file is double compressed. +RUN wget -O - https://developer.arm.com/-/cdn-downloads/permalink/FVPs-Architecture/FM-11.... | gunzip -dc | tar -C /opt -x + # Build genimage (required by some targets to generate disk images) RUN wget -O - https://github.com/pengutronix/genimage/releases/download/v14/genimage-14.ta... | tar -C /tmp -xJ && \ cd /tmp/genimage-14 && \ -- 2.43.0
From: Tom Rini <trini@konsulko.com> This adds the vexpress_fvp and vexpress_fvp_bloblist platforms to the list of platforms we test via emulator in CI. In order to do this we need to first have our container runtime have TF-A builds for the vexpress_fvp platform, both with and without transfer list support as well as installing "telnet" so that we can access console. In the CI files we check for the existence of /opt/tf-a/${TEST_PY_BD} and if found, copy bl1.bin and fip.bin to /tmp and set the variables so that we can later run FVP to run. Note that we currently disable the hostfs (semihosting) tests as they trigger a bug in FVP. This has been reported upstream, and can be enabled when fixed. Reviewed-by: Harrison Mutai <harrison.mutai@arm.com> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Tom Rini <trini@konsulko.com> (cherry picked from commit d75998b476de439a05b2f7ec95d426410bcaae18) Signed-off-by: Simon Glass <simon.glass@canonical.com> --- tools/docker/Dockerfile | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile index 0f0c290c232..b804df03e16 100644 --- a/tools/docker/Dockerfile +++ b/tools/docker/Dockerfile @@ -87,6 +87,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ help2man \ iasl \ imagemagick \ + inetutils-telnet \ iputils-ping \ libconfuse-dev \ libgit2-dev \ @@ -234,11 +235,19 @@ RUN git clone https://gitlab.com/qemu-project/qemu.git /tmp/qemu && \ # Build fiptool RUN git clone https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git /tmp/tf-a && \ cd /tmp/tf-a/ && \ - git checkout v2.10.0 && \ - cd tools/fiptool && \ - make -j$(nproc) && \ - mkdir -p /usr/local/bin && \ - cp fiptool /usr/local/bin && \ + git checkout v2.12.0 && \ + make CROSS_COMPILE=/opt/gcc-${TCVER}-nolibc/aarch64-linux/bin/aarch64-linux- \ + PLAT=fvp BL33=/dev/null -j$(nproc) all fip && \ + mkdir -p /usr/local/bin /opt/tf-a/vexpress_fvp && \ + cp tools/fiptool/fiptool /usr/local/bin && \ + cp build/fvp/release/fip.bin build/fvp/release/bl1.bin \ + /opt/tf-a/vexpress_fvp/ && \ + rm -rf build/fvp && \ + make CROSS_COMPILE=/opt/gcc-${TCVER}-nolibc/aarch64-linux/bin/aarch64-linux- \ + PLAT=fvp BL33=/dev/null TRANSFER_LIST=1 -j$(nproc) all fip && \ + mkdir -p /opt/tf-a/vexpress_fvp_bloblist && \ + cp build/fvp/release/fip.bin build/fvp/release/bl1.bin \ + /opt/tf-a/vexpress_fvp_bloblist/ && \ rm -rf /tmp/tf-a # Download the Arm Architecture FVP platform. This file is double compressed. -- 2.43.0
From: Simon Glass <simon.glass@canonical.com> The ulib Rust demo requires cross-compilation targets that are not present in the CI Docker image. Install rustup with the minimal profile and add the four targets needed by the Rust demo builds: - i686-unknown-linux-gnu (qemu-x86) - x86_64-unknown-none (qemu-x86_64, efi-x86_app64) - riscv64gc-unknown-none-elf (qemu-riscv64, efi-riscv_app64) - aarch64-unknown-none (efi-arm_app64) Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Simon Glass <simon.glass@canonical.com> --- tools/docker/Dockerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile index b804df03e16..71932e5433c 100644 --- a/tools/docker/Dockerfile +++ b/tools/docker/Dockerfile @@ -315,6 +315,16 @@ RUN echo uboot ALL=NOPASSWD: ALL > /etc/sudoers.d/uboot RUN useradd -m -U uboot USER uboot:uboot +# Install Rust toolchain with cross-compilation targets for ulib examples +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \ + sh -s -- -y --default-toolchain stable --profile minimal && \ + . $HOME/.cargo/env && \ + rustup target add \ + aarch64-unknown-none \ + i686-unknown-linux-gnu \ + riscv64gc-unknown-none-elf \ + x86_64-unknown-none +ENV PATH="/home/uboot/.cargo/bin:${PATH}" # Populate the cache for pip to use. Get these via wget as the # COPY / ADD directives don't work as we need them to. -- 2.43.0
From: Simon Glass <simon.glass@canonical.com> Pin trace-cmd dependencies to avoid libtraceevent 1.9+ which requires BTF kernel headers newer than Jammy's 5.15: - libtraceevent: b3f5849 (pre-BTF) - libtracefs: 1.8.1 - trace-cmd: 364faec Install libtraceevent/libtracefs with prefix=/usr and ldconfig for cross-platform library path compatibility (arm64 vs amd64). Update coreboot from 24.08 to 24.12 since Intel took down the ACPICA download used by 24.08. Make a few other changes to bring us in line with upstream commit d75998b476de ("Docker, CI: Add vexpress_fvp / vexpress_fvp_bloblist support") Update .gitlab-ci.yml to use the new image tag. Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Simon Glass <simon.glass@canonical.com> --- .gitlab-ci.yml | 2 +- tools/docker/Dockerfile | 24 ++++++++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0b6ca99a8ba..648c3f52c44 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,7 +27,7 @@ default: - ${DEFAULT_TAG} # Grab our configured image. The source for this is found # in the u-boot tree at tools/docker/Dockerfile - image: ${MIRROR_DOCKER}/sjg20/u-boot-gitlab-ci-runner:jammy-20250404-24Oct2025p1 + image: ${MIRROR_DOCKER}/sjg20/u-boot-gitlab-ci-runner:jammy-20250404-19feb26 services: - name: container-$(CI_JOB_ID) command: ["--rm"] diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile index 71932e5433c..90ad3708101 100644 --- a/tools/docker/Dockerfile +++ b/tools/docker/Dockerfile @@ -64,6 +64,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ binutils-dev \ bison \ build-essential \ + byacc \ cgpt \ clang-18 \ coreutils \ @@ -74,8 +75,10 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ e2fsprogs \ efitools \ erofs-utils \ + exfatprogs \ expect \ fakeroot \ + fdisk \ flex \ gawk \ gdisk \ @@ -281,24 +284,30 @@ RUN git clone https://github.com/stefanberger/swtpm /tmp/swtpm && \ rm -rf /tmp/swtpm # Build trace-cmd +# Pin to commits from Oct 2025 to avoid libtraceevent 1.9+ BTF dependency +# which requires kernel headers newer than Jammy's 5.15 RUN mkdir /tmp/trace && \ git clone https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git /tmp/trace/libtraceevent && \ cd /tmp/trace/libtraceevent && \ + git checkout b3f5849 && \ make -j$(nproc) && \ - sudo make install && \ - git clone https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git /tmp/trace/libtracefs && \ + sudo make install prefix=/usr && \ + sudo ldconfig && \ + git clone --branch libtracefs-1.8.1 --depth 1 https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git /tmp/trace/libtracefs && \ cd /tmp/trace/libtracefs && \ make -j$(nproc) && \ - sudo make install && \ + sudo make install prefix=/usr && \ + sudo ldconfig && \ git clone https://github.com/rostedt/trace-cmd.git /tmp/trace/trace-cmd && \ cd /tmp/trace/trace-cmd && \ + git checkout 364faec && \ make -j$(nproc) && \ sudo make install && \ rm -rf /tmp/trace # Build coreboot -RUN wget -O - https://coreboot.org/releases/coreboot-24.08.tar.xz | tar -C /tmp -xJ && \ - cd /tmp/coreboot-24.08 && \ +RUN wget -O - https://coreboot.org/releases/coreboot-24.12.tar.xz | tar -C /tmp -xJ && \ + cd /tmp/coreboot-24.12 && \ make crossgcc-i386 CPUS=$(nproc) && \ make -C payloads/coreinfo olddefconfig && \ make -C payloads/coreinfo && \ @@ -308,7 +317,8 @@ RUN wget -O - https://coreboot.org/releases/coreboot-24.08.tar.xz | tar -C /tmp make olddefconfig && \ make -j $(nproc) && \ sudo mkdir /opt/coreboot && \ - sudo cp build/coreboot.rom build/cbfstool /opt/coreboot/ + sudo cp build/coreboot.rom build/cbfstool /opt/coreboot/ && \ + rm -rf /tmp/coreboot-24.08 # Create our user/group RUN echo uboot ALL=NOPASSWD: ALL > /etc/sudoers.d/uboot @@ -330,6 +340,7 @@ ENV PATH="/home/uboot/.cargo/bin:${PATH}" # COPY / ADD directives don't work as we need them to. RUN wget -O /tmp/pytest-requirements.txt https://source.denx.de/u-boot/u-boot/-/raw/master/test/py/requirements.txt RUN wget -O /tmp/sphinx-requirements.txt https://source.denx.de/u-boot/u-boot/-/raw/master/doc/sphinx/requirements.tx... +RUN wget -O /tmp/binman-requirements.txt https://source.denx.de/u-boot/u-boot/-/raw/master/tools/binman/requirements.... RUN wget -O /tmp/buildman-requirements.txt https://source.denx.de/u-boot/u-boot/-/raw/master/tools/buildman/requirement... RUN wget -O /tmp/patman-requirements.txt https://source.denx.de/u-boot/u-boot/-/raw/master/tools/patman/requirements.... RUN wget -O /tmp/u_boot_pylib-requirements.txt https://source.denx.de/u-boot/u-boot/-/raw/master/tools/u_boot_pylib/require... @@ -337,6 +348,7 @@ RUN python3 -m venv /tmp/venv && \ . /tmp/venv/bin/activate && \ pip install -r /tmp/pytest-requirements.txt \ -r /tmp/sphinx-requirements.txt \ + -r /tmp/binman-requirements.txt \ -r /tmp/buildman-requirements.txt \ -r /tmp/patman-requirements.txt \ -r /tmp/u_boot_pylib-requirements.txt && \ -- 2.43.0
From: Simon Glass <simon.glass@canonical.com> Newer versions of trace-cmd append a "<-- caller" suffix to function trace lines, e.g.: u-boot-1 0..... 60.805596: function: initf_malloc <-- initcall_run_f This results in 7 fields per line instead of 5 after splitting, so the existing `len(items) == 5` filter rejects every line, leaving the vals dictionary empty and causing the test to fail. Change the filter to `len(items) >= 5` so that the function name (at index 4) and timestamp (at index 2) are extracted regardless of trailing fields. Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Simon Glass <simon.glass@canonical.com> --- test/py/tests/test_trace.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/py/tests/test_trace.py b/test/py/tests/test_trace.py index 498949372aa..d82bae0acc0 100644 --- a/test/py/tests/test_trace.py +++ b/test/py/tests/test_trace.py @@ -144,14 +144,13 @@ def check_function(ubman, fname, proftool, map_fname, trace_dat): cmd = f"trace-cmd report -l {trace_dat} |grep -E '(initf_|initr_)'" out = utils.run_and_log(ubman, ['sh', '-c', cmd]) - # Format: + # Format (older trace-cmd): # u-boot-1 0..... 60.805596: function: initf_malloc - # u-boot-1 0..... 60.805597: function: initf_malloc - # u-boot-1 0..... 60.805601: function: initf_bootstage - # u-boot-1 0..... 60.805607: function: initf_bootstage + # Format (newer trace-cmd, includes caller): + # u-boot-1 0..... 60.805596: function: initf_malloc <-- initcall_run_f lines = [line.replace(':', '').split() for line in out.splitlines()] - vals = {items[4]: float(items[2]) for items in lines if len(items) == 5} + vals = {items[4]: float(items[2]) for items in lines if len(items) >= 5} base = None max_delta = 0 for timestamp in vals.values(): -- 2.43.0
participants (1)
-
Simon Glass