build: build-docker.sh: copy kernel.{elf,map} to build output
What changed, and why it matters
This change updates a build script so that when compiling Trezor firmware inside Docker, the kernel's ELF debug file and map file are compressed and copied to the build output directory. It is a build/CI convenience fix, not a code change that affects device behavior or security.
No security action needed. Treat as a normal build-script improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies build-docker.sh. Previously the script checked for the existence of a .bin file before copying artifacts, which caused the kernel’s .elf and .map files to be skipped because the kernel does not produce a .bin. The patch changes the guard to check for the .elf file, gzips the .elf, and copies all matching artifacts. This only affects build artifact collection; no firmware logic is changed.
Changed components
build-docker.shInspect captured patch +3 / −2
diff --git a/build-docker.sh b/build-docker.sh
index 41612eaf..e62e32ed 100755
--- a/build-docker.sh
+++ b/build-docker.sh
@@ -290,11 +290,12 @@ for TREZOR_MODEL in ${MODELS[@]}; do
build-xtask/artifacts/$TREZOR_MODEL/\$item.bin \
|| echo "No fingerprint for build-xtask/artifacts/$TREZOR_MODEL/\$item.bin"
fi
- if [ -f build-xtask/artifacts/$TREZOR_MODEL/\$item.bin ]; then
+ if [ -f build-xtask/artifacts/$TREZOR_MODEL/\$item.elf ]; then
# copy only the artifacts to the build output directory
mkdir /build/\$item/
+ gzip build-xtask/artifacts/$TREZOR_MODEL/\$item.elf
cp -v build-xtask/artifacts/$TREZOR_MODEL/\$item* /build/\$item/
- cp -v build-xtask/artifacts/pub/\$item-$TREZOR_MODEL-*.bin /build/\$item/ || true # n/a for secmon or kernel
+ cp -v build-xtask/artifacts/pub/\$item-$TREZOR_MODEL-*.bin /build/\$item/ || true # n/a for kernel
fi
done
chown -R $USER:$GROUP /build
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.