Skip to content

Commit

Permalink
nix: Add 32-bit support to platUtils.rpi4
Browse files Browse the repository at this point in the history
  • Loading branch information
nspin committed Aug 1, 2023
1 parent 3f24f7f commit afdabc6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 6 additions & 3 deletions hacking/nix/scope/plat-utils/rpi4/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, callPackage
{ lib, hostPlatform, callPackage
, runCommand, writeText
, fetchFromGitHub
, ubootTools
Expand All @@ -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

Expand All @@ -47,6 +48,8 @@ let
${uBootEnvTxt}
'';

kernelFileName = "kernel${if hostPlatform.is32bit then "7l" else "8"}.img";

mkBootLinks =
{ image ? null
, extraCommands ? ""
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions hacking/nix/scope/plat-utils/rpi4/u-boot.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit afdabc6

Please sign in to comment.