2010-03-02 00:22:48 +01:00
|
|
|
{stdenv, fetchurl, unzip}:
|
2009-11-08 01:32:12 +01:00
|
|
|
|
2010-03-02 00:22:48 +01:00
|
|
|
let
|
|
|
|
platform = stdenv.platform;
|
|
|
|
configureFun = ubootConfig :
|
2010-03-01 16:21:24 +01:00
|
|
|
''
|
|
|
|
make mrproper
|
2010-03-02 00:22:48 +01:00
|
|
|
make ${ubootConfig} NBOOT=1 LE=1
|
2010-03-01 16:21:24 +01:00
|
|
|
'';
|
|
|
|
|
2010-03-02 00:22:48 +01:00
|
|
|
buildFun = kernelArch :
|
2010-03-01 16:21:24 +01:00
|
|
|
''
|
|
|
|
unset src
|
|
|
|
if test -z "$crossConfig"; then
|
|
|
|
make clean all
|
|
|
|
else
|
2010-03-02 00:22:48 +01:00
|
|
|
make clean all ARCH=${kernelArch} CROSS_COMPILE=$crossConfig-
|
2010-03-01 16:21:24 +01:00
|
|
|
fi
|
|
|
|
'';
|
2010-03-02 00:22:48 +01:00
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "uboot-2009.11";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "ftp://ftp.denx.de/pub/u-boot/u-boot-2009.11.tar.bz2";
|
|
|
|
sha256 = "1rld7q3ww89si84g80hqskd1z995lni5r5xc4d4322n99wqiarh6";
|
|
|
|
};
|
2009-11-08 01:32:12 +01:00
|
|
|
|
2009-11-19 22:43:03 +01:00
|
|
|
buildNativeInputs = [ unzip ];
|
2009-11-08 01:32:12 +01:00
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p $out
|
2010-02-17 21:53:01 +01:00
|
|
|
cp u-boot.bin $out
|
2009-11-08 01:32:12 +01:00
|
|
|
cp u-boot u-boot.map $out
|
|
|
|
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p $out/bin
|
2009-11-08 01:32:12 +01:00
|
|
|
cp tools/{envcrc,mkimage} $out/bin
|
|
|
|
'';
|
2010-03-02 00:22:48 +01:00
|
|
|
|
|
|
|
configurePhase =
|
|
|
|
assert platform ? uboot && platform.uboot != null;
|
|
|
|
assert (platform ? ubootConfig);
|
|
|
|
configureFun platform.ubootConfig;
|
|
|
|
|
|
|
|
buildPhase = assert (platform ? kernelArch);
|
|
|
|
buildFun platform.kernelArch;
|
|
|
|
|
|
|
|
crossAttrs = let
|
|
|
|
cp = stdenv.cross.platform;
|
|
|
|
in
|
|
|
|
assert cp ? uboot && cp.uboot != null;
|
|
|
|
{
|
|
|
|
configurePhase = assert (cp ? ubootConfig);
|
|
|
|
configureFun cp.ubootConfig;
|
|
|
|
|
|
|
|
buildPhase = assert (cp ? kernelArch);
|
|
|
|
buildFun cp.kernelArch;
|
|
|
|
};
|
2009-11-08 01:32:12 +01:00
|
|
|
}
|