Skip to content

Commit 154f667

Browse files
build(mesa): strip and verify guest library archive
Strip the source-built ELFs to keep the neutral bundle suitable for later app packaging, and verify every archived library against its embedded manifest before uploading the artifact.
1 parent 296392f commit 154f667

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

‎.github/workflows/mesa-guest.yml‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,17 @@ jobs:
5757
lib/dri/zink_dri.so; do
5858
tar -tzf "${archives[0]}" | grep -Fx "venus-mesa/$path"
5959
done
60-
tar -xOzf "${archives[0]}" venus-mesa/MANIFEST.properties | grep -Fx 'glibc_min=2.34'
60+
extracted="$(mktemp -d)"
61+
trap 'rm -rf "$extracted"' EXIT
62+
tar -xzf "${archives[0]}" -C "$extracted"
63+
manifest="$extracted/venus-mesa/MANIFEST.properties"
64+
grep -Fx 'glibc_min=2.34' "$manifest"
65+
while IFS='=' read -r key expected; do
66+
if [[ "$key" == *.sha256 ]]; then
67+
printf '%s %s\n' "$expected" "$extracted/venus-mesa/${key%.sha256}" \
68+
| sha256sum --check --strict -
69+
fi
70+
done < "$manifest"
6171
- uses: actions/upload-artifact@v7
6272
with:
6373
name: udroid-mesa-venus-jammy-arm64

‎tools/build-guest-mesa-bundle.sh‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ install -m 755 "$work/zink/src/glx/libGLX_mesa.so.0" "$bundle/lib/"
5252
install -m 755 "$work/virtio/src/virtio/vulkan/libvulkan_virtio.so" "$bundle/lib/"
5353

5454
for binary in "$bundle/bin/zink_check_requirements" "$bundle/lib/"*.so* "$bundle/lib/dri/"*.so; do
55+
strip --strip-unneeded "$binary"
5556
readelf -h "$binary" | grep -q 'Machine:.*AArch64'
5657
max_glibc="$(readelf --version-info "$binary" | grep -o 'GLIBC_[0-9.]*' | sort -Vu | tail -1 || true)"
5758
if [[ -n "$max_glibc" && "$(printf '%s\n' GLIBC_2.34 "$max_glibc" | sort -V | tail -1)" != GLIBC_2.34 ]]; then

0 commit comments

Comments
 (0)