Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions docs/kernel.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ As shipped:
| --- | --- |
| [release.json](../kernel/release.json) | the pin: overpressure/linux's tag (`phoenix/7.2-1`), its commit, the build image it was built with, and the SHA-256 of `Image.gz`, the device tree, `config` and `version` |
| [tooling/kernel.py](../tooling/kernel.py) | `kernel fetch` (the installer's step: the release's files into `out/kernel`), `kernel build` (the pinned commit built here in the release's build image, [below](#building-it-yourself)), `kernel check DIR`, `kernel contracts` ([below](#contracts)) |
| [build-tree.sh](../kernel/build-tree.sh) | a checkout of overpressure/linux's `phoenix/7.2` to `Image.gz`, the device tree, `config`, `version` and `build.json` (release, commit, banner, camera table, the tooling's commit, the build image, hashes); `uname -v` names the commit. That repository's CI builds each branch with it once, each tag twice on two machines, and releases a tag whose builds agree |
| [build-tree.sh](../kernel/build-tree.sh) | a checkout of overpressure/linux's `phoenix/7.2` to `Image.gz`, the device tree, `config`, `version` and `build.json` (release, commit, banner, camera table, the tooling's commit, the build image, hashes); `uname -v` names the commit. That repository's CI builds each change with it once, through ccache when `CCACHE_DIR` is set (its check builds), and each tag twice on two machines without it, and releases a tag whose builds agree |
| [imx471_mode.py](../kernel/imx471_mode.py) | the RGB camera's register table, from the camera module in the stock vendor image: the file the driver loads |
| [recovery_image.py](../kernel/recovery_image.py) | boot images with Valve's kernel ([A one-shot test boot](#a-one-shot-test-boot)) |

Expand Down Expand Up @@ -237,8 +237,10 @@ Every change moves up the layers by pull request, merged with a merge commit; no
`sm8650-7.2` branch through the [evlaV mirror](https://github.com/evlaV/deckard-linux-no-oopsies). Whenever a branch
moves, the Layers workflow opens a pull request from it into the layer built on it (`valve/7.2` into `common/7.2`, then
`common/7.2` into `sm8250/7.2`, then `sm8250/7.2` into `phoenix/7.2`); a pull request into a headset's branch is built
with its merge, and a conflict is resolved in the pull request. Rulesets let the layers change only by such pull
requests, with a passing build, and `valve/7.2` only move forward. A release is a tag `phoenix/7.2-N` that never moves;
with its merge, a pull request into a layer without a headset (`common/7.2`, `sm8250/7.2`) is built merged into
`phoenix/7.2`, and a conflict is resolved in the pull request. The Layers workflow starts its own pull requests'
builds. Rulesets let the layers change only by such pull requests whose `ci` check passed, and `valve/7.2` only move
forward ([the repository's README](https://github.com/overpressure/linux/tree/phoenix/7.2/.github)). A release is a tag `phoenix/7.2-N` that never moves;
this repository pins one.

## Valve's Mesa
Expand Down
18 changes: 17 additions & 1 deletion kernel/build-tree.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
# build's: the same commit and camera table give the same kernel on any host.
#
# Runs in the build container (python -m overpressure container run), cross compiling with
# aarch64-linux-gnu-gcc. Incremental: a second run rebuilds only what changed.
# aarch64-linux-gnu-gcc. Incremental: a second run rebuilds only what changed. With CCACHE_DIR set, the
# compiler runs through ccache (the build image's), which keeps compiled objects in that folder for the next
# build, also from another checkout: CI's check builds use it, a release builds without (its two builds are
# the test that the kernel is reproducible). ccache gives the objects the compiler would: the same kernel.
set -euo pipefail

DTB=sm8250-pico4-phoenix
Expand Down Expand Up @@ -60,6 +63,18 @@ make=(make -C "$tree" O="$work/build" ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu
# it: without the prefixes the same commit in another folder gives another kernel.
KCFLAGS="-ffile-prefix-map=$tree/= -ffile-prefix-map=$work/="
KAFLAGS="-ffile-prefix-map=$tree/= -ffile-prefix-map=$work/=")
if [ -n "${CCACHE_DIR:-}" ]; then
if command -v ccache >/dev/null; then
make+=(CC="ccache aarch64-linux-gnu-gcc")
# A compiler of the same name but other contents is another compiler; 3 GB hold a kernel's objects.
export CCACHE_COMPILERCHECK=content CCACHE_MAXSIZE=${CCACHE_MAXSIZE:-3G}
mkdir -p "$CCACHE_DIR"
ccache --zero-stats >/dev/null
else
echo "CCACHE_DIR is set, but this build image has no ccache: building without it" >&2
unset CCACHE_DIR
fi
fi
config=$work/build/.config
mkdir -p "$work/build"
# The configuration starts from Valve's each time, so a changed fragment never stacks.
Expand Down Expand Up @@ -88,6 +103,7 @@ install -m 644 "$work/build/arch/arm64/boot/Image.gz" "$out/Image.gz"
install -m 644 "$work/build/arch/arm64/boot/dts/qcom/$DTB.dtb" "$out/$DTB.dtb"
install -m 644 "$config" "$out/config"
"${make[@]}" -s kernelrelease > "$out/version"
[ -z "${CCACHE_DIR:-}" ] || ccache --show-stats | grep -iE 'hits|misses|cache size' >&2 || true

sum() { sha256sum "$out/$1" | cut -d' ' -f1; }
# The tooling's own commit; a worktree's repository is at OVERPRESSURE_GIT_DIR in the build
Expand Down
Loading