chore: fmt
parent
9a857c346d
commit
3715c6d77a
|
@ -40,7 +40,6 @@ in {
|
||||||
imports = with inputs.self.nixosModules; [
|
imports = with inputs.self.nixosModules; [
|
||||||
"${inputs.nixpkgs}/nixos/modules/installer/sd-card/sd-image.nix"
|
"${inputs.nixpkgs}/nixos/modules/installer/sd-card/sd-image.nix"
|
||||||
common
|
common
|
||||||
# inputs.impermanence.nixosModule
|
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs.overlays = [ inputs.self.overlays.rpi5 ];
|
nixpkgs.overlays = [ inputs.self.overlays.rpi5 ];
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
{ stdenv, lib, buildPackages, fetchFromGitHub, perl, buildLinux, rpiVersion, ... } @ args:
|
{ stdenv, lib, buildPackages, fetchFromGitHub, perl, buildLinux, rpiVersion, ...
|
||||||
|
}@args:
|
||||||
|
|
||||||
let
|
let
|
||||||
# NOTE: raspberrypifw & raspberryPiWirelessFirmware should be updated with this
|
# NOTE: raspberrypifw & raspberryPiWirelessFirmware should be updated with this
|
||||||
modDirVersion = "6.1.73";
|
modDirVersion = "6.1.73";
|
||||||
tag = "stable_20240124";
|
tag = "stable_20240124";
|
||||||
in
|
in lib.overrideDerivation (buildLinux (args // {
|
||||||
lib.overrideDerivation (buildLinux (args // {
|
|
||||||
version = "${modDirVersion}-${tag}";
|
version = "${modDirVersion}-${tag}";
|
||||||
inherit modDirVersion;
|
inherit modDirVersion;
|
||||||
|
|
||||||
|
@ -19,23 +19,24 @@ lib.overrideDerivation (buildLinux (args // {
|
||||||
defconfig = {
|
defconfig = {
|
||||||
"1" = "bcmrpi_defconfig";
|
"1" = "bcmrpi_defconfig";
|
||||||
"2" = "bcm2709_defconfig";
|
"2" = "bcm2709_defconfig";
|
||||||
"3" = if stdenv.hostPlatform.isAarch64 then "bcmrpi3_defconfig" else "bcm2709_defconfig";
|
"3" = if stdenv.hostPlatform.isAarch64 then
|
||||||
|
"bcmrpi3_defconfig"
|
||||||
|
else
|
||||||
|
"bcm2709_defconfig";
|
||||||
"4" = "bcm2711_defconfig";
|
"4" = "bcm2711_defconfig";
|
||||||
"5" = "bcm2712_defconfig";
|
"5" = "bcm2712_defconfig";
|
||||||
}.${toString rpiVersion};
|
}.${toString rpiVersion};
|
||||||
|
|
||||||
features = {
|
features = { efiBootStub = false; } // (args.features or { });
|
||||||
efiBootStub = false;
|
|
||||||
} // (args.features or {});
|
|
||||||
|
|
||||||
extraMeta = if (rpiVersion < 3) then {
|
extraMeta = if (rpiVersion < 3) then {
|
||||||
platforms = with lib.platforms; arm;
|
platforms = with lib.platforms; arm;
|
||||||
hydraPlatforms = [];
|
hydraPlatforms = [ ];
|
||||||
} else {
|
} else {
|
||||||
platforms = with lib.platforms; arm ++ aarch64;
|
platforms = with lib.platforms; arm ++ aarch64;
|
||||||
hydraPlatforms = [ "aarch64-linux" ];
|
hydraPlatforms = [ "aarch64-linux" ];
|
||||||
};
|
};
|
||||||
} // (args.argsOverride or {}))) (oldAttrs: {
|
} // (args.argsOverride or { }))) (oldAttrs: {
|
||||||
postConfigure = ''
|
postConfigure = ''
|
||||||
# The v7 defconfig has this set to '-v7' which screws up our modDirVersion.
|
# The v7 defconfig has this set to '-v7' which screws up our modDirVersion.
|
||||||
sed -i $buildRoot/.config -e 's/^CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION=""/'
|
sed -i $buildRoot/.config -e 's/^CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION=""/'
|
||||||
|
@ -50,24 +51,27 @@ lib.overrideDerivation (buildLinux (args // {
|
||||||
copyDTB() {
|
copyDTB() {
|
||||||
cp -v "$dtbDir/$1" "$dtbDir/$2"
|
cp -v "$dtbDir/$1" "$dtbDir/$2"
|
||||||
}
|
}
|
||||||
'' + lib.optionalString (lib.elem stdenv.hostPlatform.system ["armv6l-linux"]) ''
|
'' + lib.optionalString
|
||||||
copyDTB bcm2708-rpi-zero-w.dtb bcm2835-rpi-zero.dtb
|
(lib.elem stdenv.hostPlatform.system [ "armv6l-linux" ]) ''
|
||||||
copyDTB bcm2708-rpi-zero-w.dtb bcm2835-rpi-zero-w.dtb
|
copyDTB bcm2708-rpi-zero-w.dtb bcm2835-rpi-zero.dtb
|
||||||
copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-a.dtb
|
copyDTB bcm2708-rpi-zero-w.dtb bcm2835-rpi-zero-w.dtb
|
||||||
copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-b.dtb
|
copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-a.dtb
|
||||||
copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-b-rev2.dtb
|
copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-b.dtb
|
||||||
copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-a-plus.dtb
|
copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-b-rev2.dtb
|
||||||
copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-b-plus.dtb
|
copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-a-plus.dtb
|
||||||
copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-zero.dtb
|
copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-b-plus.dtb
|
||||||
copyDTB bcm2708-rpi-cm.dtb bcm2835-rpi-cm.dtb
|
copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-zero.dtb
|
||||||
'' + lib.optionalString (lib.elem stdenv.hostPlatform.system ["armv7l-linux"]) ''
|
copyDTB bcm2708-rpi-cm.dtb bcm2835-rpi-cm.dtb
|
||||||
copyDTB bcm2709-rpi-2-b.dtb bcm2836-rpi-2-b.dtb
|
'' + lib.optionalString
|
||||||
'' + lib.optionalString (lib.elem stdenv.hostPlatform.system ["armv7l-linux" "aarch64-linux"]) ''
|
(lib.elem stdenv.hostPlatform.system [ "armv7l-linux" ]) ''
|
||||||
copyDTB bcm2710-rpi-zero-2.dtb bcm2837-rpi-zero-2.dtb
|
copyDTB bcm2709-rpi-2-b.dtb bcm2836-rpi-2-b.dtb
|
||||||
copyDTB bcm2710-rpi-3-b.dtb bcm2837-rpi-3-b.dtb
|
'' + lib.optionalString
|
||||||
copyDTB bcm2710-rpi-3-b-plus.dtb bcm2837-rpi-3-a-plus.dtb
|
(lib.elem stdenv.hostPlatform.system [ "armv7l-linux" "aarch64-linux" ]) ''
|
||||||
copyDTB bcm2710-rpi-3-b-plus.dtb bcm2837-rpi-3-b-plus.dtb
|
copyDTB bcm2710-rpi-zero-2.dtb bcm2837-rpi-zero-2.dtb
|
||||||
copyDTB bcm2710-rpi-cm3.dtb bcm2837-rpi-cm3.dtb
|
copyDTB bcm2710-rpi-3-b.dtb bcm2837-rpi-3-b.dtb
|
||||||
copyDTB bcm2711-rpi-4-b.dtb bcm2838-rpi-4-b.dtb
|
copyDTB bcm2710-rpi-3-b-plus.dtb bcm2837-rpi-3-a-plus.dtb
|
||||||
'';
|
copyDTB bcm2710-rpi-3-b-plus.dtb bcm2837-rpi-3-b-plus.dtb
|
||||||
|
copyDTB bcm2710-rpi-cm3.dtb bcm2837-rpi-cm3.dtb
|
||||||
|
copyDTB bcm2711-rpi-4-b.dtb bcm2838-rpi-4-b.dtb
|
||||||
|
'';
|
||||||
})
|
})
|
||||||
|
|
|
@ -50,7 +50,8 @@ stdenvNoCC.mkDerivation {
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Firmware for builtin Wifi/Bluetooth devices in the Raspberry Pi 3+ and Zero W";
|
description =
|
||||||
|
"Firmware for builtin Wifi/Bluetooth devices in the Raspberry Pi 3+ and Zero W";
|
||||||
homepage = "https://github.com/RPi-Distro/firmware-nonfree";
|
homepage = "https://github.com/RPi-Distro/firmware-nonfree";
|
||||||
license = licenses.unfreeRedistributableFirmware;
|
license = licenses.unfreeRedistributableFirmware;
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux;
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
{ lib, stdenv, fetchFromGitHub }:
|
{ lib, stdenv, fetchFromGitHub }:
|
||||||
|
|
||||||
let
|
let inherit (lib) optionals;
|
||||||
inherit (lib) optionals;
|
in stdenv.mkDerivation {
|
||||||
in
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
pname = "raspberrypi-armstubs";
|
pname = "raspberrypi-armstubs";
|
||||||
version = "unstable-2022-07-11";
|
version = "unstable-2022-07-11";
|
||||||
|
|
||||||
|
@ -11,12 +9,11 @@ stdenv.mkDerivation {
|
||||||
owner = "raspberrypi";
|
owner = "raspberrypi";
|
||||||
repo = "tools";
|
repo = "tools";
|
||||||
rev = "439b6198a9b340de5998dd14a26a0d9d38a6bcac";
|
rev = "439b6198a9b340de5998dd14a26a0d9d38a6bcac";
|
||||||
hash = "sha512-KMHgj73eXHT++IE8DbCsFeJ87ngc9R3XxMUJy4Z3s4/MtMeB9zblADHkyJqz9oyeugeJTrDtuVETPBRo7M4Y8A==";
|
hash =
|
||||||
|
"sha512-KMHgj73eXHT++IE8DbCsFeJ87ngc9R3XxMUJy4Z3s4/MtMeB9zblADHkyJqz9oyeugeJTrDtuVETPBRo7M4Y8A==";
|
||||||
};
|
};
|
||||||
|
|
||||||
env.NIX_CFLAGS_COMPILE = toString [
|
env.NIX_CFLAGS_COMPILE = toString [ "-march=armv8-a+crc" ];
|
||||||
"-march=armv8-a+crc"
|
|
||||||
];
|
|
||||||
|
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
cd armstubs
|
cd armstubs
|
||||||
|
@ -31,10 +28,12 @@ stdenv.mkDerivation {
|
||||||
"LD7=${stdenv.cc.targetPrefix}ld"
|
"LD7=${stdenv.cc.targetPrefix}ld"
|
||||||
"OBJCOPY7=${stdenv.cc.targetPrefix}objcopy"
|
"OBJCOPY7=${stdenv.cc.targetPrefix}objcopy"
|
||||||
"OBJDUMP7=${stdenv.cc.targetPrefix}objdump"
|
"OBJDUMP7=${stdenv.cc.targetPrefix}objdump"
|
||||||
]
|
] ++ optionals stdenv.isAarch64 [ "armstub8.bin" "armstub8-gic.bin" ]
|
||||||
++ optionals (stdenv.isAarch64) [ "armstub8.bin" "armstub8-gic.bin" ]
|
++ optionals stdenv.isAarch32 [
|
||||||
++ optionals (stdenv.isAarch32) [ "armstub7.bin" "armstub8-32.bin" "armstub8-32-gic.bin" ]
|
"armstub7.bin"
|
||||||
;
|
"armstub8-32.bin"
|
||||||
|
"armstub8-32-gic.bin"
|
||||||
|
];
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
|
|
@ -27,7 +27,8 @@ stdenvNoCC.mkDerivation rec {
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Firmware for the Raspberry Pi board";
|
description = "Firmware for the Raspberry Pi board";
|
||||||
homepage = "https://github.com/raspberrypi/firmware";
|
homepage = "https://github.com/raspberrypi/firmware";
|
||||||
license = licenses.unfreeRedistributableFirmware; # See https://github.com/raspberrypi/firmware/blob/master/boot/LICENCE.broadcom
|
license =
|
||||||
|
licenses.unfreeRedistributableFirmware; # See https://github.com/raspberrypi/firmware/blob/master/boot/LICENCE.broadcom
|
||||||
maintainers = with maintainers; [ dezgeg ];
|
maintainers = with maintainers; [ dezgeg ];
|
||||||
# Hash mismatch on source, mystery.
|
# Hash mismatch on source, mystery.
|
||||||
# Maybe due to https://github.com/NixOS/nix/issues/847
|
# Maybe due to https://github.com/NixOS/nix/issues/847
|
||||||
|
|
Loading…
Reference in New Issue