at 22.05-pre 84 lines 3.8 kB view raw
1{ stdenv, lib, buildPackages, fetchFromGitHub, perl, buildLinux, rpiVersion, ... } @ args: 2 3let 4 # NOTE: raspberrypifw & raspberryPiWirelessFirmware should be updated with this 5 modDirVersion = "5.10.52"; 6 tag = "1.20210805"; 7in 8lib.overrideDerivation (buildLinux (args // { 9 version = "${modDirVersion}-${tag}"; 10 inherit modDirVersion; 11 12 src = fetchFromGitHub { 13 owner = "raspberrypi"; 14 repo = "linux"; 15 rev = tag; 16 sha256 = "1j71xblflslfi4c3zx2srw6fahnhp3bjx4yjfqrp39kzaa41ij0b"; 17 }; 18 19 defconfig = { 20 "1" = "bcmrpi_defconfig"; 21 "2" = "bcm2709_defconfig"; 22 "3" = if stdenv.hostPlatform.isAarch64 then "bcmrpi3_defconfig" else "bcm2709_defconfig"; 23 "4" = "bcm2711_defconfig"; 24 }.${toString rpiVersion}; 25 26 features = { 27 efiBootStub = false; 28 } // (args.features or {}); 29 30 extraConfig = '' 31 # ../drivers/gpu/drm/ast/ast_mode.c:851:18: error: initialization of 'void (*)(struct drm_crtc *, struct drm_atomic_state *)' from incompatible pointer type 'void (*)(struct drm_crtc *, struct drm_crtc_state *)' [-Werror=incompatible-pointer-types] 32 # 851 | .atomic_flush = ast_crtc_helper_atomic_flush, 33 # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ 34 # ../drivers/gpu/drm/ast/ast_mode.c:851:18: note: (near initialization for 'ast_crtc_helper_funcs.atomic_flush') 35 DRM_AST n 36 # ../drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c: In function 'amdgpu_dm_atomic_commit_tail': 37 # ../drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:7757:4: error: implicit declaration of function 'is_hdr_metadata_different' [-Werror=implicit-function-declaration] 38 # 7757 | is_hdr_metadata_different(old_con_state, new_con_state); 39 # | ^~~~~~~~~~~~~~~~~~~~~~~~~ 40 DRM_AMDGPU n 41 ''; 42 43 extraMeta = if (rpiVersion < 3) then { 44 platforms = with lib.platforms; [ arm ]; 45 hydraPlatforms = []; 46 } else { 47 platforms = with lib.platforms; [ arm aarch64 ]; 48 hydraPlatforms = [ "aarch64-linux" ]; 49 }; 50} // (args.argsOverride or {}))) (oldAttrs: { 51 postConfigure = '' 52 # The v7 defconfig has this set to '-v7' which screws up our modDirVersion. 53 sed -i $buildRoot/.config -e 's/^CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION=""/' 54 sed -i $buildRoot/include/config/auto.conf -e 's/^CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION=""/' 55 ''; 56 57 # Make copies of the DTBs named after the upstream names so that U-Boot finds them. 58 # This is ugly as heck, but I don't know a better solution so far. 59 postFixup = '' 60 dtbDir=${if stdenv.isAarch64 then "$out/dtbs/broadcom" else "$out/dtbs"} 61 rm $dtbDir/bcm283*.dtb 62 copyDTB() { 63 cp -v "$dtbDir/$1" "$dtbDir/$2" 64 } 65 '' + lib.optionalString (lib.elem stdenv.hostPlatform.system ["armv6l-linux"]) '' 66 copyDTB bcm2708-rpi-zero-w.dtb bcm2835-rpi-zero.dtb 67 copyDTB bcm2708-rpi-zero-w.dtb bcm2835-rpi-zero-w.dtb 68 copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-a.dtb 69 copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-b.dtb 70 copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-b-rev2.dtb 71 copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-a-plus.dtb 72 copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-b-plus.dtb 73 copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-zero.dtb 74 copyDTB bcm2708-rpi-cm.dtb bcm2835-rpi-cm.dtb 75 '' + lib.optionalString (lib.elem stdenv.hostPlatform.system ["armv7l-linux"]) '' 76 copyDTB bcm2709-rpi-2-b.dtb bcm2836-rpi-2-b.dtb 77 '' + lib.optionalString (lib.elem stdenv.hostPlatform.system ["armv7l-linux" "aarch64-linux"]) '' 78 copyDTB bcm2710-rpi-3-b.dtb bcm2837-rpi-3-b.dtb 79 copyDTB bcm2710-rpi-3-b-plus.dtb bcm2837-rpi-3-a-plus.dtb 80 copyDTB bcm2710-rpi-3-b-plus.dtb bcm2837-rpi-3-b-plus.dtb 81 copyDTB bcm2710-rpi-cm3.dtb bcm2837-rpi-cm3.dtb 82 copyDTB bcm2711-rpi-4-b.dtb bcm2838-rpi-4-b.dtb 83 ''; 84})