|
| 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 |
0 commit comments