Skip to content

Commit b307333

Browse files
daegalusahmedadan
andauthored
fix(kernel): enable ATH12K across variants (#1226)
* fix(kernel): enable ATH12K across variants * fix(kernel): carry zswap zstd and debug-strip deltas into linux-fdsdk --------- Co-authored-by: Ahmed Adan <ahmed.adan@gmail.com>
1 parent 3fd2573 commit b307333

8 files changed

Lines changed: 224 additions & 20 deletions

File tree

Justfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ default:
77
export image_name := env("BUILD_IMAGE_NAME", "dakota")
88
export image_tag := env("BUILD_IMAGE_TAG", "latest")
99

10-
# Gaming variant: adds the gaming/ stack (the OGC kernel ships in ALL
11-
# variants regardless). Applies to every bst invocation here; exported
12-
# podman refs get a -gaming suffix so builds don't collide.
10+
# Gaming variant: adds the gaming/ stack and selects the OGC kernel.
11+
# Non-gaming variants use the freedesktop-sdk stable kernel. Applies to
12+
# every bst invocation here; exported podman refs get a -gaming suffix
13+
# so builds don't collide.
1314
export gaming := env("BUILD_GAMING", "false")
1415
export base_dir := env("BUILD_BASE_DIR", ".")
1516
export filesystem := env("BUILD_FILESYSTEM", "btrfs")

docs/skills/bst-overrides.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,3 +331,26 @@ no authselect on this image, so a whole-file override is the only option. sudo
331331
cargo feature (`default = []`), so sudo-rs opens the `sudo` PAM service (not
332332
`sudo-i`) for `sudo -i` too — both paths include `system-auth`. Re-sync the
333333
copied stock stack at every fdsdk bump.
334+
335+
### Select variant-specific kernels at the junction boundary (2026-07-28)
336+
337+
Kernel consumers such as initramfs assembly, unsigned module collection, and NVIDIA
338+
module builds all depend on `freedesktop-sdk.bst:components/linux.bst`. When image
339+
variants need different kernels, make that path resolve conditionally in the
340+
freedesktop-sdk junction override. Swapping only the final runtime dependency can
341+
pair modules built for one kernel with another kernel at boot.
342+
343+
If a required config change is present on freedesktop-sdk `master` but not the
344+
pinned release branch, prefer a leaf kernel element over patching the junction.
345+
Copy the pinned kernel source and config, state an exit condition tied to the
346+
upstream commit, and keep the junction source itself byte-aligned with
347+
gnome-build-meta. This invalidates the kernel and its reverse dependencies instead
348+
of the entire SDK graph. Validate both option values with `bst show`, because the
349+
default graph alone does not exercise the conditional kernel.
350+
351+
For Linux 7.0 and 7.1, WCN7850 (`17cb:1107`) support is controlled by
352+
`CONFIG_ATH12K`. Even though the bound PCI module is named `ath12k_wifi7`,
353+
that single symbol builds both `ath12k.ko` and the Wi-Fi 7 family module;
354+
there is no separate `ATH12K_PCI` or `ATH12K_WIFI7` Kconfig option in those
355+
trees. Verify the selected kernel's Kconfig, Wi-Fi 7 PCI ID table, and
356+
`/usr/lib/firmware/ath12k/WCN7850/hw2.0/` payload together.

elements/core/linux-fdsdk.bst

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
# freedesktop-sdk stable kernel for non-gaming Dakota variants.
2+
#
3+
# This reproduces the x86_64/aarch64 recipe of the linux.bst element at
4+
# Dakota's pinned freedesktop-sdk 25.08 ref, with the shared config
5+
# enabling ATH12K. The pinned upstream kernel patches only affect
6+
# RISC-V and PowerPC, which Dakota does not build.
7+
#
8+
# Two Dakota deltas from the upstream recipe (both shared with
9+
# linux-ogc.bst, see there):
10+
# 1. CRYPTO_ZSTD forced =y: the zswap.compressor=zstd karg
11+
# (bluefin/zswap-config.bst, all variants) needs the compressor
12+
# built in.
13+
# 2. Modules stripped (INSTALL_MOD_STRIP=1) and vmlinux to the devel
14+
# split: the shared config pass enables DEBUG_INFO_BTF (forcing
15+
# DEBUG_INFO=y), and Dakota's runtime OCI layers only exclude the
16+
# devel/debug domains, so upstream's contract would ship ~0.5 GB
17+
# of debug payload in composed images.
18+
#
19+
# Exit condition: once the pinned 25.08 release contains freedesktop-sdk
20+
# commit 2d9798306 (linux: Build ATH12K), the config divergence ends and
21+
# the vendored files/linux/ scripts re-sync with upstream. The two deltas
22+
# above are Dakota-specific and outlive it: only drop this element in
23+
# favor of components/linux.bst if zswap and image size are re-verified.
24+
kind: make
25+
description: freedesktop-sdk stable Linux kernel with ATH12K
26+
27+
build-depends:
28+
- freedesktop-sdk.bst:public-stacks/buildsystem-make.bst
29+
- freedesktop-sdk.bst:components/bison.bst
30+
- freedesktop-sdk.bst:components/cpio.bst
31+
- freedesktop-sdk.bst:components/flex.bst
32+
- freedesktop-sdk.bst:components/bc.bst
33+
- freedesktop-sdk.bst:components/gzip.bst
34+
- freedesktop-sdk.bst:components/pahole.bst
35+
- freedesktop-sdk.bst:components/python3.bst
36+
- freedesktop-sdk.bst:components/rsync.bst
37+
- freedesktop-sdk.bst:components/rust.bst
38+
- freedesktop-sdk.bst:components/rust-bindgen.bst
39+
- freedesktop-sdk.bst:components/rust-src.bst
40+
- freedesktop-sdk.bst:components/util-linux.bst
41+
- freedesktop-sdk.bst:components/zstd.bst
42+
- filename: freedesktop-sdk.bst:components/linux-module-cert.bst
43+
strict: true
44+
45+
variables:
46+
bootdir: /boot
47+
indep-libdir: '%{prefix}/lib'
48+
# Modules are stripped by kbuild (INSTALL_MOD_STRIP=1) *before* the
49+
# module signature is appended; a post-build strip pass would tear
50+
# the signatures off again.
51+
strip-binaries: ''
52+
kernel_arch: '%{arch}'
53+
src-arch: '%{kernel_arch}'
54+
image-name: '$(make -s image_name)'
55+
optimize-debug: false
56+
(?):
57+
- arch == "x86_64":
58+
src-arch: x86
59+
- arch == "aarch64":
60+
kernel_arch: arm64
61+
62+
environment:
63+
ARCH: '%{kernel_arch}'
64+
# compile.h has a hardcoded timestamp; seed it for reproducibility.
65+
KBUILD_BUILD_TIMESTAMP: 'Thu Nov 10 15:00:00 UTC 2011'
66+
KBUILD_BUILD_USER: 'tomjon'
67+
MAXJOBS: "%{max-jobs}"
68+
69+
environment-nocache:
70+
- MAXJOBS
71+
72+
config:
73+
configure-commands:
74+
- |
75+
make defconfig
76+
77+
- |
78+
. ./config-utils.sh
79+
rm -f expected-configs
80+
. ./fdsdk-config.sh "%{arch}"
81+
82+
- |
83+
# The zswap.compressor=zstd karg needs the compressor built in, not =m.
84+
scripts/config --keep-case -e CRYPTO_ZSTD
85+
86+
- |
87+
make -j1 olddefconfig
88+
89+
- |
90+
. ./config-utils.sh
91+
92+
missing_configs=0
93+
for config in $(cat expected-configs); do
94+
if ! has "${config}"; then
95+
echo "Missing ${config}" 1>&2
96+
missing_configs=1
97+
fi
98+
done
99+
case "%{arch}" in
100+
x86_64|aarch64)
101+
[ "${missing_configs}" = 0 ]
102+
;;
103+
esac
104+
105+
# has() accepts =m; the zswap karg requires =y.
106+
grep -q '^CONFIG_CRYPTO_ZSTD=y$' .config
107+
108+
install-commands:
109+
- |
110+
install -Dm644 "%{image-name}" '%{install-root}%{bootdir}/vmlinuz'
111+
install -Dm644 vmlinux '%{install-root}%{bootdir}/vmlinux'
112+
install -Dm644 System.map '%{install-root}%{bootdir}/System.map'
113+
install -Dm644 .config '%{install-root}%{bootdir}/config'
114+
make -j1 INSTALL_MOD_PATH='%{install-root}%{prefix}' INSTALL_MOD_STRIP=1 modules_install
115+
116+
- |
117+
release=$(make -s kernelrelease)
118+
targetdir="%{install-root}%{prefix}/src/linux-${release}"
119+
120+
rm "%{install-root}%{indep-libdir}/modules/${release}"/build
121+
122+
to_copy=(
123+
Makefile
124+
Module.symvers
125+
.config
126+
"arch/%{src-arch}/include"
127+
"arch/%{src-arch}/Makefile"
128+
scripts
129+
include
130+
)
131+
if [ "$(scripts/config -s OBJTOOL)" = y ]; then
132+
to_copy+=(tools/objtool/objtool)
133+
fi
134+
for file in "${to_copy[@]}"; do
135+
targetfile="${targetdir}/${file}"
136+
dir="$(dirname "${targetfile}")"
137+
[ -d "${dir}" ] || install -d "${dir}"
138+
cp -aT "${file}" "${targetfile}"
139+
done
140+
141+
ln -sr "${targetdir}" "%{install-root}%{indep-libdir}/modules/${release}/build"
142+
143+
- |
144+
%{install-extra}
145+
146+
(?):
147+
- arch == "aarch64":
148+
install-commands:
149+
(>):
150+
- |
151+
make -j1 INSTALL_DTBS_PATH='%{install-root}%{bootdir}/dtbs' dtbs_install
152+
153+
public:
154+
bst:
155+
split-rules:
156+
devel:
157+
(>):
158+
- '%{bootdir}/System.map'
159+
# DEBUG_INFO=y (via the shared config's DEBUG_INFO_BTF) makes
160+
# vmlinux ~0.5 GB; runtime consumers read /sys/kernel/btf/vmlinux,
161+
# not this file, so keep it out of the composed images.
162+
- '%{bootdir}/vmlinux'
163+
overlap-whitelist:
164+
- "%{project_licensedir}"
165+
- "%{project_licensedir}/**"
166+
167+
sources:
168+
- kind: git_repo
169+
url: kernel:linux/kernel/git/stable/linux.git
170+
track: v*
171+
exclude:
172+
- '*-rc*'
173+
ref: v7.0.11-0-gbb532bfaf7919c7c98caab81864e9ce2646e11e3
174+
- kind: local
175+
path: files/linux/config-utils.sh
176+
- kind: local
177+
path: files/linux/fdsdk-config.sh

elements/core/linux-ogc.bst

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
# Open Gaming Collective (OGC) kernel, the project kernel for ALL
2-
# Dakota variants, wired in unconditionally via the junction override in
3-
# elements/freedesktop-sdk.bst. Reproduces FDSDK's artifact contract
4-
# exactly: vmlinuz/config at %{bootdir}, modules at
1+
# Open Gaming Collective (OGC) kernel for Dakota gaming variants, selected
2+
# via the junction override in elements/freedesktop-sdk.bst. Reproduces
3+
# FDSDK's artifact contract exactly: vmlinuz/config at %{bootdir}, modules at
54
# /usr/lib/modules/<kver>/ with a `build` symlink into
65
# /usr/src/linux-<kver> (nvidia-drivers.bst compiles against it).
76
#
87
# The recipe is FDSDK 25.08 components/linux.bst with three deltas:
98
# 1. Source: OGC's stable-tree fork; FDSDK's patch queue is dropped,
109
# the OGC tree carries its own gaming patchset.
11-
# 2. Config: FDSDK's fdsdk-config.sh pass (vendored at
12-
# files/linux-ogc/, keep in sync when bumping the junction), then
10+
# 2. Config: FDSDK's fdsdk-config.sh pass (vendored at files/linux/,
11+
# keep in sync when bumping the junction), then
1312
# OGC's ogc.config.set/unset fragments (sched_ext, ntsync, BTF).
1413
# 3. Modules stripped (INSTALL_MOD_STRIP=1) and vmlinux to the devel
1514
# split: OGC forces DEBUG_INFO=y for BTF.
@@ -19,7 +18,7 @@
1918
# stable-series jump, nvidia-drivers.bst must compile against the new
2019
# tree before shipping.
2120
kind: make
22-
description: OGC Linux kernel (all Dakota variants)
21+
description: OGC Linux kernel (Dakota gaming variants)
2322

2423
build-depends:
2524
- freedesktop-sdk.bst:public-stacks/buildsystem-make.bst
@@ -243,9 +242,9 @@ sources:
243242
track: v*-ogc*
244243
ref: v7.1.4-ogc1-0-g29e5cbbcc123d68c41fc41b9c15afc3a2a98469e
245244
- kind: local
246-
path: files/linux-ogc/config-utils.sh
245+
path: files/linux/config-utils.sh
247246
- kind: local
248-
path: files/linux-ogc/fdsdk-config.sh
247+
path: files/linux/fdsdk-config.sh
249248
- kind: local
250249
path: files/linux-ogc/ogc.config.set
251250
- kind: local

elements/freedesktop-sdk.bst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@ config:
6363

6464
components/geoclue-base.bst: gnome-build-meta.bst:gnomeos-deps/geoclue-base.bst
6565

66-
# All variants ship the OGC kernel (sched_ext, ntsync, handheld
67-
# support). Routed through the junction override so every consumer
68-
# of components/linux.bst (unsigned-modules, initramfs,
69-
# nvidia-drivers) resolves to it and module/kernel co-versioning
70-
# holds by construction.
71-
components/linux.bst: core/linux-ogc.bst
66+
# Keep kernel selection at the junction boundary so every consumer
67+
# (unsigned-modules, initramfs, nvidia-drivers) resolves the same
68+
# kernel and module/kernel co-versioning holds by construction.
69+
components/linux.bst: core/linux-fdsdk.bst
70+
(?):
71+
- gaming == true:
72+
components/linux.bst: core/linux-ogc.bst
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ case "$arch" in
6969
enable SC_LPASS_CORECC_7280
7070
enable SC_VIDEOCC_7280
7171
enable SC_GCC_7280
72+
73+
enable QCOM_PD_MAPPER
7274
;;
7375
esac
7476

@@ -457,6 +459,7 @@ module AR5523
457459
module ATH10K_USB
458460
module ATH11K
459461
module ATH11K_PCI
462+
module ATH12K
460463
module ATH5K
461464
module ATH6KL
462465
module ATH6KL_SDIO

project.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ options:
2727
type: bool
2828
description: Enable x86_64-v3
2929
default: false
30-
# Gaming variant: adds the gaming/ userspace stack. The OGC kernel is
31-
# not gated on this; all variants ship it (see freedesktop-sdk.bst).
30+
# Gaming variant: adds the gaming/ userspace stack and selects the OGC
31+
# kernel. Non-gaming variants use the freedesktop-sdk stable kernel.
3232
# Enable with `-o gaming true` (Justfile: BUILD_GAMING=true).
3333
gaming:
3434
type: bool

0 commit comments

Comments
 (0)