3
0
Fork 0
forked from mirrors/nixpkgs

U-Boot: 2017.03 -> 2017.11

Also move patches from sd-image-aarch64.nix, they might be useful for
the older raspberries as well.
This commit is contained in:
Tuomas Tynkkynen 2017-11-07 01:56:59 +02:00 committed by Tuomas Tynkkynen
parent bd47e17234
commit 931aa5f9e2
2 changed files with 24 additions and 17 deletions

View file

@ -40,16 +40,6 @@ 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
@ -57,7 +47,7 @@ in
'';
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
'';

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, bc, dtc, python2
{ stdenv, fetchurl, fetchpatch, bc, dtc, python2
, hostPlatform
}:
@ -12,20 +12,37 @@ 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";
};
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" ];
postPatch = ''
patchShebangs tools
'';
makeFlags = [ "DTC=dtc" ];
configurePhase = ''
make ${defconfig}