Skip to content

Commit 3807ed4

Browse files
committed
helpers: add support for the Bookworm Linux header packages
Starting with the Bookworm RaspiOS release, the Linux kernel package is no longer a monolithic package and it has been split in several packages, named after their build configuration, which in turn is dictated by the Pi model and architecture (`armhf`/`aarch64`). This change adds support for the Linux kernel headers packages on the new OS release, which followed a similar split from the previously used `raspberrypi-kernel-headers` package. NOTES: * mixed kernel/userland archs are not supported. By default, an `armhf` RaspiOS installation will boot the Pi4/Pi5 with the 64bit kernel, but the corresponding headers package is not installable. While the Pi4 can still boot a 32bit kernel by adding `arm_64bit=0` to `/boot{/firmware}/config.txt`, the Pi5 does not have this capability. * on the RaspiOS Bookworm images the Linux kernel images/headers are already installed, the mapping and installation will have effect if the user explicitely removes the header packages.
1 parent 70a698a commit 3807ed4

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

scriptmodules/helpers.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,19 @@ function _mapPackage() {
248248
# handle our custom package alias LINUX-HEADERS
249249
LINUX-HEADERS)
250250
if isPlatform "rpi"; then
251-
pkg="raspberrypi-kernel-headers"
251+
if [[ "$__os_debian_ver" -lt 12 ]]; then
252+
pkg="raspberrypi-kernel-headers"
253+
else
254+
# on RaspiOS bookworm and later, kernel packages are separated by arch and model
255+
isPlatform "rpi0" || isPlatform "rpi1" && pkg="linux-headers-rpi-v6"
256+
if isPlatform "32bit"; then
257+
isPlatform "rpi2" || isPlatform "rpi3" && pkg="linux-headers-rpi-v7"
258+
isPlatform "rpi4" && pkg="linux-headers-rpi-v7l"
259+
else
260+
isPlatform "rpi3" || isPlatform "rpi4" && pkg="linux-headers-rpi-v8"
261+
isPlatform "rpi5" && pkg="linux-headers-rpi-2712"
262+
fi
263+
fi
252264
elif [[ -z "$__os_ubuntu_ver" ]]; then
253265
pkg="linux-headers-$(uname -r)"
254266
else

0 commit comments

Comments
 (0)