As mentioned in Nixpkgs PR [^1], Raspberry Pi folks stop tagging both
raspberrypi/linux and raspberrypi/firmware GitHub repo. So, I switched
my reference point to Raspberry Pi OS, which publishes their packaging
for Linux kernel in RPi-Distro/linux-packaging.
The version is set to Debian packaging's version, and the commit comes
from the changelog entry for that version.
The old code structure is somewhat kept in case Raspberry Pi ever tags
their raspberrypi/linux repo again.
[^1]: https://github.com/NixOS/nixpkgs/pull/493115
- Gate on rpiVersion instead of architecture; skip for Pi 4+ where
vendor and upstream DTB names already match
- Fix bcm2835-rpi-zero.dtb: was copied from bcm2708-rpi-b-plus (wrong
board), now uses bcm2708-rpi-zero
- Drop bcm2711-rpi-4-b -> bcm2838-rpi-4-b copy; nothing uses bcm2838-*
Ref: https://github.com/u-boot/u-boot/blob/master/board/raspberrypi/rpi/rpi.c
lib.overrideDerivation is deprecated and strips passthru attributes
(.configfile, .moduleBuildDependencies, etc.) from the kernel
derivation, which breaks downstream users expecting a standard
buildLinux output.
.overrideAttrs preserves passthru and matches every other custom
kernel in this repo.