2010-02-17 21:09:27 +00:00
|
|
|
{stdenv, fetchurl, unzip, platform}:
|
2009-11-08 00:32:12 +00:00
|
|
|
|
2010-03-01 15:21:24 +00: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 14:42:50 +00:00
|
|
|
assert (stdenv.system != "i686-linux" && stdenv.system != "x86_64-linux")
|
|
|
|
|| (stdenv ? cross);
|
|
|
|
|
2009-11-08 00:32:12 +00:00
|
|
|
stdenv.mkDerivation {
|
2010-02-17 20:53:01 +00:00
|
|
|
name = "uboot-2009.11";
|
2009-11-08 00:32:12 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2010-02-17 20:53:01 +00:00
|
|
|
url = "ftp://ftp.denx.de/pub/u-boot/u-boot-2009.11.tar.bz2";
|
|
|
|
sha256 = "1rld7q3ww89si84g80hqskd1z995lni5r5xc4d4322n99wqiarh6";
|
2009-11-08 00:32:12 +00:00
|
|
|
};
|
|
|
|
|
2010-02-17 20:53:01 +00:00
|
|
|
# patches = [ ./gas220.patch ];
|
2009-11-08 00:32:12 +00:00
|
|
|
|
|
|
|
# Remove the cross compiler prefix, and add reiserfs support
|
2010-03-01 15:21:24 +00: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 00:32:12 +00:00
|
|
|
|
2009-11-19 21:43:03 +00:00
|
|
|
buildNativeInputs = [ unzip ];
|
2009-11-08 00:32:12 +00:00
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
NIX_STRIP_DEBUG = false;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
ensureDir $out
|
2010-02-17 20:53:01 +00:00
|
|
|
cp u-boot.bin $out
|
2009-11-08 00:32:12 +00:00
|
|
|
cp u-boot u-boot.map $out
|
|
|
|
|
|
|
|
ensureDir $out/bin
|
|
|
|
cp tools/{envcrc,mkimage} $out/bin
|
|
|
|
'';
|
|
|
|
}
|