git.iko.soy/typeable/nixpkgs
on master help sign in
uboot: 2017.11 -> 2018.03, cross fixes

(cherry picked from commit 5804547243010ec8e341e98e8acbc5c96263682e) (cherry picked from commit 7c46833b047710f220971d7d7d3b1dbe6fed805b)

commitd29202bc48be6069e3d7ddc7b7760aac8c0c19b7 authorBen Wolsieffer <benwolsieffer@gmail.com> dateFri 23 Feb 2018, 17:50 (9 years ago) parentf2004e6
1 file changed+38−39
pkgs/misc/uboot/default.nix+38−39
pkgs/misc/uboot/default.nix+38−39
@@ -1,10 +1,9 @@
1−{ stdenv, fetchurl, fetchpatch, bc, dtc, openssl, python2
2−, hostPlatform
1+{ stdenv, fetchurl, fetchpatch, bc, dtc, openssl, python2, swig
2+, hostPlatform, buildPackages
33}:
44
55let
6− buildUBoot = { targetPlatforms
7− , filesToInstall
6+ buildUBoot = { filesToInstall
87 , installDir ? "$out"
98 , defconfig
109 , extraMakeFlags ? []
@@ -13,18 +12,14 @@ let
1312 stdenv.mkDerivation (rec {
1413
1514 name = "uboot-${defconfig}-${version}";
16− version = "2017.11";
15+ version = "2018.03";
1716
1817 src = fetchurl {
1918 url = "ftp://ftp.denx.de/pub/u-boot/u-boot-${version}.tar.bz2";
20− sha256 = "01bcsah5imy6m3fbjwhqywxg0pfk5fl8ks9ylb7kv3zmrb9qy0ba";
19+ sha256 = "1z9x635l5164c5hnf7qs19w7j3qghbkgs7rpn673dm898i9pfx3y";
2120 };
2221
2322 patches = [
24− (fetchpatch {
25− url = https://github.com/dezgeg/u-boot/commit/cbsize-2017-11.patch;
26− sha256 = "08rqsrj78aif8vaxlpwiwwv1jwf0diihbj0h88hc0mlp0kmyqxwm";
27− })
2823 (fetchpatch {
2924 url = https://github.com/dezgeg/u-boot/commit/rpi-2017-11-patch1.patch;
3025 sha256 = "067yq55vv1slv4xy346px7h329pi14abdn04chg6s1s6hmf6c1x9";
@@ -34,8 +29,8 @@ let
3429 sha256 = "0bbw0q027xvzvdxxvpzjajg4rm30a8mb7z74b6ma9q0l7y7bi0c4";
3530 })
3631 (fetchpatch {
37− url = https://github.com/dezgeg/u-boot/commit/pythonpath-2017-11.patch;
38− sha256 = "162b2lglp307pzxsf9m7nnmzwxqd7xkwp5j85bm6bg1a38ngpl9v";
32+ url = https://github.com/dezgeg/u-boot/commit/pythonpath-2018-03.patch;
33+ sha256 = "1rhhlhrwhv7ic1n5i720jfh2cxwrkssrkvinllyjy3j9k9bpzcqd";
3934 })
4035 ];
4136
@@ -43,14 +38,22 @@ let
4338 patchShebangs tools
4439 '';
4540
46− nativeBuildInputs = [ bc dtc openssl python2 ];
41+ nativeBuildInputs = [ bc dtc openssl python2 swig ];
42+ depsBuildBuild = [ buildPackages.stdenv.cc ];
4743
4844 hardeningDisable = [ "all" ];
4945
50− makeFlags = [ "DTC=dtc" ] ++ extraMakeFlags;
46+ makeFlags = [
47+ "DTC=dtc"
48+ "CROSS_COMPILE=${stdenv.cc.targetPrefix}"
49+ ] ++ extraMakeFlags;
5150
5251 configurePhase = ''
52+ runHook preConfigure
53+
5354 make ${defconfig}
55+
56+ runHook postConfigure
5457 '';
5558
5659 installPhase = ''
@@ -65,21 +68,13 @@ let
6568 enableParallelBuilding = true;
6669 dontStrip = true;
6770
68− crossAttrs = {
69− makeFlags = [
70− "ARCH=${hostPlatform.platform.kernelArch}"
71− "CROSS_COMPILE=${stdenv.cc.targetPrefix}"
72− ];
73− };
74−
7571 meta = with stdenv.lib; {
7672 homepage = http://www.denx.de/wiki/U-Boot/;
7773 description = "Boot loader for embedded systems";
7874 license = licenses.gpl2;
7975 maintainers = [ maintainers.dezgeg ];
80− platforms = targetPlatforms;
8176 } // extraMeta;
82− } // args);
77+ } // removeAttrs args [ "extraMeta" ]);
8378
8479in rec {
8580 inherit buildUBoot;
@@ -88,10 +83,14 @@ in rec {
8883 defconfig = "allnoconfig";
8984 installDir = "$out/bin";
9085 buildFlags = "tools NO_SDL=1";
86+ hardeningDisable = [];
9187 dontStrip = false;
92− targetPlatforms = stdenv.lib.platforms.linux;
88+ extraMeta.platforms = stdenv.lib.platforms.linux;
9389 # build tools/kwboot
9490 extraMakeFlags = [ "CONFIG_KIRKWOOD=y" ];
91+ postConfigure = ''
92+ sed -i '/CONFIG_SYS_TEXT_BASE/c\CONFIG_SYS_TEXT_BASE=0x00000000' .config
93+ '';
9594 filesToInstall = [
9695 "tools/dumpimage"
9796 "tools/fdtgrep"
@@ -103,86 +102,86 @@ in rec {
103102
104103 ubootA20OlinuxinoLime = buildUBoot rec {
105104 defconfig = "A20-OLinuXino-Lime_defconfig";
106− targetPlatforms = ["armv7l-linux"];
105+ extraMeta.platforms = ["armv7l-linux"];
107106 filesToInstall = ["u-boot-sunxi-with-spl.bin"];
108107 };
109108
110109 ubootBananaPi = buildUBoot rec {
111110 defconfig = "Bananapi_defconfig";
112− targetPlatforms = ["armv7l-linux"];
111+ extraMeta.platforms = ["armv7l-linux"];
113112 filesToInstall = ["u-boot-sunxi-with-spl.bin"];
114113 };
115114
116115 ubootBeagleboneBlack = buildUBoot rec {
117116 defconfig = "am335x_boneblack_defconfig";
118− targetPlatforms = ["armv7l-linux"];
117+ extraMeta.platforms = ["armv7l-linux"];
119118 filesToInstall = ["MLO" "u-boot.img"];
120119 };
121120
122121 # http://git.denx.de/?p=u-boot.git;a=blob;f=board/solidrun/clearfog/README;hb=refs/heads/master
123122 ubootClearfog = buildUBoot rec {
124123 defconfig = "clearfog_defconfig";
125− targetPlatforms = ["armv7l-linux"];
124+ extraMeta.platforms = ["armv7l-linux"];
126125 filesToInstall = ["u-boot-spl.kwb"];
127126 };
128127
129128 ubootJetsonTK1 = buildUBoot rec {
130129 defconfig = "jetson-tk1_defconfig";
131− targetPlatforms = ["armv7l-linux"];
130+ extraMeta.platforms = ["armv7l-linux"];
132131 filesToInstall = ["u-boot" "u-boot.dtb" "u-boot-dtb-tegra.bin" "u-boot-nodtb-tegra.bin"];
133132 };
134133
135134 ubootOdroidXU3 = buildUBoot rec {
136135 defconfig = "odroid-xu3_defconfig";
137− targetPlatforms = ["armv7l-linux"];
136+ extraMeta.platforms = ["armv7l-linux"];
138137 filesToInstall = ["u-boot-dtb.bin"];
139138 };
140139
141140 ubootOrangePiPc = buildUBoot rec {
142141 defconfig = "orangepi_pc_defconfig";
143− targetPlatforms = ["armv7l-linux"];
142+ extraMeta.platforms = ["armv7l-linux"];
144143 filesToInstall = ["u-boot-sunxi-with-spl.bin"];
145144 };
146145
147146 ubootPcduino3Nano = buildUBoot rec {
148147 defconfig = "Linksprite_pcDuino3_Nano_defconfig";
149− targetPlatforms = ["armv7l-linux"];
148+ extraMeta.platforms = ["armv7l-linux"];
150149 filesToInstall = ["u-boot-sunxi-with-spl.bin"];
151150 };
152151
153152 ubootQemuArm = buildUBoot rec {
154153 defconfig = "qemu_arm_defconfig";
155− targetPlatforms = ["armv7l-linux"];
154+ extraMeta.platforms = ["armv7l-linux"];
156155 filesToInstall = ["u-boot.bin"];
157156 };
158157
159158 ubootRaspberryPi = buildUBoot rec {
160159 defconfig = "rpi_defconfig";
161− targetPlatforms = ["armv6l-linux"];
160+ extraMeta.platforms = ["armv6l-linux"];
162161 filesToInstall = ["u-boot.bin"];
163162 };
164163
165164 ubootRaspberryPi2 = buildUBoot rec {
166165 defconfig = "rpi_2_defconfig";
167− targetPlatforms = ["armv7l-linux"];
166+ extraMeta.platforms = ["armv7l-linux"];
168167 filesToInstall = ["u-boot.bin"];
169168 };
170169
171170 ubootRaspberryPi3_32bit = buildUBoot rec {
172171 defconfig = "rpi_3_32b_defconfig";
173− targetPlatforms = ["armv7l-linux"];
172+ extraMeta.platforms = ["armv7l-linux"];
174173 filesToInstall = ["u-boot.bin"];
175174 };
176175
177176 ubootRaspberryPi3_64bit = buildUBoot rec {
178177 defconfig = "rpi_3_defconfig";
179− targetPlatforms = ["aarch64-linux"];
178+ extraMeta.platforms = ["aarch64-linux"];
180179 filesToInstall = ["u-boot.bin"];
181180 };
182181
183182 ubootUtilite = buildUBoot rec {
184183 defconfig = "cm_fx6_defconfig";
185− targetPlatforms = ["armv7l-linux"];
184+ extraMeta.platforms = ["armv7l-linux"];
186185 filesToInstall = ["u-boot-with-nand-spl.imx"];
187186 buildFlags = "u-boot-with-nand-spl.imx";
188187 postConfigure = ''
@@ -196,7 +195,7 @@ in rec {
196195
197196 ubootWandboard = buildUBoot rec {
198197 defconfig = "wandboard_defconfig";
199− targetPlatforms = ["armv7l-linux"];
198+ extraMeta.platforms = ["armv7l-linux"];
200199 filesToInstall = ["u-boot.img" "SPL"];
201200 };
202201}