diff --git a/hacking/nix/scope/plat-utils/rpi4/default.nix b/hacking/nix/scope/plat-utils/rpi4/default.nix index e04a08e1f..40b24d658 100644 --- a/hacking/nix/scope/plat-utils/rpi4/default.nix +++ b/hacking/nix/scope/plat-utils/rpi4/default.nix @@ -1,4 +1,4 @@ -{ lib, callPackage +{ lib, hostPlatform, callPackage , runCommand, writeText , fetchFromGitHub , ubootTools @@ -19,8 +19,9 @@ let configTxt = writeText "config.txt" '' enable_uart=1 - arm_64bit=1 + arm_64bit=${if hostPlatform.is32bit then "0" else "1"} ''; + # for debugging: # start_debug=1 # uart_2ndstage=1 @@ -47,6 +48,8 @@ let ${uBootEnvTxt} ''; + kernelFileName = "kernel${if hostPlatform.is32bit then "7l" else "8"}.img"; + mkBootLinks = { image ? null , extraCommands ? "" @@ -60,7 +63,7 @@ let ln -sf ${configTxt} $out/config.txt rm $out/kernel*.img - ln -s ${uBootBin} $out/kernel8.img + ln -s ${uBootBin} $out/${kernelFileName} ln -s ${uBootEnv} $out/uboot.env diff --git a/hacking/nix/scope/plat-utils/rpi4/u-boot.nix b/hacking/nix/scope/plat-utils/rpi4/u-boot.nix index 24b61e1be..5b00a7ca0 100644 --- a/hacking/nix/scope/plat-utils/rpi4/u-boot.nix +++ b/hacking/nix/scope/plat-utils/rpi4/u-boot.nix @@ -51,8 +51,7 @@ stdenv.mkDerivation rec { ] ++ makeTargets; installPhase = '' - mkdir $out - cp ${lib.concatStringsSep " " filesToInstall} $out + install -D -t $out ${lib.concatStringsSep " " filesToInstall} ''; dontStrip = true;