uboot: 2017.11 -> 2018.03, cross fixes

authored by Ben Wolsieffer and committed by Tuomas Tynkkynen 58045472 45241c5c

+38 -39
+38 -39
pkgs/misc/uboot/default.nix
··· 1 - { stdenv, fetchurl, fetchpatch, bc, dtc, openssl, python2 2 - , hostPlatform 3 }: 4 5 let 6 - buildUBoot = { targetPlatforms 7 - , filesToInstall 8 , installDir ? "$out" 9 , defconfig 10 , extraMakeFlags ? [] ··· 13 stdenv.mkDerivation (rec { 14 15 name = "uboot-${defconfig}-${version}"; 16 - version = "2017.11"; 17 18 src = fetchurl { 19 url = "ftp://ftp.denx.de/pub/u-boot/u-boot-${version}.tar.bz2"; 20 - sha256 = "01bcsah5imy6m3fbjwhqywxg0pfk5fl8ks9ylb7kv3zmrb9qy0ba"; 21 }; 22 23 patches = [ 24 - (fetchpatch { 25 - url = https://github.com/dezgeg/u-boot/commit/cbsize-2017-11.patch; 26 - sha256 = "08rqsrj78aif8vaxlpwiwwv1jwf0diihbj0h88hc0mlp0kmyqxwm"; 27 - }) 28 (fetchpatch { 29 url = https://github.com/dezgeg/u-boot/commit/rpi-2017-11-patch1.patch; 30 sha256 = "067yq55vv1slv4xy346px7h329pi14abdn04chg6s1s6hmf6c1x9"; ··· 34 sha256 = "0bbw0q027xvzvdxxvpzjajg4rm30a8mb7z74b6ma9q0l7y7bi0c4"; 35 }) 36 (fetchpatch { 37 - url = https://github.com/dezgeg/u-boot/commit/pythonpath-2017-11.patch; 38 - sha256 = "162b2lglp307pzxsf9m7nnmzwxqd7xkwp5j85bm6bg1a38ngpl9v"; 39 }) 40 ]; 41 ··· 43 patchShebangs tools 44 ''; 45 46 - nativeBuildInputs = [ bc dtc openssl python2 ]; 47 48 hardeningDisable = [ "all" ]; 49 50 - makeFlags = [ "DTC=dtc" ] ++ extraMakeFlags; 51 52 configurePhase = '' 53 make ${defconfig} 54 ''; 55 56 installPhase = '' ··· 65 enableParallelBuilding = true; 66 dontStrip = true; 67 68 - crossAttrs = { 69 - makeFlags = [ 70 - "ARCH=${hostPlatform.platform.kernelArch}" 71 - "CROSS_COMPILE=${stdenv.cc.targetPrefix}" 72 - ]; 73 - }; 74 - 75 meta = with stdenv.lib; { 76 homepage = http://www.denx.de/wiki/U-Boot/; 77 description = "Boot loader for embedded systems"; 78 license = licenses.gpl2; 79 maintainers = [ maintainers.dezgeg ]; 80 - platforms = targetPlatforms; 81 } // extraMeta; 82 - } // args); 83 84 in rec { 85 inherit buildUBoot; ··· 88 defconfig = "allnoconfig"; 89 installDir = "$out/bin"; 90 buildFlags = "tools NO_SDL=1"; 91 dontStrip = false; 92 - targetPlatforms = stdenv.lib.platforms.linux; 93 # build tools/kwboot 94 extraMakeFlags = [ "CONFIG_KIRKWOOD=y" ]; 95 filesToInstall = [ 96 "tools/dumpimage" 97 "tools/fdtgrep" ··· 103 104 ubootA20OlinuxinoLime = buildUBoot rec { 105 defconfig = "A20-OLinuXino-Lime_defconfig"; 106 - targetPlatforms = ["armv7l-linux"]; 107 filesToInstall = ["u-boot-sunxi-with-spl.bin"]; 108 }; 109 110 ubootBananaPi = buildUBoot rec { 111 defconfig = "Bananapi_defconfig"; 112 - targetPlatforms = ["armv7l-linux"]; 113 filesToInstall = ["u-boot-sunxi-with-spl.bin"]; 114 }; 115 116 ubootBeagleboneBlack = buildUBoot rec { 117 defconfig = "am335x_boneblack_defconfig"; 118 - targetPlatforms = ["armv7l-linux"]; 119 filesToInstall = ["MLO" "u-boot.img"]; 120 }; 121 122 # http://git.denx.de/?p=u-boot.git;a=blob;f=board/solidrun/clearfog/README;hb=refs/heads/master 123 ubootClearfog = buildUBoot rec { 124 defconfig = "clearfog_defconfig"; 125 - targetPlatforms = ["armv7l-linux"]; 126 filesToInstall = ["u-boot-spl.kwb"]; 127 }; 128 129 ubootJetsonTK1 = buildUBoot rec { 130 defconfig = "jetson-tk1_defconfig"; 131 - targetPlatforms = ["armv7l-linux"]; 132 filesToInstall = ["u-boot" "u-boot.dtb" "u-boot-dtb-tegra.bin" "u-boot-nodtb-tegra.bin"]; 133 }; 134 135 ubootOdroidXU3 = buildUBoot rec { 136 defconfig = "odroid-xu3_defconfig"; 137 - targetPlatforms = ["armv7l-linux"]; 138 filesToInstall = ["u-boot-dtb.bin"]; 139 }; 140 141 ubootOrangePiPc = buildUBoot rec { 142 defconfig = "orangepi_pc_defconfig"; 143 - targetPlatforms = ["armv7l-linux"]; 144 filesToInstall = ["u-boot-sunxi-with-spl.bin"]; 145 }; 146 147 ubootPcduino3Nano = buildUBoot rec { 148 defconfig = "Linksprite_pcDuino3_Nano_defconfig"; 149 - targetPlatforms = ["armv7l-linux"]; 150 filesToInstall = ["u-boot-sunxi-with-spl.bin"]; 151 }; 152 153 ubootQemuArm = buildUBoot rec { 154 defconfig = "qemu_arm_defconfig"; 155 - targetPlatforms = ["armv7l-linux"]; 156 filesToInstall = ["u-boot.bin"]; 157 }; 158 159 ubootRaspberryPi = buildUBoot rec { 160 defconfig = "rpi_defconfig"; 161 - targetPlatforms = ["armv6l-linux"]; 162 filesToInstall = ["u-boot.bin"]; 163 }; 164 165 ubootRaspberryPi2 = buildUBoot rec { 166 defconfig = "rpi_2_defconfig"; 167 - targetPlatforms = ["armv7l-linux"]; 168 filesToInstall = ["u-boot.bin"]; 169 }; 170 171 ubootRaspberryPi3_32bit = buildUBoot rec { 172 defconfig = "rpi_3_32b_defconfig"; 173 - targetPlatforms = ["armv7l-linux"]; 174 filesToInstall = ["u-boot.bin"]; 175 }; 176 177 ubootRaspberryPi3_64bit = buildUBoot rec { 178 defconfig = "rpi_3_defconfig"; 179 - targetPlatforms = ["aarch64-linux"]; 180 filesToInstall = ["u-boot.bin"]; 181 }; 182 183 ubootUtilite = buildUBoot rec { 184 defconfig = "cm_fx6_defconfig"; 185 - targetPlatforms = ["armv7l-linux"]; 186 filesToInstall = ["u-boot-with-nand-spl.imx"]; 187 buildFlags = "u-boot-with-nand-spl.imx"; 188 postConfigure = '' ··· 196 197 ubootWandboard = buildUBoot rec { 198 defconfig = "wandboard_defconfig"; 199 - targetPlatforms = ["armv7l-linux"]; 200 filesToInstall = ["u-boot.img" "SPL"]; 201 }; 202 }
··· 1 + { stdenv, fetchurl, fetchpatch, bc, dtc, openssl, python2, swig 2 + , hostPlatform, buildPackages 3 }: 4 5 let 6 + buildUBoot = { filesToInstall 7 , installDir ? "$out" 8 , defconfig 9 , extraMakeFlags ? [] ··· 12 stdenv.mkDerivation (rec { 13 14 name = "uboot-${defconfig}-${version}"; 15 + version = "2018.03"; 16 17 src = fetchurl { 18 url = "ftp://ftp.denx.de/pub/u-boot/u-boot-${version}.tar.bz2"; 19 + sha256 = "1z9x635l5164c5hnf7qs19w7j3qghbkgs7rpn673dm898i9pfx3y"; 20 }; 21 22 patches = [ 23 (fetchpatch { 24 url = https://github.com/dezgeg/u-boot/commit/rpi-2017-11-patch1.patch; 25 sha256 = "067yq55vv1slv4xy346px7h329pi14abdn04chg6s1s6hmf6c1x9"; ··· 29 sha256 = "0bbw0q027xvzvdxxvpzjajg4rm30a8mb7z74b6ma9q0l7y7bi0c4"; 30 }) 31 (fetchpatch { 32 + url = https://github.com/dezgeg/u-boot/commit/pythonpath-2018-03.patch; 33 + sha256 = "1rhhlhrwhv7ic1n5i720jfh2cxwrkssrkvinllyjy3j9k9bpzcqd"; 34 }) 35 ]; 36 ··· 38 patchShebangs tools 39 ''; 40 41 + nativeBuildInputs = [ bc dtc openssl python2 swig ]; 42 + depsBuildBuild = [ buildPackages.stdenv.cc ]; 43 44 hardeningDisable = [ "all" ]; 45 46 + makeFlags = [ 47 + "DTC=dtc" 48 + "CROSS_COMPILE=${stdenv.cc.targetPrefix}" 49 + ] ++ extraMakeFlags; 50 51 configurePhase = '' 52 + runHook preConfigure 53 + 54 make ${defconfig} 55 + 56 + runHook postConfigure 57 ''; 58 59 installPhase = '' ··· 68 enableParallelBuilding = true; 69 dontStrip = true; 70 71 meta = with stdenv.lib; { 72 homepage = http://www.denx.de/wiki/U-Boot/; 73 description = "Boot loader for embedded systems"; 74 license = licenses.gpl2; 75 maintainers = [ maintainers.dezgeg ]; 76 } // extraMeta; 77 + } // removeAttrs args [ "extraMeta" ]); 78 79 in rec { 80 inherit buildUBoot; ··· 83 defconfig = "allnoconfig"; 84 installDir = "$out/bin"; 85 buildFlags = "tools NO_SDL=1"; 86 + hardeningDisable = []; 87 dontStrip = false; 88 + extraMeta.platforms = stdenv.lib.platforms.linux; 89 # build tools/kwboot 90 extraMakeFlags = [ "CONFIG_KIRKWOOD=y" ]; 91 + postConfigure = '' 92 + sed -i '/CONFIG_SYS_TEXT_BASE/c\CONFIG_SYS_TEXT_BASE=0x00000000' .config 93 + ''; 94 filesToInstall = [ 95 "tools/dumpimage" 96 "tools/fdtgrep" ··· 102 103 ubootA20OlinuxinoLime = buildUBoot rec { 104 defconfig = "A20-OLinuXino-Lime_defconfig"; 105 + extraMeta.platforms = ["armv7l-linux"]; 106 filesToInstall = ["u-boot-sunxi-with-spl.bin"]; 107 }; 108 109 ubootBananaPi = buildUBoot rec { 110 defconfig = "Bananapi_defconfig"; 111 + extraMeta.platforms = ["armv7l-linux"]; 112 filesToInstall = ["u-boot-sunxi-with-spl.bin"]; 113 }; 114 115 ubootBeagleboneBlack = buildUBoot rec { 116 defconfig = "am335x_boneblack_defconfig"; 117 + extraMeta.platforms = ["armv7l-linux"]; 118 filesToInstall = ["MLO" "u-boot.img"]; 119 }; 120 121 # http://git.denx.de/?p=u-boot.git;a=blob;f=board/solidrun/clearfog/README;hb=refs/heads/master 122 ubootClearfog = buildUBoot rec { 123 defconfig = "clearfog_defconfig"; 124 + extraMeta.platforms = ["armv7l-linux"]; 125 filesToInstall = ["u-boot-spl.kwb"]; 126 }; 127 128 ubootJetsonTK1 = buildUBoot rec { 129 defconfig = "jetson-tk1_defconfig"; 130 + extraMeta.platforms = ["armv7l-linux"]; 131 filesToInstall = ["u-boot" "u-boot.dtb" "u-boot-dtb-tegra.bin" "u-boot-nodtb-tegra.bin"]; 132 }; 133 134 ubootOdroidXU3 = buildUBoot rec { 135 defconfig = "odroid-xu3_defconfig"; 136 + extraMeta.platforms = ["armv7l-linux"]; 137 filesToInstall = ["u-boot-dtb.bin"]; 138 }; 139 140 ubootOrangePiPc = buildUBoot rec { 141 defconfig = "orangepi_pc_defconfig"; 142 + extraMeta.platforms = ["armv7l-linux"]; 143 filesToInstall = ["u-boot-sunxi-with-spl.bin"]; 144 }; 145 146 ubootPcduino3Nano = buildUBoot rec { 147 defconfig = "Linksprite_pcDuino3_Nano_defconfig"; 148 + extraMeta.platforms = ["armv7l-linux"]; 149 filesToInstall = ["u-boot-sunxi-with-spl.bin"]; 150 }; 151 152 ubootQemuArm = buildUBoot rec { 153 defconfig = "qemu_arm_defconfig"; 154 + extraMeta.platforms = ["armv7l-linux"]; 155 filesToInstall = ["u-boot.bin"]; 156 }; 157 158 ubootRaspberryPi = buildUBoot rec { 159 defconfig = "rpi_defconfig"; 160 + extraMeta.platforms = ["armv6l-linux"]; 161 filesToInstall = ["u-boot.bin"]; 162 }; 163 164 ubootRaspberryPi2 = buildUBoot rec { 165 defconfig = "rpi_2_defconfig"; 166 + extraMeta.platforms = ["armv7l-linux"]; 167 filesToInstall = ["u-boot.bin"]; 168 }; 169 170 ubootRaspberryPi3_32bit = buildUBoot rec { 171 defconfig = "rpi_3_32b_defconfig"; 172 + extraMeta.platforms = ["armv7l-linux"]; 173 filesToInstall = ["u-boot.bin"]; 174 }; 175 176 ubootRaspberryPi3_64bit = buildUBoot rec { 177 defconfig = "rpi_3_defconfig"; 178 + extraMeta.platforms = ["aarch64-linux"]; 179 filesToInstall = ["u-boot.bin"]; 180 }; 181 182 ubootUtilite = buildUBoot rec { 183 defconfig = "cm_fx6_defconfig"; 184 + extraMeta.platforms = ["armv7l-linux"]; 185 filesToInstall = ["u-boot-with-nand-spl.imx"]; 186 buildFlags = "u-boot-with-nand-spl.imx"; 187 postConfigure = '' ··· 195 196 ubootWandboard = buildUBoot rec { 197 defconfig = "wandboard_defconfig"; 198 + extraMeta.platforms = ["armv7l-linux"]; 199 filesToInstall = ["u-boot.img" "SPL"]; 200 }; 201 }