Skip to content

Commit

Permalink
U-Boot: 2017.03 -> 2017.11
Browse files Browse the repository at this point in the history
Also move patches from sd-image-aarch64.nix, they might be useful for
the older raspberries as well.
  • Loading branch information
dezgeg committed Nov 18, 2017
1 parent bd47e17 commit 931aa5f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 17 deletions.
12 changes: 1 addition & 11 deletions nixos/modules/installer/cd-dvd/sd-image-aarch64.nix
Expand Up @@ -40,24 +40,14 @@ in

sdImage = {
populateBootCommands = let
# Contains a couple of fixes for booting a Linux kernel, will hopefully appear upstream soon.
patchedUboot = pkgs.ubootRaspberryPi3_64bit.overrideAttrs (oldAttrs: {
src = pkgs.fetchFromGitHub {
owner = "dezgeg";
repo = "u-boot";
rev = "baab53ec244fe44def01948a0f10e67342d401e6";
sha256 = "0r5j2pc42ws3w3im0a9c6bh01czz5kapqrqp0ik9ra823cw73lxr";
};
});

configTxt = pkgs.writeText "config.txt" ''
kernel=u-boot-rpi3.bin
arm_control=0x200
enable_uart=1
'';
in ''
(cd ${pkgs.raspberrypifw}/share/raspberrypi/boot && cp bootcode.bin fixup*.dat start*.elf $NIX_BUILD_TOP/boot/)
cp ${patchedUboot}/u-boot.bin boot/u-boot-rpi3.bin
cp ${pkgs.ubootRaspberryPi3_64bit}/u-boot.bin boot/u-boot-rpi3.bin
cp ${configTxt} boot/config.txt
${extlinux-conf-builder} -t 3 -c ${config.system.build.toplevel} -d ./boot
'';
Expand Down
29 changes: 23 additions & 6 deletions pkgs/misc/uboot/default.nix
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, bc, dtc, python2
{ stdenv, fetchurl, fetchpatch, bc, dtc, python2
, hostPlatform
}:

Expand All @@ -12,21 +12,38 @@ let
stdenv.mkDerivation (rec {

name = "uboot-${defconfig}-${version}";
version = "2017.03";
version = "2017.11";

src = fetchurl {
url = "ftp://ftp.denx.de/pub/u-boot/u-boot-${version}.tar.bz2";
sha256 = "0gqihplap05dlpwdb971wsqyv01nz2vabwq5g5649gr5jczsyjzm";
sha256 = "01bcsah5imy6m3fbjwhqywxg0pfk5fl8ks9ylb7kv3zmrb9qy0ba";
};

nativeBuildInputs = [ bc dtc python2 ];

hardeningDisable = [ "all" ];
patches = [
(fetchpatch {
url = https://github.com/dezgeg/u-boot/commit/rpi-2017-11-patch1.patch;
sha256 = "067yq55vv1slv4xy346px7h329pi14abdn04chg6s1s6hmf6c1x9";
})
(fetchpatch {
url = https://github.com/dezgeg/u-boot/commit/rpi-2017-11-patch2.patch;
sha256 = "0bbw0q027xvzvdxxvpzjajg4rm30a8mb7z74b6ma9q0l7y7bi0c4";
})
(fetchpatch {
url = https://github.com/dezgeg/u-boot/commit/pythonpath-2017-11.patch;
sha256 = "162b2lglp307pzxsf9m7nnmzwxqd7xkwp5j85bm6bg1a38ngpl9v";
})
];

postPatch = ''
patchShebangs tools
'';

nativeBuildInputs = [ bc dtc python2 ];

hardeningDisable = [ "all" ];

makeFlags = [ "DTC=dtc" ];

configurePhase = ''
make ${defconfig}
'';
Expand Down

0 comments on commit 931aa5f

Please sign in to comment.