2010-02-17 22:09:27 +01:00
|
|
|
{stdenv, fetchurl, unzip, platform}:
|
2009-11-08 01:32:12 +01:00
|
|
|
|
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
|
|
|
|
configurePhase = ''
|
|
|
|
make mrproper
|
2010-02-17 22:09:27 +01:00
|
|
|
make ${platform.ubootConfig} NBOOT=1 LE=1
|
2009-11-08 01:32:12 +01:00
|
|
|
sed -i /CROSS_COMPILE/d include/config.mk
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
unset src
|
2009-11-19 22:43:03 +01:00
|
|
|
if test -z "$crossConfig"; then
|
2009-11-15 23:56:06 +01:00
|
|
|
make clean all
|
|
|
|
else
|
2010-02-17 22:09:27 +01:00
|
|
|
make clean all ARCH=${platform.kernelArch} CROSS_COMPILE=$crossConfig-
|
2009-11-15 23:56:06 +01:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
}
|