1{ stdenv, hostPlatform, fetchFromGitHub, perl, buildLinux, ... } @ args:
2
3let
4 modDirVersion = "4.9.41";
5 tag = "1.20170811";
6in
7stdenv.lib.overrideDerivation (import ./generic.nix (args // rec {
8 version = "${modDirVersion}-${tag}";
9 inherit modDirVersion;
10
11 src = fetchFromGitHub {
12 owner = "raspberrypi";
13 repo = "linux";
14 rev = "raspberrypi-kernel_${tag}-1";
15 sha256 = "1ly0x7a43zvig0fv7lc6rpq49pcdb7i9sdb78p4gi5485zap40kb";
16 };
17
18 features.iwlwifi = true;
19 features.needsCifsUtils = true;
20 features.netfilterRPFilter = true;
21
22 extraMeta.hydraPlatforms = [];
23})) (oldAttrs: {
24 postConfigure = ''
25 # The v7 defconfig has this set to '-v7' which screws up our modDirVersion.
26 sed -i $buildRoot/.config -e 's/^CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION=""/'
27 '';
28
29 postFixup = ''
30 # Make copies of the DTBs so that U-Boot finds them, as it is looking for the upstream names.
31 # This is ugly as heck.
32 copyDTB() {
33 if [ -f "$out/dtbs/$1" ]; then
34 cp -v "$out/dtbs/$1" "$out/dtbs/$2"
35 fi
36 }
37
38 # I am not sure if all of these are correct...
39 copyDTB bcm2708-rpi-0-w.dts bcm2835-rpi-zero.dtb
40 copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-a.dtb
41 copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-b.dtb
42 copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-b-rev2.dtb
43 copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-a-plus.dtb
44 copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-b-plus.dtb
45 copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-zero.dtb
46 copyDTB bcm2708-rpi-cm.dtb bcm2835-rpi-cm.dtb
47 copyDTB bcm2709-rpi-2-b.dtb bcm2836-rpi-2-b.dtb
48 copyDTB bcm2710-rpi-3-b.dtb bcm2837-rpi-3-b.dtb
49 # bcm2710-rpi-cm3.dts is yet unknown.
50 '';
51})