Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1da25dd10457
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 91b09422cf6f
Choose a head ref
  • 17 commits
  • 10 files changed
  • 3 contributors

Commits on Mar 25, 2018

  1. uboot: 2017.11 -> 2018.03, cross fixes

    (cherry picked from commit 5804547)
    lopsided98 authored and dezgeg committed Mar 25, 2018
    Copy the full SHA
    7c46833 View commit details
  2. uboot: add Rock64 support

    The bootloader is currently non-functional because it lacks the ARM Trusted
    Firmware image (bl31.elf).
    
    (cherry picked from commit 6f5a0bd)
    lopsided98 authored and dezgeg committed Mar 25, 2018
    Copy the full SHA
    dc01b66 View commit details
  3. maintainers: add lopsided98

    (cherry picked from commit 0264c9b)
    lopsided98 authored and dezgeg committed Mar 25, 2018
    Copy the full SHA
    e794f9a View commit details
  4. arm-trusted-firmware: init

    ARM trusted firmware is required as part of the boot process on some ARMv8-A
    boards. Currently, only the RK3328 is supported in nixpkgs.
    
    This makes the Rock64 u-boot image bootable.
    
    (cherry picked from commit 0ab76c5)
    lopsided98 authored and dezgeg committed Mar 25, 2018
    Copy the full SHA
    94c403f View commit details
  5. uboot: add patch to increase maximum path length in extlinux.conf

    This fixes problems with cross compiled kernels failing to boot.
    
    (cherry picked from commit 1f4bb8c)
    lopsided98 authored and dezgeg committed Mar 25, 2018
    Copy the full SHA
    828fdd6 View commit details
  6. uboot: rock64: use binary blob for TPL

    This stops the kernel from crashing immediately after boot.
    
    (cherry picked from commit ba3e470)
    lopsided98 authored and dezgeg committed Mar 25, 2018
    Copy the full SHA
    b0abe78 View commit details
  7. uboot: sheevplug and guruplug: use mainline U-Boot

    These derivations have not seen any updates since they were created in 2010,
    and some of their sources have disappeared. There are upstream configs for
    these boards, so these are now used, and they build correctly. I have no way
    of testing them, and I don't if anyone even uses either board with Nix anymore.
    
    (cherry picked from commit 01020b3)
    lopsided98 authored and dezgeg committed Mar 25, 2018
    Copy the full SHA
    48ade50 View commit details
  8. uboot: fix cross-build of ubootTools

    (cherry picked from commit 28fd7d9)
    lopsided98 authored and dezgeg committed Mar 25, 2018
    Copy the full SHA
    4c669db View commit details
  9. U-Boot: Add AArch64 QEMU build

    See
    
    https://github.com/u-boot/u-boot/blob/master/doc/README.qemu-arm
    
    on how to use it.
    
    (cherry picked from commit 6b069c6)
    dezgeg committed Mar 25, 2018
    Copy the full SHA
    eff6d96 View commit details
  10. arm-trusted-firmware: Inits at various versions

    For qemu, at 1.4 from upstream.
    
    For Sopine / Pine A64-LTS, at 1.0 from fork.
    
    (cherry picked from commit f2175e1)
    samueldr authored and dezgeg committed Mar 25, 2018
    Copy the full SHA
    cf87889 View commit details
  11. U-Boot: Add SOPINE Baseboard build

    This build is compatible with PINE A64-LTS.
    
    [dezgeg changed the original device tree patch to v4 of the patch series
    "sunxi: sync H3, H5, A64 DTs from mainline Linux" submitted to the
    upstream mailing list by Andre Przywara. Also install the
    u-boot-sunxi-with-spl.bin binary similar to 32-bit boards
    since it's now being built by the upstream build system.]
    
    (cherry picked from commit 2ff31f7)
    samueldr authored and dezgeg committed Mar 25, 2018
    Copy the full SHA
    176d151 View commit details
  12. U-Boot: Add Pine64 build

    (cherry picked from commit 4b77663)
    dezgeg committed Mar 25, 2018
    Copy the full SHA
    1896fcf View commit details
  13. U-Boot: Make ubootJetsonTK1 install even more files

    (cherry picked from commit 4fe75d1)
    dezgeg committed Mar 25, 2018
    Copy the full SHA
    a68e60f View commit details
  14. armTrustedFirmware: Remove targetPlatforms like was done in U-Boot

    Should also fix Hydra attempting to build this stuff on x86, like
    https://hydra.nixos.org/build/71533289
    
    (cherry picked from commit a2d8a9a)
    dezgeg committed Mar 25, 2018
    Copy the full SHA
    298ea40 View commit details
  15. armTrustedFirmwareQemu: 1.4 -> 1.5, fixes build with GCC7

    (cherry picked from commit 107eaa8)
    dezgeg committed Mar 25, 2018
    Copy the full SHA
    f2c9a25 View commit details
  16. armTrustedFirmware: Disable parallel build

    I think https://hydra.nixos.org/build/71541345 is parallel build
    related.
    
    (cherry picked from commit bab5a06)
    dezgeg committed Mar 25, 2018
    Copy the full SHA
    c4597d2 View commit details
  17. U-Boot: Disable parallel build

    dezgeg committed Mar 25, 2018
    Copy the full SHA
    91b0942 View commit details
5 changes: 5 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
@@ -2022,6 +2022,11 @@
github = "lo1tuma";
name = "Mathias Schreck";
};
lopsided98 = {
email = "benwolsieffer@gmail.com";
github = "lopsided98";
name = "Ben Wolsieffer";
};
loskutov = {
email = "ignat.loskutov@gmail.com";
github = "loskutov";
85 changes: 85 additions & 0 deletions pkgs/misc/arm-trusted-firmware/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{ stdenv, fetchFromGitHub, buildPackages }:

let
buildArmTrustedFirmware = { filesToInstall
, installDir ? "$out"
, platform
, extraMakeFlags ? []
, extraMeta ? {}
, ... } @ args:
stdenv.mkDerivation (rec {

name = "arm-trusted-firmware-${platform}-${version}";
version = "1.5";

src = fetchFromGitHub {
owner = "ARM-software";
repo = "arm-trusted-firmware";
rev = "refs/tags/v${version}";
sha256 = "1gm0bn2llzfzz9bfsz11fhwxj5lxvyrq7bc13fjj033nljzxn7k8";
};

depsBuildBuild = [ buildPackages.stdenv.cc ];

makeFlags = [
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
"PLAT=${platform}"
] ++ extraMakeFlags;

installPhase = ''
runHook preInstall
mkdir -p ${installDir}
cp ${stdenv.lib.concatStringsSep " " filesToInstall} ${installDir}
runHook postInstall
'';

hardeningDisable = [ "all" ];
dontStrip = true;

# Fatal error: can't create build/sun50iw1p1/release/bl31/sunxi_clocks.o: No such file or directory
enableParallelBuilding = false;

meta = with stdenv.lib; {
homepage = https://github.com/ARM-software/arm-trusted-firmware;
description = "A reference implementation of secure world software for ARMv8-A";
license = licenses.bsd3;
maintainers = [ maintainers.lopsided98 ];
} // extraMeta;
} // builtins.removeAttrs args [ "extraMeta" ]);

in rec {
inherit buildArmTrustedFirmware;

armTrustedFirmwareAllwinner = buildArmTrustedFirmware rec {
version = "1.0";
src = fetchFromGitHub {
owner = "apritzel";
repo = "arm-trusted-firmware";
# Branch: `allwinner`
rev = "91f2402d941036a0db092d5375d0535c270b9121";
sha256 = "0lbipkxb01w97r6ah8wdbwxir3013rp249fcqhlzh2gjwhp5l1ys";
};
platform = "sun50iw1p1";
extraMeta.platforms = ["aarch64-linux"];
filesToInstall = ["build/${platform}/release/bl31.bin"];
};

armTrustedFirmwareQemu = buildArmTrustedFirmware rec {
platform = "qemu";
extraMeta.platforms = ["aarch64-linux"];
filesToInstall = [
"build/${platform}/release/bl1.bin"
"build/${platform}/release/bl2.bin"
"build/${platform}/release/bl31.bin"
];
};

armTrustedFirmwareRK3328 = buildArmTrustedFirmware rec {
extraMakeFlags = [ "bl31" ];
platform = "rk3328";
extraMeta.platforms = ["aarch64-linux"];
filesToInstall = [ "build/${platform}/release/bl31/bl31.elf"];
};
}
138 changes: 95 additions & 43 deletions pkgs/misc/uboot/default.nix
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
{ stdenv, fetchurl, fetchpatch, bc, dtc, openssl, python2
, hostPlatform
{ stdenv, fetchurl, fetchpatch, bc, dtc, openssl, python2, swig
, armTrustedFirmwareAllwinner
, hostPlatform, buildPackages
}:

let
buildUBoot = { targetPlatforms
, filesToInstall
# Various changes for 64-bit sunxi boards, (hopefully) destined for 2018.05
sunxiPatch = fetchpatch {
name = "sunxi.patch";
url = "https://github.com/u-boot/u-boot/compare/v2018.03...dezgeg:2018-03-sunxi.patch";
sha256 = "1pqn7c6c06hfygwpcgaraqvqxcjhz99j0rx5psfhj8igy0qvk2dq";
};

buildUBoot = { filesToInstall
, installDir ? "$out"
, defconfig
, extraPatches ? []
, extraMakeFlags ? []
, extraMeta ? {}
, ... } @ args:
stdenv.mkDerivation (rec {

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

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

patches = [
(fetchpatch {
url = https://github.com/dezgeg/u-boot/commit/cbsize-2017-11.patch;
sha256 = "08rqsrj78aif8vaxlpwiwwv1jwf0diihbj0h88hc0mlp0kmyqxwm";
})
(fetchpatch {
url = https://github.com/dezgeg/u-boot/commit/rpi-2017-11-patch1.patch;
sha256 = "067yq55vv1slv4xy346px7h329pi14abdn04chg6s1s6hmf6c1x9";
@@ -34,23 +38,35 @@ let
sha256 = "0bbw0q027xvzvdxxvpzjajg4rm30a8mb7z74b6ma9q0l7y7bi0c4";
})
(fetchpatch {
url = https://github.com/dezgeg/u-boot/commit/pythonpath-2017-11.patch;
sha256 = "162b2lglp307pzxsf9m7nnmzwxqd7xkwp5j85bm6bg1a38ngpl9v";
url = https://github.com/dezgeg/u-boot/commit/pythonpath-2018-03.patch;
sha256 = "1rhhlhrwhv7ic1n5i720jfh2cxwrkssrkvinllyjy3j9k9bpzcqd";
})
];
(fetchpatch {
url = https://github.com/dezgeg/u-boot/commit/extlinux-path-length-2018-03.patch;
sha256 = "07jafdnxvqv8lz256qy29agjc2k1zj5ad4k28r1w5qkhwj4ixmf8";
})
] ++ extraPatches;

postPatch = ''
patchShebangs tools
'';

nativeBuildInputs = [ bc dtc openssl python2 ];
nativeBuildInputs = [ bc dtc openssl python2 swig ];
depsBuildBuild = [ buildPackages.stdenv.cc ];

hardeningDisable = [ "all" ];

makeFlags = [ "DTC=dtc" ] ++ extraMakeFlags;
makeFlags = [
"DTC=dtc"
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
] ++ extraMakeFlags;

configurePhase = ''
runHook preConfigure
make ${defconfig}
runHook postConfigure
'';

installPhase = ''
@@ -62,36 +78,33 @@ let
runHook postInstall
'';

enableParallelBuilding = true;
dontStrip = true;
# make[2]: *** No rule to make target 'lib/efi_loader/helloworld.efi', needed by '__build'. Stop.
enableParallelBuilding = false;

crossAttrs = {
makeFlags = [
"ARCH=${hostPlatform.platform.kernelArch}"
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
];
};
dontStrip = true;

meta = with stdenv.lib; {
homepage = http://www.denx.de/wiki/U-Boot/;
description = "Boot loader for embedded systems";
license = licenses.gpl2;
maintainers = [ maintainers.dezgeg ];
platforms = targetPlatforms;
} // extraMeta;
} // args);
} // removeAttrs args [ "extraMeta" ]);

in rec {
inherit buildUBoot;

ubootTools = buildUBoot rec {
defconfig = "allnoconfig";
installDir = "$out/bin";
buildFlags = "tools NO_SDL=1";
hardeningDisable = [];
dontStrip = false;
targetPlatforms = stdenv.lib.platforms.linux;
extraMeta.platforms = stdenv.lib.platforms.linux;
# build tools/kwboot
extraMakeFlags = [ "CONFIG_KIRKWOOD=y" ];
extraMakeFlags = [ "CONFIG_KIRKWOOD=y" "CROSS_BUILD_TOOLS=1" "NO_SDL=1" "tools" ];
postConfigure = ''
sed -i '/CONFIG_SYS_TEXT_BASE/c\CONFIG_SYS_TEXT_BASE=0x00000000' .config
'';
filesToInstall = [
"tools/dumpimage"
"tools/fdtgrep"
@@ -103,86 +116,125 @@ in rec {

ubootA20OlinuxinoLime = buildUBoot rec {
defconfig = "A20-OLinuXino-Lime_defconfig";
targetPlatforms = ["armv7l-linux"];
extraMeta.platforms = ["armv7l-linux"];
filesToInstall = ["u-boot-sunxi-with-spl.bin"];
};

ubootBananaPi = buildUBoot rec {
defconfig = "Bananapi_defconfig";
targetPlatforms = ["armv7l-linux"];
extraMeta.platforms = ["armv7l-linux"];
filesToInstall = ["u-boot-sunxi-with-spl.bin"];
};

ubootBeagleboneBlack = buildUBoot rec {
defconfig = "am335x_boneblack_defconfig";
targetPlatforms = ["armv7l-linux"];
extraMeta.platforms = ["armv7l-linux"];
filesToInstall = ["MLO" "u-boot.img"];
};

# http://git.denx.de/?p=u-boot.git;a=blob;f=board/solidrun/clearfog/README;hb=refs/heads/master
ubootClearfog = buildUBoot rec {
defconfig = "clearfog_defconfig";
targetPlatforms = ["armv7l-linux"];
extraMeta.platforms = ["armv7l-linux"];
filesToInstall = ["u-boot-spl.kwb"];
};

ubootGuruplug = buildUBoot rec {
defconfig = "guruplug_defconfig";
extraMeta.platforms = ["armv5tel-linux"];
filesToInstall = ["u-boot.bin"];
};

ubootJetsonTK1 = buildUBoot rec {
defconfig = "jetson-tk1_defconfig";
targetPlatforms = ["armv7l-linux"];
extraMeta.platforms = ["armv7l-linux"];
filesToInstall = ["u-boot" "u-boot.dtb" "u-boot-dtb-tegra.bin" "u-boot-nodtb-tegra.bin"];
# tegra-uboot-flasher expects this exact directory layout, sigh...
postInstall = ''
mkdir -p $out/spl
cp spl/u-boot-spl $out/spl/
'';
};

ubootOdroidXU3 = buildUBoot rec {
defconfig = "odroid-xu3_defconfig";
targetPlatforms = ["armv7l-linux"];
extraMeta.platforms = ["armv7l-linux"];
filesToInstall = ["u-boot-dtb.bin"];
};

ubootOrangePiPc = buildUBoot rec {
defconfig = "orangepi_pc_defconfig";
targetPlatforms = ["armv7l-linux"];
extraMeta.platforms = ["armv7l-linux"];
filesToInstall = ["u-boot-sunxi-with-spl.bin"];
};

ubootPcduino3Nano = buildUBoot rec {
defconfig = "Linksprite_pcDuino3_Nano_defconfig";
targetPlatforms = ["armv7l-linux"];
extraMeta.platforms = ["armv7l-linux"];
filesToInstall = ["u-boot-sunxi-with-spl.bin"];
};

ubootPine64 = buildUBoot rec {
extraPatches = [sunxiPatch];
defconfig = "pine64_plus_defconfig";
extraMeta.platforms = ["aarch64-linux"];
BL31 = "${armTrustedFirmwareAllwinner}/bl31.bin";
filesToInstall = ["u-boot-sunxi-with-spl.bin"];
};

ubootQemuAarch64 = buildUBoot rec {
defconfig = "qemu_arm64_defconfig";
extraMeta.platforms = ["aarch64-linux"];
filesToInstall = ["u-boot.bin"];
};

ubootQemuArm = buildUBoot rec {
defconfig = "qemu_arm_defconfig";
targetPlatforms = ["armv7l-linux"];
extraMeta.platforms = ["armv7l-linux"];
filesToInstall = ["u-boot.bin"];
};

ubootRaspberryPi = buildUBoot rec {
defconfig = "rpi_defconfig";
targetPlatforms = ["armv6l-linux"];
extraMeta.platforms = ["armv6l-linux"];
filesToInstall = ["u-boot.bin"];
};

ubootRaspberryPi2 = buildUBoot rec {
defconfig = "rpi_2_defconfig";
targetPlatforms = ["armv7l-linux"];
extraMeta.platforms = ["armv7l-linux"];
filesToInstall = ["u-boot.bin"];
};

ubootRaspberryPi3_32bit = buildUBoot rec {
defconfig = "rpi_3_32b_defconfig";
targetPlatforms = ["armv7l-linux"];
extraMeta.platforms = ["armv7l-linux"];
filesToInstall = ["u-boot.bin"];
};

ubootRaspberryPi3_64bit = buildUBoot rec {
defconfig = "rpi_3_defconfig";
targetPlatforms = ["aarch64-linux"];
extraMeta.platforms = ["aarch64-linux"];
filesToInstall = ["u-boot.bin"];
};

ubootSheevaplug = buildUBoot rec {
defconfig = "sheevaplug_defconfig";
extraMeta.platforms = ["armv5tel-linux"];
filesToInstall = ["u-boot.bin"];
};

ubootSopine = buildUBoot rec {
extraPatches = [sunxiPatch];
defconfig = "sopine_baseboard_defconfig";
extraMeta.platforms = ["aarch64-linux"];
BL31 = "${armTrustedFirmwareAllwinner}/bl31.bin";
filesToInstall = ["u-boot-sunxi-with-spl.bin"];
};

ubootUtilite = buildUBoot rec {
defconfig = "cm_fx6_defconfig";
targetPlatforms = ["armv7l-linux"];
extraMeta.platforms = ["armv7l-linux"];
filesToInstall = ["u-boot-with-nand-spl.imx"];
buildFlags = "u-boot-with-nand-spl.imx";
postConfigure = ''
@@ -196,7 +248,7 @@ in rec {

ubootWandboard = buildUBoot rec {
defconfig = "wandboard_defconfig";
targetPlatforms = ["armv7l-linux"];
extraMeta.platforms = ["armv7l-linux"];
filesToInstall = ["u-boot.img" "SPL"];
};
}
18 changes: 0 additions & 18 deletions pkgs/misc/uboot/gas220.patch

This file was deleted.

48 changes: 0 additions & 48 deletions pkgs/misc/uboot/guruplug-file-systems.patch

This file was deleted.

106 changes: 0 additions & 106 deletions pkgs/misc/uboot/guruplug-usb-msd-multi-lun.patch

This file was deleted.

57 changes: 0 additions & 57 deletions pkgs/misc/uboot/guruplug.nix

This file was deleted.

37 changes: 37 additions & 0 deletions pkgs/misc/uboot/rock64.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{ lib, buildUBoot, fetchFromGitHub, armTrustedFirmwareRK3328 }: let
rkbin = fetchFromGitHub {
owner = "ayufan-rock64";
repo = "rkbin";
rev = "d8b90685b3d93c358936babdd854f1018bc6d35e";
sha256 = "0wrh3xa968sdp0j9n692jnv3071ymab719zc56vllba0aaabiaxr";
};
in buildUBoot rec {
name = "uboot-${defconfig}-${version}";
version = "2018.01";

src = fetchFromGitHub {
owner = "ayufan-rock64";
repo = "linux-u-boot";
rev = "19e31fac0dee3c4f6b2ea4371e4321f79db0f495";
sha256 = "1vmv7q9yafsc0zivd0qdfmf930dvhzkf4a3j6apxxgx9g10wgwrg";
};

extraMakeFlags = [ "BL31=${armTrustedFirmwareRK3328}/bl31.elf" "u-boot.itb" "all" ];

# So close to being blob free... But U-Boot TPL causes the kernel to hang
postBuild = ''
./tools/mkimage -n rk3328 -T rksd -d ${rkbin}/rk33/rk3328_ddr_786MHz_v1.06.bin idbloader.img
cat spl/u-boot-spl.bin >> idbloader.img
dd if=u-boot.itb of=idbloader.img seek=448 conv=notrunc
'';

defconfig = "rock64-rk3328_defconfig";
filesToInstall = [ "spl/u-boot-spl.bin" "tpl/u-boot-tpl.bin" "u-boot.itb" "idbloader.img"];

extraMeta = with lib; {
maintainers = [ maintainers.lopsided98 ];
platforms = ["aarch64-linux"];
# Because of the TPL blob
license = licenses.unfreeRedistributableFirmware;
};
}
61 changes: 0 additions & 61 deletions pkgs/misc/uboot/sheevaplug.nix

This file was deleted.

16 changes: 13 additions & 3 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
@@ -12885,6 +12885,13 @@ with pkgs;
alsaOss = callPackage ../os-specific/linux/alsa-oss { };
alsaTools = callPackage ../os-specific/linux/alsa-tools { };

inherit (callPackage ../misc/arm-trusted-firmware {})
buildArmTrustedFirmware
armTrustedFirmwareAllwinner
armTrustedFirmwareQemu
armTrustedFirmwareRK3328
;

microcodeAmd = callPackage ../os-specific/linux/microcode/amd.nix { };

microcodeIntel = callPackage ../os-specific/linux/microcode/intel.nix { };
@@ -13866,25 +13873,28 @@ with pkgs;
ubootBananaPi
ubootBeagleboneBlack
ubootClearfog
ubootGuruplug
ubootJetsonTK1
ubootOdroidXU3
ubootOrangePiPc
ubootPcduino3Nano
ubootPine64
ubootQemuAarch64
ubootQemuArm
ubootRaspberryPi
ubootRaspberryPi2
ubootRaspberryPi3_32bit
ubootRaspberryPi3_64bit
ubootSheevaplug
ubootSopine
ubootUtilite
ubootWandboard
;

# Non-upstream U-Boots:
ubootSheevaplug = callPackage ../misc/uboot/sheevaplug.nix { };

ubootNanonote = callPackage ../misc/uboot/nanonote.nix { };

ubootGuruplug = callPackage ../misc/uboot/guruplug.nix { };
ubootRock64 = callPackage ../misc/uboot/rock64.nix { };

uclibc = callPackage ../os-specific/linux/uclibc { };