summary refs log tree commit diff
path: root/pkgs/misc/uboot/guruplug.nix
blob: 258ba999bf887eaa7357ae7a64d898e38ac4f799 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{stdenv, fetchgit, unzip}:

# Marvell's branch of U-Boot for the GuruPlug.

let
  # Aug 2010 revision of the `testing' branch of Marvell's U-Boot repository.
  # See
  # <http://www.openplug.org/plugwiki/index.php/Re-building_the_kernel_and_U-Boot>
  # for details.
  rev = "f106056095049c2c748c2a2797e5353295240e04";
in
stdenv.mkDerivation {
  name = "uboot-guruplug-0.0-pre-${stdenv.lib.strings.substring 0 7 rev}";

  src = fetchgit {
    url = "git://git.denx.de/u-boot-marvell.git";
    sha256 = "18gwyj16vml7aja9cyan51jwfcysy4cs062z7wmgdc0l9bha6iw7";
    inherit rev;
  };

  patches =
    [ ./guruplug-file-systems.patch ./guruplug-usb-msd-multi-lun.patch ];

  enableParallelBuilding = true;

  # Remove the cross compiler prefix.
  configurePhase = ''
    make mrproper
    make guruplug_config
    sed -i /CROSS_COMPILE/d include/config.mk
  '';

  buildPhase = ''
    unset src
    if test -z "$crossConfig"; then
        make all u-boot.kwb
    else
        make all u-boot.kwb ARCH=arm CROSS_COMPILE=$crossConfig-
    fi
  '';

  nativeBuildInputs = [ unzip ];

  dontStrip = true;

  installPhase = ''
    mkdir -p $out
    cp -v u-boot u-boot.{kwb,map} $out

    mkdir -p $out/bin
    cp tools/{envcrc,mkimage} $out/bin
  '';
}