Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "Universal Boot Loader for embedded devices" |
| 2 | HOMEPAGE = "http://www.denx.de/wiki/U-Boot/WebHome" |
| 3 | SECTION = "bootloaders" |
| 4 | PROVIDES = "virtual/bootloader" |
| 5 | |
| 6 | LICENSE = "GPLv2+" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 7 | LIC_FILES_CHKSUM = "file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 8 | |
| 9 | SRC_URI = "git://git.denx.de/u-boot.git;branch=master" |
| 10 | |
| 11 | S = "${WORKDIR}/git" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 12 | B = "${WORKDIR}/build" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 13 | |
| 14 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
| 15 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 16 | inherit uboot-config uboot-extlinux-config uboot-sign deploy |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 17 | |
| 18 | EXTRA_OEMAKE = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}" V=1' |
| 19 | EXTRA_OEMAKE += 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"' |
| 20 | |
| 21 | PACKAGECONFIG ??= "openssl" |
| 22 | # u-boot will compile its own tools during the build, with specific |
| 23 | # configurations (aka when CONFIG_FIT_SIGNATURE is enabled) openssl is needed as |
| 24 | # a host build dependency. |
| 25 | PACKAGECONFIG[openssl] = ",,openssl-native" |
| 26 | |
| 27 | # Allow setting an additional version string that will be picked up by the |
| 28 | # u-boot build system and appended to the u-boot version. If the .scmversion |
| 29 | # file already exists it will not be overwritten. |
| 30 | UBOOT_LOCALVERSION ?= "" |
| 31 | |
| 32 | # Some versions of u-boot use .bin and others use .img. By default use .bin |
| 33 | # but enable individual recipes to change this value. |
| 34 | UBOOT_SUFFIX ??= "bin" |
| 35 | UBOOT_IMAGE ?= "u-boot-${MACHINE}-${PV}-${PR}.${UBOOT_SUFFIX}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 36 | UBOOT_SYMLINK ?= "u-boot-${MACHINE}.${UBOOT_SUFFIX}" |
| 37 | UBOOT_MAKE_TARGET ?= "all" |
| 38 | |
| 39 | # Output the ELF generated. Some platforms can use the ELF file and directly |
| 40 | # load it (JTAG booting, QEMU) additionally the ELF can be used for debugging |
| 41 | # purposes. |
| 42 | UBOOT_ELF ?= "" |
| 43 | UBOOT_ELF_SUFFIX ?= "elf" |
| 44 | UBOOT_ELF_IMAGE ?= "u-boot-${MACHINE}-${PV}-${PR}.${UBOOT_ELF_SUFFIX}" |
| 45 | UBOOT_ELF_BINARY ?= "u-boot.${UBOOT_ELF_SUFFIX}" |
| 46 | UBOOT_ELF_SYMLINK ?= "u-boot-${MACHINE}.${UBOOT_ELF_SUFFIX}" |
| 47 | |
| 48 | # Some versions of u-boot build an SPL (Second Program Loader) image that |
| 49 | # should be packaged along with the u-boot binary as well as placed in the |
| 50 | # deploy directory. For those versions they can set the following variables |
| 51 | # to allow packaging the SPL. |
| 52 | SPL_BINARY ?= "" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 53 | SPL_BINARYNAME ?= "${@os.path.basename(d.getVar("SPL_BINARY", True))}" |
| 54 | SPL_IMAGE ?= "${SPL_BINARYNAME}-${MACHINE}-${PV}-${PR}" |
| 55 | SPL_SYMLINK ?= "${SPL_BINARYNAME}-${MACHINE}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 56 | |
| 57 | # Additional environment variables or a script can be installed alongside |
| 58 | # u-boot to be used automatically on boot. This file, typically 'uEnv.txt' |
| 59 | # or 'boot.scr', should be packaged along with u-boot as well as placed in the |
| 60 | # deploy directory. Machine configurations needing one of these files should |
| 61 | # include it in the SRC_URI and set the UBOOT_ENV parameter. |
| 62 | UBOOT_ENV_SUFFIX ?= "txt" |
| 63 | UBOOT_ENV ?= "" |
| 64 | UBOOT_ENV_BINARY ?= "${UBOOT_ENV}.${UBOOT_ENV_SUFFIX}" |
| 65 | UBOOT_ENV_IMAGE ?= "${UBOOT_ENV}-${MACHINE}-${PV}-${PR}.${UBOOT_ENV_SUFFIX}" |
| 66 | UBOOT_ENV_SYMLINK ?= "${UBOOT_ENV}-${MACHINE}.${UBOOT_ENV_SUFFIX}" |
| 67 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 68 | # U-Boot EXTLINUX variables. U-Boot searches for /boot/extlinux/extlinux.conf |
| 69 | # to find EXTLINUX conf file. |
| 70 | UBOOT_EXTLINUX_INSTALL_DIR ?= "/boot/extlinux" |
| 71 | UBOOT_EXTLINUX_CONF_NAME ?= "extlinux.conf" |
| 72 | UBOOT_EXTLINUX_SYMLINK ?= "${UBOOT_EXTLINUX_CONF_NAME}-${MACHINE}-${PR}" |
| 73 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 74 | do_compile () { |
| 75 | if [ "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', 'ld-is-gold', '', d)}" = "ld-is-gold" ] ; then |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 76 | sed -i 's/$(CROSS_COMPILE)ld$/$(CROSS_COMPILE)ld.bfd/g' ${S}/config.mk |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 77 | fi |
| 78 | |
| 79 | unset LDFLAGS |
| 80 | unset CFLAGS |
| 81 | unset CPPFLAGS |
| 82 | |
| 83 | if [ ! -e ${B}/.scmversion -a ! -e ${S}/.scmversion ] |
| 84 | then |
| 85 | echo ${UBOOT_LOCALVERSION} > ${B}/.scmversion |
| 86 | echo ${UBOOT_LOCALVERSION} > ${S}/.scmversion |
| 87 | fi |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 88 | |
| 89 | if [ -n "${UBOOT_CONFIG}" ] |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 90 | then |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 91 | unset i j k |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 92 | for config in ${UBOOT_MACHINE}; do |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 93 | i=$(expr $i + 1); |
| 94 | for type in ${UBOOT_CONFIG}; do |
| 95 | j=$(expr $j + 1); |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 96 | if [ $j -eq $i ] |
| 97 | then |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 98 | oe_runmake -C ${S} O=${B}/${config} ${config} |
| 99 | oe_runmake -C ${S} O=${B}/${config} ${UBOOT_MAKE_TARGET} |
| 100 | for binary in ${UBOOT_BINARIES}; do |
| 101 | k=$(expr $k + 1); |
| 102 | if [ $k -eq $i ]; then |
| 103 | cp ${B}/${config}/${binary} ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX} |
| 104 | fi |
| 105 | done |
| 106 | unset k |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 107 | fi |
| 108 | done |
| 109 | unset j |
| 110 | done |
| 111 | unset i |
| 112 | else |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 113 | oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE} |
| 114 | oe_runmake -C ${S} O=${B} ${UBOOT_MAKE_TARGET} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 115 | fi |
| 116 | |
| 117 | } |
| 118 | |
| 119 | do_install () { |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 120 | if [ -n "${UBOOT_CONFIG}" ] |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 121 | then |
| 122 | for config in ${UBOOT_MACHINE}; do |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 123 | i=$(expr $i + 1); |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 124 | for type in ${UBOOT_CONFIG}; do |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 125 | j=$(expr $j + 1); |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 126 | if [ $j -eq $i ] |
| 127 | then |
| 128 | install -d ${D}/boot |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 129 | install -m 644 ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${D}/boot/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 130 | ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type} |
| 131 | ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY} |
| 132 | fi |
| 133 | done |
| 134 | unset j |
| 135 | done |
| 136 | unset i |
| 137 | else |
| 138 | install -d ${D}/boot |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 139 | install -m 644 ${B}/${UBOOT_BINARY} ${D}/boot/${UBOOT_IMAGE} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 140 | ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY} |
| 141 | fi |
| 142 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 143 | if [ -n "${UBOOT_ELF}" ] |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 144 | then |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 145 | if [ -n "${UBOOT_CONFIG}" ] |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 146 | then |
| 147 | for config in ${UBOOT_MACHINE}; do |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 148 | i=$(expr $i + 1); |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 149 | for type in ${UBOOT_CONFIG}; do |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 150 | j=$(expr $j + 1); |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 151 | if [ $j -eq $i ] |
| 152 | then |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 153 | install -m 644 ${B}/${config}/${UBOOT_ELF} ${D}/boot/u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 154 | ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type} |
| 155 | ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY} |
| 156 | fi |
| 157 | done |
| 158 | unset j |
| 159 | done |
| 160 | unset i |
| 161 | else |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 162 | install -m 644 ${B}/${UBOOT_ELF} ${D}/boot/${UBOOT_ELF_IMAGE} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 163 | ln -sf ${UBOOT_ELF_IMAGE} ${D}/boot/${UBOOT_ELF_BINARY} |
| 164 | fi |
| 165 | fi |
| 166 | |
| 167 | if [ -e ${WORKDIR}/fw_env.config ] ; then |
| 168 | install -d ${D}${sysconfdir} |
| 169 | install -m 644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config |
| 170 | fi |
| 171 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 172 | if [ -n "${SPL_BINARY}" ] |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 173 | then |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 174 | if [ -n "${UBOOT_CONFIG}" ] |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 175 | then |
| 176 | for config in ${UBOOT_MACHINE}; do |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 177 | i=$(expr $i + 1); |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 178 | for type in ${UBOOT_CONFIG}; do |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 179 | j=$(expr $j + 1); |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 180 | if [ $j -eq $i ] |
| 181 | then |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 182 | install -m 644 ${B}/${config}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE}-${type}-${PV}-${PR} |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 183 | ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${D}/boot/${SPL_BINARYNAME}-${type} |
| 184 | ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${D}/boot/${SPL_BINARYNAME} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 185 | fi |
| 186 | done |
| 187 | unset j |
| 188 | done |
| 189 | unset i |
| 190 | else |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 191 | install -m 644 ${B}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE} |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 192 | ln -sf ${SPL_IMAGE} ${D}/boot/${SPL_BINARYNAME} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 193 | fi |
| 194 | fi |
| 195 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 196 | if [ -n "${UBOOT_ENV}" ] |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 197 | then |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 198 | install -m 644 ${WORKDIR}/${UBOOT_ENV_BINARY} ${D}/boot/${UBOOT_ENV_IMAGE} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 199 | ln -sf ${UBOOT_ENV_IMAGE} ${D}/boot/${UBOOT_ENV_BINARY} |
| 200 | fi |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 201 | |
| 202 | if [ "${UBOOT_EXTLINUX}" = "1" ] |
| 203 | then |
| 204 | install -Dm 0644 ${UBOOT_EXTLINUX_CONFIG} ${D}/${UBOOT_EXTLINUX_INSTALL_DIR}/${UBOOT_EXTLINUX_CONF_NAME} |
| 205 | fi |
| 206 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 207 | } |
| 208 | |
| 209 | FILES_${PN} = "/boot ${sysconfdir}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 210 | |
| 211 | do_deploy () { |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 212 | if [ -n "${UBOOT_CONFIG}" ] |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 213 | then |
| 214 | for config in ${UBOOT_MACHINE}; do |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 215 | i=$(expr $i + 1); |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 216 | for type in ${UBOOT_CONFIG}; do |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 217 | j=$(expr $j + 1); |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 218 | if [ $j -eq $i ] |
| 219 | then |
| 220 | install -d ${DEPLOYDIR} |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 221 | install -m 644 ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${DEPLOYDIR}/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 222 | cd ${DEPLOYDIR} |
| 223 | ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}-${type} |
| 224 | ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK} |
| 225 | ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY}-${type} |
| 226 | ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY} |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 227 | fi |
| 228 | done |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 229 | unset j |
| 230 | done |
| 231 | unset i |
| 232 | else |
| 233 | install -d ${DEPLOYDIR} |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 234 | install -m 644 ${B}/${UBOOT_BINARY} ${DEPLOYDIR}/${UBOOT_IMAGE} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 235 | cd ${DEPLOYDIR} |
| 236 | rm -f ${UBOOT_BINARY} ${UBOOT_SYMLINK} |
| 237 | ln -sf ${UBOOT_IMAGE} ${UBOOT_SYMLINK} |
| 238 | ln -sf ${UBOOT_IMAGE} ${UBOOT_BINARY} |
| 239 | fi |
| 240 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 241 | if [ -n "${UBOOT_ELF}" ] |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 242 | then |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 243 | if [ -n "${UBOOT_CONFIG}" ] |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 244 | then |
| 245 | for config in ${UBOOT_MACHINE}; do |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 246 | i=$(expr $i + 1); |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 247 | for type in ${UBOOT_CONFIG}; do |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 248 | j=$(expr $j + 1); |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 249 | if [ $j -eq $i ] |
| 250 | then |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 251 | install -m 644 ${B}/${config}/${UBOOT_ELF} ${DEPLOYDIR}/u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 252 | ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}-${type} |
| 253 | ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY} |
| 254 | ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}-${type} |
| 255 | ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK} |
| 256 | fi |
| 257 | done |
| 258 | unset j |
| 259 | done |
| 260 | unset i |
| 261 | else |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 262 | install -m 644 ${B}/${UBOOT_ELF} ${DEPLOYDIR}/${UBOOT_ELF_IMAGE} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 263 | ln -sf ${UBOOT_ELF_IMAGE} ${DEPLOYDIR}/${UBOOT_ELF_BINARY} |
| 264 | ln -sf ${UBOOT_ELF_IMAGE} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK} |
| 265 | fi |
| 266 | fi |
| 267 | |
| 268 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 269 | if [ -n "${SPL_BINARY}" ] |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 270 | then |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 271 | if [ -n "${UBOOT_CONFIG}" ] |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 272 | then |
| 273 | for config in ${UBOOT_MACHINE}; do |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 274 | i=$(expr $i + 1); |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 275 | for type in ${UBOOT_CONFIG}; do |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 276 | j=$(expr $j + 1); |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 277 | if [ $j -eq $i ] |
| 278 | then |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 279 | install -m 644 ${B}/${config}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE}-${type}-${PV}-${PR} |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 280 | rm -f ${DEPLOYDIR}/${SPL_BINARYNAME} ${DEPLOYDIR}/${SPL_SYMLINK}-${type} |
| 281 | ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_BINARYNAME}-${type} |
| 282 | ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_BINARYNAME} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 283 | ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_SYMLINK}-${type} |
| 284 | ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_SYMLINK} |
| 285 | fi |
| 286 | done |
| 287 | unset j |
| 288 | done |
| 289 | unset i |
| 290 | else |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 291 | install -m 644 ${B}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE} |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 292 | rm -f ${DEPLOYDIR}/${SPL_BINARYNAME} ${DEPLOYDIR}/${SPL_SYMLINK} |
| 293 | ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_BINARYNAME} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 294 | ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_SYMLINK} |
| 295 | fi |
| 296 | fi |
| 297 | |
| 298 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 299 | if [ -n "${UBOOT_ENV}" ] |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 300 | then |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 301 | install -m 644 ${WORKDIR}/${UBOOT_ENV_BINARY} ${DEPLOYDIR}/${UBOOT_ENV_IMAGE} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 302 | rm -f ${DEPLOYDIR}/${UBOOT_ENV_BINARY} ${DEPLOYDIR}/${UBOOT_ENV_SYMLINK} |
| 303 | ln -sf ${UBOOT_ENV_IMAGE} ${DEPLOYDIR}/${UBOOT_ENV_BINARY} |
| 304 | ln -sf ${UBOOT_ENV_IMAGE} ${DEPLOYDIR}/${UBOOT_ENV_SYMLINK} |
| 305 | fi |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 306 | |
| 307 | if [ "${UBOOT_EXTLINUX}" = "1" ] |
| 308 | then |
| 309 | install -m 644 ${UBOOT_EXTLINUX_CONFIG} ${DEPLOYDIR}/${UBOOT_EXTLINUX_SYMLINK} |
| 310 | ln -sf ${UBOOT_EXTLINUX_SYMLINK} ${DEPLOYDIR}/${UBOOT_EXTLINUX_CONF_NAME}-${MACHINE} |
| 311 | ln -sf ${UBOOT_EXTLINUX_SYMLINK} ${DEPLOYDIR}/${UBOOT_EXTLINUX_CONF_NAME} |
| 312 | fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 313 | } |
| 314 | |
| 315 | addtask deploy before do_build after do_compile |