blob: f022aed732ce6425dc45b9cb9a44563799639303 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Universal Boot Loader for embedded devices"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05002PROVIDES = "virtual/bootloader"
3
Patrick Williamsc124f4f2015-09-15 14:41:29 -05004PACKAGE_ARCH = "${MACHINE_ARCH}"
5
Andrew Geisslereff27472021-10-29 15:35:00 -05006DEPENDS += "${@bb.utils.contains('UBOOT_ENV_SUFFIX', 'scr', 'u-boot-mkimage-native', '', d)}"
Brad Bishop19323692019-04-05 15:28:33 -04007
Andrew Geissler09036742021-06-25 14:25:14 -05008inherit uboot-config uboot-extlinux-config uboot-sign deploy cml1 python3native kernel-arch
Patrick Williamsc124f4f2015-09-15 14:41:29 -05009
Andrew Geissler82c905d2020-04-13 13:39:40 -050010DEPENDS += "swig-native"
Brad Bishopd5ae7d92018-06-14 09:52:03 -070011
Patrick Williamsc124f4f2015-09-15 14:41:29 -050012EXTRA_OEMAKE = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}" V=1'
13EXTRA_OEMAKE += 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"'
Andrew Geissler82c905d2020-04-13 13:39:40 -050014EXTRA_OEMAKE += 'STAGING_INCDIR=${STAGING_INCDIR_NATIVE} STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE}'
Patrick Williamsc124f4f2015-09-15 14:41:29 -050015
16PACKAGECONFIG ??= "openssl"
17# u-boot will compile its own tools during the build, with specific
18# configurations (aka when CONFIG_FIT_SIGNATURE is enabled) openssl is needed as
19# a host build dependency.
20PACKAGECONFIG[openssl] = ",,openssl-native"
21
22# Allow setting an additional version string that will be picked up by the
23# u-boot build system and appended to the u-boot version. If the .scmversion
24# file already exists it will not be overwritten.
25UBOOT_LOCALVERSION ?= ""
26
Zev Weiss897b7442022-01-18 22:48:12 -080027require u-boot-configure.inc
Brad Bishop19323692019-04-05 15:28:33 -040028
Patrick Williamsc124f4f2015-09-15 14:41:29 -050029do_compile () {
Andrew Geissler4ed12e12020-06-05 18:00:41 -050030 if [ "${@bb.utils.filter('DISTRO_FEATURES', 'ld-is-gold', d)}" ]; then
31 sed -i 's/$(CROSS_COMPILE)ld$/$(CROSS_COMPILE)ld.bfd/g' ${S}/config.mk
32 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050033
Andrew Geissler4ed12e12020-06-05 18:00:41 -050034 unset LDFLAGS
35 unset CFLAGS
36 unset CPPFLAGS
Patrick Williamsc124f4f2015-09-15 14:41:29 -050037
Andrew Geissler4ed12e12020-06-05 18:00:41 -050038 if [ ! -e ${B}/.scmversion -a ! -e ${S}/.scmversion ]
39 then
40 echo ${UBOOT_LOCALVERSION} > ${B}/.scmversion
41 echo ${UBOOT_LOCALVERSION} > ${S}/.scmversion
42 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -060043
Andrew Geisslerd25ed322020-06-27 00:28:28 -050044 if [ -n "${UBOOT_CONFIG}" -o -n "${UBOOT_DELTA_CONFIG}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -050045 then
Patrick Williamsc0f7c042017-02-23 20:41:17 -060046 unset i j k
Patrick Williamsc124f4f2015-09-15 14:41:29 -050047 for config in ${UBOOT_MACHINE}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -060048 i=$(expr $i + 1);
49 for type in ${UBOOT_CONFIG}; do
50 j=$(expr $j + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -050051 if [ $j -eq $i ]
52 then
Patrick Williamsc0f7c042017-02-23 20:41:17 -060053 oe_runmake -C ${S} O=${B}/${config} ${UBOOT_MAKE_TARGET}
54 for binary in ${UBOOT_BINARIES}; do
55 k=$(expr $k + 1);
56 if [ $k -eq $i ]; then
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050057 cp ${B}/${config}/${binary} ${B}/${config}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX}
Patrick Williamsc0f7c042017-02-23 20:41:17 -060058 fi
59 done
Andrew Geissler82c905d2020-04-13 13:39:40 -050060
61 # Generate the uboot-initial-env
Andrew Geissler4ed12e12020-06-05 18:00:41 -050062 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
63 oe_runmake -C ${S} O=${B}/${config} u-boot-initial-env
64 cp ${B}/${config}/u-boot-initial-env ${B}/${config}/u-boot-initial-env-${type}
65 fi
Andrew Geissler82c905d2020-04-13 13:39:40 -050066
Patrick Williamsc0f7c042017-02-23 20:41:17 -060067 unset k
Patrick Williamsc124f4f2015-09-15 14:41:29 -050068 fi
69 done
Andrew Geissler4ed12e12020-06-05 18:00:41 -050070 unset j
Patrick Williamsc124f4f2015-09-15 14:41:29 -050071 done
Andrew Geissler4ed12e12020-06-05 18:00:41 -050072 unset i
Patrick Williamsc124f4f2015-09-15 14:41:29 -050073 else
Patrick Williamsc0f7c042017-02-23 20:41:17 -060074 oe_runmake -C ${S} O=${B} ${UBOOT_MAKE_TARGET}
Andrew Geissler82c905d2020-04-13 13:39:40 -050075
76 # Generate the uboot-initial-env
Andrew Geissler4ed12e12020-06-05 18:00:41 -050077 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
78 oe_runmake -C ${S} O=${B} u-boot-initial-env
79 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050080 fi
Andrew Geisslereff27472021-10-29 15:35:00 -050081
82 if [ -n "${UBOOT_ENV}" ] && [ "${UBOOT_ENV_SUFFIX}" = "scr" ]
83 then
84 ${UBOOT_MKIMAGE} -C none -A ${UBOOT_ARCH} -T script -d ${WORKDIR}/${UBOOT_ENV_SRC} ${WORKDIR}/${UBOOT_ENV_BINARY}
85 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050086}
87
88do_install () {
Patrick Williamsc0f7c042017-02-23 20:41:17 -060089 if [ -n "${UBOOT_CONFIG}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -050090 then
91 for config in ${UBOOT_MACHINE}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -060092 i=$(expr $i + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -050093 for type in ${UBOOT_CONFIG}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -060094 j=$(expr $j + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -050095 if [ $j -eq $i ]
96 then
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050097 install -D -m 644 ${B}/${config}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
98 ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type}
99 ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}
Andrew Geissler82c905d2020-04-13 13:39:40 -0500100
101 # Install the uboot-initial-env
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500102 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
103 install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR}
104 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}
105 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${type}
106 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}
107 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500108 fi
109 done
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500110 unset j
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500111 done
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500112 unset i
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500113 else
Andrew Geissler82c905d2020-04-13 13:39:40 -0500114 install -D -m 644 ${B}/${UBOOT_BINARY} ${D}/boot/${UBOOT_IMAGE}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500115 ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY}
Andrew Geissler82c905d2020-04-13 13:39:40 -0500116
117 # Install the uboot-initial-env
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500118 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
119 install -D -m 644 ${B}/u-boot-initial-env ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR}
120 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}
121 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}
122 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500123 fi
124
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600125 if [ -n "${UBOOT_ELF}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500126 then
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600127 if [ -n "${UBOOT_CONFIG}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500128 then
129 for config in ${UBOOT_MACHINE}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600130 i=$(expr $i + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500131 for type in ${UBOOT_CONFIG}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600132 j=$(expr $j + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500133 if [ $j -eq $i ]
134 then
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600135 install -m 644 ${B}/${config}/${UBOOT_ELF} ${D}/boot/u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500136 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type}
137 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY}
138 fi
139 done
140 unset j
141 done
142 unset i
143 else
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600144 install -m 644 ${B}/${UBOOT_ELF} ${D}/boot/${UBOOT_ELF_IMAGE}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500145 ln -sf ${UBOOT_ELF_IMAGE} ${D}/boot/${UBOOT_ELF_BINARY}
146 fi
147 fi
148
149 if [ -e ${WORKDIR}/fw_env.config ] ; then
150 install -d ${D}${sysconfdir}
151 install -m 644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config
152 fi
153
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600154 if [ -n "${SPL_BINARY}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500155 then
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600156 if [ -n "${UBOOT_CONFIG}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500157 then
158 for config in ${UBOOT_MACHINE}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600159 i=$(expr $i + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500160 for type in ${UBOOT_CONFIG}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600161 j=$(expr $j + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500162 if [ $j -eq $i ]
163 then
Andrew Geisslerd159c7f2021-09-02 21:05:58 -0500164 install -m 644 ${B}/${config}/${SPL_BINARY} ${D}/boot/${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX}
165 ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${D}/boot/${SPL_BINARYFILE}-${type}
166 ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${D}/boot/${SPL_BINARYFILE}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500167 fi
168 done
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500169 unset j
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500170 done
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500171 unset i
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500172 else
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600173 install -m 644 ${B}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE}
Andrew Geisslerd159c7f2021-09-02 21:05:58 -0500174 ln -sf ${SPL_IMAGE} ${D}/boot/${SPL_BINARYFILE}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500175 fi
176 fi
177
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600178 if [ -n "${UBOOT_ENV}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500179 then
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600180 install -m 644 ${WORKDIR}/${UBOOT_ENV_BINARY} ${D}/boot/${UBOOT_ENV_IMAGE}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500181 ln -sf ${UBOOT_ENV_IMAGE} ${D}/boot/${UBOOT_ENV_BINARY}
182 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600183
184 if [ "${UBOOT_EXTLINUX}" = "1" ]
185 then
186 install -Dm 0644 ${UBOOT_EXTLINUX_CONFIG} ${D}/${UBOOT_EXTLINUX_INSTALL_DIR}/${UBOOT_EXTLINUX_CONF_NAME}
187 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500188}
189
Patrick Williams0ca19cc2021-08-16 14:03:13 -0500190PACKAGE_BEFORE_PN += "${PN}-env ${PN}-extlinux"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500191
Patrick Williams213cb262021-08-07 19:21:33 -0500192RPROVIDES:${PN}-env += "u-boot-default-env"
193ALLOW_EMPTY:${PN}-env = "1"
194FILES:${PN}-env = " \
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500195 ${@ '${sysconfdir}/${UBOOT_INITIAL_ENV}*' if d.getVar('UBOOT_INITIAL_ENV') else ''} \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500196 ${sysconfdir}/fw_env.config \
197"
198
Patrick Williams0ca19cc2021-08-16 14:03:13 -0500199FILES:${PN}-extlinux = "${UBOOT_EXTLINUX_INSTALL_DIR}/${UBOOT_EXTLINUX_CONF_NAME}"
200RDEPENDS:${PN} += "${@bb.utils.contains('UBOOT_EXTLINUX', '1', '${PN}-extlinux', '', d)}"
201
Patrick Williams213cb262021-08-07 19:21:33 -0500202FILES:${PN} = "/boot ${datadir}"
203RDEPENDS:${PN} += "${PN}-env"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500204
205do_deploy () {
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600206 if [ -n "${UBOOT_CONFIG}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500207 then
208 for config in ${UBOOT_MACHINE}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600209 i=$(expr $i + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500210 for type in ${UBOOT_CONFIG}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600211 j=$(expr $j + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500212 if [ $j -eq $i ]
213 then
Andrew Geisslerd159c7f2021-09-02 21:05:58 -0500214 install -D -m 644 ${B}/${config}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX} ${DEPLOYDIR}/${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500215 cd ${DEPLOYDIR}
Andrew Geisslerd159c7f2021-09-02 21:05:58 -0500216 ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}-${type}
217 ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}
218 ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY}-${type}
219 ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY}
Andrew Geissler82c905d2020-04-13 13:39:40 -0500220
221 # Deploy the uboot-initial-env
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500222 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
223 install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${DEPLOYDIR}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR}
224 cd ${DEPLOYDIR}
225 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}
226 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${UBOOT_INITIAL_ENV}-${type}
227 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600228 fi
229 done
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500230 unset j
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500231 done
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500232 unset i
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500233 else
Andrew Geissler82c905d2020-04-13 13:39:40 -0500234 install -D -m 644 ${B}/${UBOOT_BINARY} ${DEPLOYDIR}/${UBOOT_IMAGE}
235
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500236 cd ${DEPLOYDIR}
237 rm -f ${UBOOT_BINARY} ${UBOOT_SYMLINK}
238 ln -sf ${UBOOT_IMAGE} ${UBOOT_SYMLINK}
239 ln -sf ${UBOOT_IMAGE} ${UBOOT_BINARY}
Andrew Geissler82c905d2020-04-13 13:39:40 -0500240
241 # Deploy the uboot-initial-env
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500242 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
243 install -D -m 644 ${B}/u-boot-initial-env ${DEPLOYDIR}/${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR}
244 cd ${DEPLOYDIR}
245 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${UBOOT_INITIAL_ENV}-${MACHINE}
246 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${UBOOT_INITIAL_ENV}
247 fi
Andrew Geissler82c905d2020-04-13 13:39:40 -0500248 fi
249
250 if [ -e ${WORKDIR}/fw_env.config ] ; then
251 install -D -m 644 ${WORKDIR}/fw_env.config ${DEPLOYDIR}/fw_env.config-${MACHINE}-${PV}-${PR}
252 cd ${DEPLOYDIR}
253 ln -sf fw_env.config-${MACHINE}-${PV}-${PR} fw_env.config-${MACHINE}
254 ln -sf fw_env.config-${MACHINE}-${PV}-${PR} fw_env.config
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800255 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500256
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600257 if [ -n "${UBOOT_ELF}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500258 then
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600259 if [ -n "${UBOOT_CONFIG}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500260 then
261 for config in ${UBOOT_MACHINE}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600262 i=$(expr $i + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500263 for type in ${UBOOT_CONFIG}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600264 j=$(expr $j + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500265 if [ $j -eq $i ]
266 then
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600267 install -m 644 ${B}/${config}/${UBOOT_ELF} ${DEPLOYDIR}/u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500268 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}-${type}
269 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}
270 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}-${type}
271 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}
272 fi
273 done
274 unset j
275 done
276 unset i
277 else
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600278 install -m 644 ${B}/${UBOOT_ELF} ${DEPLOYDIR}/${UBOOT_ELF_IMAGE}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500279 ln -sf ${UBOOT_ELF_IMAGE} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}
280 ln -sf ${UBOOT_ELF_IMAGE} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}
281 fi
282 fi
283
284
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600285 if [ -n "${SPL_BINARY}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500286 then
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800287 if [ -n "${UBOOT_CONFIG}" ]
288 then
289 for config in ${UBOOT_MACHINE}; do
290 i=$(expr $i + 1);
291 for type in ${UBOOT_CONFIG}; do
292 j=$(expr $j + 1);
293 if [ $j -eq $i ]
294 then
Andrew Geisslerd159c7f2021-09-02 21:05:58 -0500295 install -m 644 ${B}/${config}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX}
296 rm -f ${DEPLOYDIR}/${SPL_BINARYFILE} ${DEPLOYDIR}/${SPL_SYMLINK}
297 ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_BINARYFILE}-${type}
298 ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_BINARYFILE}
299 ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_SYMLINK}-${type}
300 ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_SYMLINK}
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800301 fi
302 done
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500303 unset j
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800304 done
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500305 unset i
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800306 else
307 install -m 644 ${B}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE}
308 rm -f ${DEPLOYDIR}/${SPL_BINARYNAME} ${DEPLOYDIR}/${SPL_SYMLINK}
309 ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_BINARYNAME}
310 ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_SYMLINK}
311 fi
312 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500313
314
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600315 if [ -n "${UBOOT_ENV}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500316 then
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600317 install -m 644 ${WORKDIR}/${UBOOT_ENV_BINARY} ${DEPLOYDIR}/${UBOOT_ENV_IMAGE}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500318 rm -f ${DEPLOYDIR}/${UBOOT_ENV_BINARY} ${DEPLOYDIR}/${UBOOT_ENV_SYMLINK}
319 ln -sf ${UBOOT_ENV_IMAGE} ${DEPLOYDIR}/${UBOOT_ENV_BINARY}
320 ln -sf ${UBOOT_ENV_IMAGE} ${DEPLOYDIR}/${UBOOT_ENV_SYMLINK}
321 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600322
323 if [ "${UBOOT_EXTLINUX}" = "1" ]
324 then
325 install -m 644 ${UBOOT_EXTLINUX_CONFIG} ${DEPLOYDIR}/${UBOOT_EXTLINUX_SYMLINK}
326 ln -sf ${UBOOT_EXTLINUX_SYMLINK} ${DEPLOYDIR}/${UBOOT_EXTLINUX_CONF_NAME}-${MACHINE}
327 ln -sf ${UBOOT_EXTLINUX_SYMLINK} ${DEPLOYDIR}/${UBOOT_EXTLINUX_CONF_NAME}
328 fi
Andrew Geissler09036742021-06-25 14:25:14 -0500329
330 if [ -n "${UBOOT_DTB}" ]
331 then
332 install -m 644 ${B}/arch/${UBOOT_ARCH}/dts/${UBOOT_DTB_BINARY} ${DEPLOYDIR}/
333 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500334}
335
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500336addtask deploy before do_build after do_compile