Merge pull request #53065 from matthewbauer/rpi-cross-fixes

Raspberry Pi cross compilation branch
This commit is contained in:
Matthew Bauer 2019-01-03 15:34:31 -06:00 committed by GitHub
commit 9b0e45bf8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 18 additions and 42 deletions

View File

@ -38,7 +38,7 @@ in {
firmwareLinuxNonfree
intel2200BGFirmware
rtl8192su-firmware
] ++ optional (pkgs.stdenv.isAarch32 || pkgs.stdenv.isAarch64) raspberrypiWirelessFirmware
] ++ optional (pkgs.stdenv.hostPlatform.isAarch32 || pkgs.stdenv.hostPlatform.isAarch64) raspberrypiWirelessFirmware
++ optionals (versionOlder config.boot.kernelPackages.kernel.version "4.13") [
rtl8723bs-firmware
];

View File

@ -5,7 +5,7 @@
let
extlinux-conf-builder =
import ../../system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.nix {
inherit pkgs;
pkgs = pkgs.buildPackages;
};
in
{
@ -15,13 +15,6 @@ in
./sd-image.nix
];
assertions = lib.singleton {
assertion = pkgs.stdenv.hostPlatform.system == "aarch64-linux"
&& pkgs.stdenv.hostPlatform.system == pkgs.stdenv.buildPlatform.system;
message = "sd-image-aarch64.nix can be only built natively on Aarch64 / ARM64; " +
"it cannot be cross compiled";
};
boot.loader.grub.enable = false;
boot.loader.generic-extlinux-compatible.enable = true;

View File

@ -5,7 +5,7 @@
let
extlinux-conf-builder =
import ../../system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.nix {
inherit pkgs;
pkgs = pkgs.buildPackages;
};
in
{
@ -15,13 +15,6 @@ in
./sd-image.nix
];
assertions = lib.singleton {
assertion = pkgs.stdenv.hostPlatform.system == "armv7l-linux"
&& pkgs.stdenv.hostPlatform.system == pkgs.stdenv.buildPlatform.system;
message = "sd-image-armv7l-multiplatform.nix can be only built natively on ARMv7; " +
"it cannot be cross compiled";
};
boot.loader.grub.enable = false;
boot.loader.generic-extlinux-compatible.enable = true;

View File

@ -5,7 +5,7 @@
let
extlinux-conf-builder =
import ../../system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.nix {
inherit pkgs;
pkgs = pkgs.buildPackages;
};
in
{
@ -15,13 +15,6 @@ in
./sd-image.nix
];
assertions = lib.singleton {
assertion = pkgs.stdenv.hostPlatform.system == "armv6l-linux"
&& pkgs.stdenv.hostPlatform.system == pkgs.stdenv.buildPlatform.system;
message = "sd-image-raspberrypi.nix can be only built natively on ARMv6; " +
"it cannot be cross compiled";
};
boot.loader.grub.enable = false;
boot.loader.generic-extlinux-compatible.enable = true;

View File

@ -7,8 +7,8 @@ let
generationsDirBuilder = pkgs.substituteAll {
src = ./generations-dir-builder.sh;
isExecutable = true;
inherit (pkgs) bash;
path = [pkgs.coreutils pkgs.gnused pkgs.gnugrep];
inherit (pkgs.buildPackages) bash;
path = with pkgs.buildPackages; [coreutils gnused gnugrep];
inherit (config.boot.loader.generationsDir) copyKernels;
};

View File

@ -8,7 +8,7 @@ let
timeoutStr = if blCfg.timeout == null then "-1" else toString blCfg.timeout;
builder = import ./extlinux-conf-builder.nix { inherit pkgs; };
builder = import ./extlinux-conf-builder.nix { pkgs = pkgs.buildPackages; };
in
{
options = {

View File

@ -7,8 +7,8 @@ let
initScriptBuilder = pkgs.substituteAll {
src = ./init-script-builder.sh;
isExecutable = true;
inherit (pkgs) bash;
path = [pkgs.coreutils pkgs.gnused pkgs.gnugrep];
inherit (pkgs.buildPackages) bash;
path = with pkgs.buildPackages; [coreutils gnused gnugrep];
};
in

View File

@ -19,7 +19,7 @@ let
blCfg = config.boot.loader;
timeoutStr = if blCfg.timeout == null then "-1" else toString blCfg.timeout;
isAarch64 = pkgs.stdenv.isAarch64;
isAarch64 = pkgs.stdenv.hostPlatform.isAarch64;
optional = pkgs.stdenv.lib.optionalString;
configTxt =
@ -97,7 +97,7 @@ in
config = mkIf cfg.enable {
assertions = singleton {
assertion = !pkgs.stdenv.isAarch64 || cfg.version == 3;
assertion = !pkgs.stdenv.hostPlatform.isAarch64 || cfg.version == 3;
message = "Only Raspberry Pi 3 supports aarch64.";
};

View File

@ -1,7 +1,7 @@
{ pkgs, version, configTxt }:
let
isAarch64 = pkgs.stdenv.isAarch64;
isAarch64 = pkgs.stdenv.hostPlatform.isAarch64;
uboot =
if version == 0 then
@ -18,18 +18,17 @@ let
extlinuxConfBuilder =
import ../generic-extlinux-compatible/extlinux-conf-builder.nix {
inherit pkgs;
pkgs = pkgs.buildPackages;
};
in
pkgs.substituteAll {
src = ./uboot-builder.sh;
isExecutable = true;
inherit (pkgs) bash;
path = [pkgs.coreutils pkgs.gnused pkgs.gnugrep];
inherit (pkgs.buildPackages) bash;
path = with pkgs.buildPackages; [coreutils gnused gnugrep];
firmware = pkgs.raspberrypifw;
inherit uboot;
inherit configTxt;
inherit extlinuxConfBuilder;
inherit version;
}

View File

@ -12,7 +12,7 @@ let
isExecutable = true;
inherit (pkgs) python3;
inherit (pkgs.buildPackages) python3;
systemd = config.systemd.package;

View File

@ -11,10 +11,8 @@ stdenv.mkDerivation rec {
sha256 = "1wyffskbkzj5zyhjnnpip80xzsjcr3p0q5486z3wdwabnysnhn8n";
};
# for cross-compiling we need pcre.dev in nativeBuildInputs to get pcre-config
nativeBuildInputs = [ autoconf automake libtool bison pcre.dev ];
disallowedReferences = [ buildPackages.pcre.dev ];
PCRE_CONFIG = "${pcre.dev}/bin/pcre-config";
nativeBuildInputs = [ autoconf automake libtool bison ];
buildInputs = [ pcre ];
configureFlags = [ "--without-tcl" ];