Files
marfrit-packages/arch/linux-ampere-fourier/prebuild.sh
T
test0r 06023bcf9d linux-ampere-fourier: bump to kafr2 (v7.0-rc3 + fleet/ampere.yaml manifest)
Drops the f8f3ad9 baseline ("18 commits ahead, BLACK-SCREENS ampere"
per fleet/ampere.yaml bisect note) in favor of the kernel-agent-
managed 10-patch set produced by ka-promote from fleet/ampere.yaml.

Baseline: mainline v7.0-rc3 (3daa4f5dc6cc), plus the 10 scope-tagged
patches under marfrit/kernel-agent/patches/{soc,module,board,driver}/:
  - 1 soc/rk3588 pwm15 pinctrl
  - 6 board/coolpi-cm5-genbook DTS patches
  - 3 driver/media Sarma VP9-on-VDPU381 patches (PR #24 closure)

New _commit 48a8c78 reflects this tree state in ~/src/linux-rockchip
(branch vp9-build on ampere, exactly v7.0-rc3 + 10 manifest patches).

End-to-end verified before this iteration was cut (hand-build of the
same tip on 2026-05-18 booted ampere via arch_vp9_test extlinux
label):
  - VP9 decode bit-exact HW==SW==libva (sha c8624d7c42db66525f53a02a515bc38d0a17ef39f692660cc7bebb1e2d2e1b48)
  - AV1 decode bit-exact HW==SW via kdirect (sha 30d2091158d92f3c5e0a807217c3e7307f873267673d92632e7fb147383e7dd1, av1-vpu-dec is mainline 7.0)

prebuild.sh canonical sha256 cleared — gzip-version-dependent, the
script warns-not-fails on mismatch. First successful kafr2 build can
pin a canonical sha here if a reproducibility audit ever needs it.

Cross-references:
  - marfrit/kernel-agent#12 (VP9 enablement closure)
  - marfrit/kernel-agent PR #24 (Sarma patch import + ampere.yaml bump)
2026-05-18 14:03:56 +00:00

69 lines
2.8 KiB
Bash
Executable File

#!/bin/bash
# prebuild — stage the kernel source tarball this PKGBUILD expects.
#
# linux-ampere-fourier's source is a snapshot of marfrit/linux-rk3588-marfrit
# @ f8f3ad9 (260MB), too big to commit to marfrit-packages and currently
# unpushable to Gitea (boltzmann's working clone is shallow; gitea push
# refuses shallow updates). Hosting the tarball outside Gitea would need
# infrastructure setup that's not in scope for the first iteration.
#
# So: produce the tarball locally from the kernel working tree just
# before makepkg runs. Idempotent — if an existing tarball matches the
# expected sha256 we skip the archive step.
#
# Run from this directory: cd arch/linux-ampere-fourier && ./prebuild.sh
# Override the kernel-tree location: LINUX_RK3588_MARFRIT_TREE=/path ./prebuild.sh
#
# Default tree location matches the boltzmann/ampere convention from
# kernel-agent issue #6: $HOME/src/linux-rockchip.
set -euo pipefail
TREE="${LINUX_RK3588_MARFRIT_TREE:-${HOME}/src/linux-rockchip}"
COMMIT=48a8c785de7f5320513052a64e544c6310d7b273
# Generated tarball sha varies with gzip version — script warns-not-fails.
# Leave EXPECTED empty for fresh kafr2 builds; first successful build can
# pin a canonical sha here if a reproducibility audit needs it.
SHA256_EXPECTED=
HERE="$(cd "$(dirname "$0")" && pwd)"
OUTPUT="${HERE}/linux-rk3588-marfrit-${COMMIT:0:7}.tar.gz"
if [ -f "$OUTPUT" ]; then
have=$(sha256sum "$OUTPUT" | cut -d' ' -f1)
if [ "$have" = "$SHA256_EXPECTED" ]; then
echo "prebuild: $OUTPUT already exists with correct sha256"
exit 0
else
echo "prebuild: existing $OUTPUT sha mismatch (have=$have, want=$SHA256_EXPECTED) — regenerating" >&2
rm -f "$OUTPUT"
fi
fi
if [ ! -d "$TREE/.git" ]; then
echo "prebuild: kernel tree not at $TREE" >&2
echo " set LINUX_RK3588_MARFRIT_TREE=/path/to/linux-rockchip and retry" >&2
exit 2
fi
cd "$TREE"
if ! git cat-file -e "$COMMIT" 2>/dev/null; then
echo "prebuild: commit $COMMIT not found in $TREE" >&2
echo " fetch the linux-rk3588-marfrit branch first:" >&2
echo " git fetch <remote> linux-rk3588-marfrit" >&2
exit 3
fi
echo "prebuild: generating archive from $TREE @ $COMMIT..."
git archive --format=tar.gz --prefix=linux-rk3588-marfrit/ "$COMMIT" -o "$OUTPUT"
# git archive emits a deterministic tar stream but gzip compression may
# vary by version. The sha256 check is informational; warn-don't-fail.
have=$(sha256sum "$OUTPUT" | cut -d' ' -f1)
if [ "$have" != "$SHA256_EXPECTED" ]; then
echo "prebuild: WARNING $OUTPUT sha=$have (canonical=$SHA256_EXPECTED)" >&2
echo " probably a gzip-version difference; tar payload should be identical" >&2
fi
echo "prebuild: wrote $OUTPUT ($(du -h "$OUTPUT" | cut -f1), sha=$have)"