2010-02-17 22:09:27 +01:00
|
|
|
{stdenv, fetchurl, unzip, platform}:
|
2009-11-08 01:32:12 +01:00
|
|
|
|
2010-03-01 16:21:24 +01:00
|
|
|
# This does not cover the case for cross-building, but we need some filtering
|
|
|
|
# for the normal stdenv, in order to build the nixpkgs tarball
|
2010-02-19 15:42:50 +01:00
|
|
|
assert (stdenv.system != "i686-linux" && stdenv.system != "x86_64-linux")
|
|
|
|
|| (stdenv ? cross);
|
|
|
|
|
2009-11-08 01:32:12 +01:00
|
|
|
stdenv.mkDerivation {
|
2010-02-17 21:53:01 +01:00
|
|
|
name = "uboot-2009.11";
|
2009-11-08 01:32:12 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2010-02-17 21:53:01 +01:00
|
|
|
url = "ftp://ftp.denx.de/pub/u-boot/u-boot-2009.11.tar.bz2";
|
|
|
|
sha256 = "1rld7q3ww89si84g80hqskd1z995lni5r5xc4d4322n99wqiarh6";
|
2009-11-08 01:32:12 +01:00
|
|
|
};
|
|
|
|
|
2010-02-17 21:53:01 +01:00
|
|
|
# patches = [ ./gas220.patch ];
|
2009-11-08 01:32:12 +01:00
|
|
|
|
|
|
|
# Remove the cross compiler prefix, and add reiserfs support
|
2010-03-01 16:21:24 +01:00
|
|
|
configurePhase = assert (platform ? ubootConfig);
|
|
|
|
''
|
|
|
|
make mrproper
|
|
|
|
make ${platform.ubootConfig} NBOOT=1 LE=1
|
|
|
|
sed -i /CROSS_COMPILE/d include/config.mk
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = assert (platform ? kernelArch);
|
|
|
|
''
|
|
|
|
unset src
|
|
|
|
if test -z "$crossConfig"; then
|
|
|
|
make clean all
|
|
|
|
else
|
|
|
|
make clean all ARCH=${platform.kernelArch} CROSS_COMPILE=$crossConfig-
|
|
|
|
fi
|
|
|
|
'';
|
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;
|
|
|
|
NIX_STRIP_DEBUG = false;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
ensureDir $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
|
|
|
|
|
|
|
|
ensureDir $out/bin
|
|
|
|
cp tools/{envcrc,mkimage} $out/bin
|
|
|
|
'';
|
|
|
|
}
|