Skip to content

Commit c5028f6

Browse files
committed
RW
1 parent 9af7d58 commit c5028f6

4 files changed

Lines changed: 29 additions & 32 deletions

File tree

layers/meta-balena-raspberrypi/recipes-kernel/linux/files/balena-os-drivers.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ CONFIG_FB_TFT_TINYLCD=m
3535
CONFIG_FB_TFT_TLS8204=m
3636
CONFIG_FB_TFT_UC1701=m
3737
CONFIG_FB_TFT_UPD161704=m
38-
CONFIG_FB_TFT_WATTEROTT=m
3938

4039
# pca955 GPIO expander
4140
CONFIG_GPIO_PCA953X=y
@@ -62,7 +61,8 @@ CONFIG_HAS_DMA=y
6261
CONFIG_CAN_MCP251X=m
6362

6463
# CAN bit timing
65-
CONFIG_CAN_DEV=y
64+
# CAN_DEV lives under "if CAN" and CONFIG_CAN is modular, so it can only be =m.
65+
CONFIG_CAN_DEV=m
6666
CONFIG_CAN_CALC_BITTIMING=y
6767

6868
# DS1307 RTC

layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@ do_deploy[prefuncs] += "do_overlays"
4545
# the boot partition can be generated correctly
4646
do_install[nostamp] = "1"
4747

48-
# Built-in SPI drivers needed for API EEPROM update
49-
# Otherwise on A/B rollback modules won't match running kernel
50-
BALENA_CONFIGS:append:raspberrypi4-64 = " pieeprom"
51-
BALENA_CONFIGS[pieeprom] = " \
52-
CONFIG_SPI=y \
53-
CONFIG_SPI_BCM2835=y \
54-
CONFIG_SPI_SPIDEV=y \
55-
"
48+
# Built-in SPI drivers for the raspberrypi4-64 EEPROM update / A-B rollback
49+
# path. Shared with the override extension kernel via a common include.
50+
require recipes-kernel/linux/pieeprom.inc
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Built-in SPI drivers needed for API EEPROM update
2+
# Otherwise on A/B rollback modules won't match running kernel
3+
#
4+
# Shared by the base kernel (linux-raspberrypi_%.bbappend) and the override
5+
# extension kernel (linux-raspberrypi-extension) so both stay in sync on
6+
# raspberrypi4-64. Injected via BALENA_CONFIGS (do_kernel_resin_injectconfig).
7+
BALENA_CONFIGS:append:raspberrypi4-64 = " pieeprom"
8+
BALENA_CONFIGS[pieeprom] = " \
9+
CONFIG_SPI=y \
10+
CONFIG_SPI_BCM2835=y \
11+
CONFIG_SPI_SPIDEV=y \
12+
"

layers/meta-kernel-block/recipes-kernel/linux/linux-raspberrypi-extension_6.12.bb

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,18 @@ PROVIDES = "virtual/kernel-extension"
2929

3030
inherit kernel-balena-override
3131

32-
# When modules are compressed, OR standard strip will not strip debug symbols.
33-
# Usually balenaOS does not set CONFIG_DEBUG_INFO=y, but this extension does
34-
# so we need to make sure debug symbols are stripped, while keeping the BTF
35-
# data that survives the strip debug.
36-
do_install:prepend() {
37-
if grep -q '^CONFIG_MODULE_COMPRESS=y$' "${B}/.config"; then
38-
export INSTALL_MOD_STRIP=1
39-
fi
40-
}
32+
# Driver set first (shared with the base OS kernel), extension deltas last so
33+
# they win. Resolved on FILESPATH, never via SRC_URI (that would merge early).
34+
KERNEL_BALENA_OVERRIDE_FRAGMENTS = "balena-os-drivers.cfg bpf-lsm-debug.cfg"
35+
36+
# raspberrypi4-64 EEPROM/A-B rollback SPI drivers. Shared with the base kernel
37+
# via BALENA_CONFIGS[pieeprom] (early inject), so both stay in sync.
38+
require recipes-kernel/linux/pieeprom.inc
39+
40+
# bpf-lsm-debug.cfg enables CONFIG_DEBUG_INFO_BTF, which kconfig gates on
41+
# PAHOLE_VERSION >= 121. Without pahole in the build, BTF is silently dropped
42+
# (and do_kernel_balena_verify_fragments then fails, as intended).
43+
DEPENDS += "pahole-native"
4144

4245
# When modules are compressed, OR standard strip will not strip debug symbols.
4346
# Usually balenaOS does not set CONFIG_DEBUG_INFO=y, but this extension does
@@ -48,16 +51,3 @@ do_install:prepend() {
4851
export INSTALL_MOD_STRIP=1
4952
fi
5053
}
51-
52-
# Track local fragments in the task hash; kernel-balena's
53-
# do_kernel_balena_merge_fragments does the actual *.cfg merge.
54-
python () {
55-
import glob
56-
import os
57-
thisdir = d.getVar("THISDIR")
58-
fragments = sorted(glob.glob(os.path.join(thisdir, "files", "*.cfg")))
59-
d.appendVarFlag(
60-
"do_kernel_balena_merge_fragments", "file-checksums",
61-
" " + " ".join(f"{p}:True" for p in fragments),
62-
)
63-
}

0 commit comments

Comments
 (0)