blob: 5398c2e6211597170ceca6c62499b1cff7a08bb2 [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
Brad Bishop19323692019-04-05 15:28:33 -04006DEPENDS += "kern-tools-native"
7
Andrew Geissler82c905d2020-04-13 13:39:40 -05008inherit uboot-config uboot-extlinux-config uboot-sign deploy cml1 python3native
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
Brad Bishop19323692019-04-05 15:28:33 -040027do_configure () {
Andrew Geissler5a43b432020-06-13 10:46:56 -050028 if [ -n "${UBOOT_CONFIG}" ]; then
29 unset i j
30 for config in ${UBOOT_MACHINE}; do
31 i=$(expr $i + 1);
32 for type in ${UBOOT_CONFIG}; do
33 j=$(expr $j + 1);
34 if [ $j -eq $i ]; then
35 oe_runmake -C ${S} O=${B}/${config} ${config}
Andrew Geisslerb7d28612020-07-24 16:15:54 -050036 if [ -n "${@' '.join(find_cfgs(d))}" ]; then
Andrew Geisslerd25ed322020-06-27 00:28:28 -050037 merge_config.sh -m -O ${B}/${config} ${B}/${config}/.config ${@" ".join(find_cfgs(d))}
38 oe_runmake -C ${S} O=${B}/${config} oldconfig
39 fi
Andrew Geissler5a43b432020-06-13 10:46:56 -050040 fi
41 done
42 unset j
43 done
44 unset i
45 DEVTOOL_DISABLE_MENUCONFIG=true
46 else
Brad Bishop19323692019-04-05 15:28:33 -040047 if [ -n "${UBOOT_MACHINE}" ]; then
48 oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE}
49 else
50 oe_runmake -C ${S} O=${B} oldconfig
51 fi
52 merge_config.sh -m .config ${@" ".join(find_cfgs(d))}
53 cml1_do_configure
54 fi
55}
56
Patrick Williamsc124f4f2015-09-15 14:41:29 -050057do_compile () {
Andrew Geissler4ed12e12020-06-05 18:00:41 -050058 if [ "${@bb.utils.filter('DISTRO_FEATURES', 'ld-is-gold', d)}" ]; then
59 sed -i 's/$(CROSS_COMPILE)ld$/$(CROSS_COMPILE)ld.bfd/g' ${S}/config.mk
60 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050061
Andrew Geissler4ed12e12020-06-05 18:00:41 -050062 unset LDFLAGS
63 unset CFLAGS
64 unset CPPFLAGS
Patrick Williamsc124f4f2015-09-15 14:41:29 -050065
Andrew Geissler4ed12e12020-06-05 18:00:41 -050066 if [ ! -e ${B}/.scmversion -a ! -e ${S}/.scmversion ]
67 then
68 echo ${UBOOT_LOCALVERSION} > ${B}/.scmversion
69 echo ${UBOOT_LOCALVERSION} > ${S}/.scmversion
70 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -060071
Andrew Geisslerd25ed322020-06-27 00:28:28 -050072 if [ -n "${UBOOT_CONFIG}" -o -n "${UBOOT_DELTA_CONFIG}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -050073 then
Patrick Williamsc0f7c042017-02-23 20:41:17 -060074 unset i j k
Patrick Williamsc124f4f2015-09-15 14:41:29 -050075 for config in ${UBOOT_MACHINE}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -060076 i=$(expr $i + 1);
77 for type in ${UBOOT_CONFIG}; do
78 j=$(expr $j + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -050079 if [ $j -eq $i ]
80 then
Patrick Williamsc0f7c042017-02-23 20:41:17 -060081 oe_runmake -C ${S} O=${B}/${config} ${UBOOT_MAKE_TARGET}
82 for binary in ${UBOOT_BINARIES}; do
83 k=$(expr $k + 1);
84 if [ $k -eq $i ]; then
85 cp ${B}/${config}/${binary} ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX}
86 fi
87 done
Andrew Geissler82c905d2020-04-13 13:39:40 -050088
89 # Generate the uboot-initial-env
Andrew Geissler4ed12e12020-06-05 18:00:41 -050090 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
91 oe_runmake -C ${S} O=${B}/${config} u-boot-initial-env
92 cp ${B}/${config}/u-boot-initial-env ${B}/${config}/u-boot-initial-env-${type}
93 fi
Andrew Geissler82c905d2020-04-13 13:39:40 -050094
Patrick Williamsc0f7c042017-02-23 20:41:17 -060095 unset k
Patrick Williamsc124f4f2015-09-15 14:41:29 -050096 fi
97 done
Andrew Geissler4ed12e12020-06-05 18:00:41 -050098 unset j
Patrick Williamsc124f4f2015-09-15 14:41:29 -050099 done
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500100 unset i
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500101 else
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600102 oe_runmake -C ${S} O=${B} ${UBOOT_MAKE_TARGET}
Andrew Geissler82c905d2020-04-13 13:39:40 -0500103
104 # Generate the uboot-initial-env
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500105 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
106 oe_runmake -C ${S} O=${B} u-boot-initial-env
107 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500108 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500109}
110
111do_install () {
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600112 if [ -n "${UBOOT_CONFIG}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500113 then
114 for config in ${UBOOT_MACHINE}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600115 i=$(expr $i + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500116 for type in ${UBOOT_CONFIG}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600117 j=$(expr $j + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500118 if [ $j -eq $i ]
119 then
Andrew Geissler82c905d2020-04-13 13:39:40 -0500120 install -D -m 644 ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${D}/boot/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500121 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type}
122 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}
Andrew Geissler82c905d2020-04-13 13:39:40 -0500123
124 # Install the uboot-initial-env
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500125 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
126 install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR}
127 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}
128 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${type}
129 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}
130 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500131 fi
132 done
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500133 unset j
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500134 done
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500135 unset i
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500136 else
Andrew Geissler82c905d2020-04-13 13:39:40 -0500137 install -D -m 644 ${B}/${UBOOT_BINARY} ${D}/boot/${UBOOT_IMAGE}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500138 ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY}
Andrew Geissler82c905d2020-04-13 13:39:40 -0500139
140 # Install the uboot-initial-env
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500141 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
142 install -D -m 644 ${B}/u-boot-initial-env ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR}
143 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}
144 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}
145 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500146 fi
147
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600148 if [ -n "${UBOOT_ELF}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500149 then
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600150 if [ -n "${UBOOT_CONFIG}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500151 then
152 for config in ${UBOOT_MACHINE}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600153 i=$(expr $i + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500154 for type in ${UBOOT_CONFIG}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600155 j=$(expr $j + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500156 if [ $j -eq $i ]
157 then
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600158 install -m 644 ${B}/${config}/${UBOOT_ELF} ${D}/boot/u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500159 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type}
160 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY}
161 fi
162 done
163 unset j
164 done
165 unset i
166 else
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600167 install -m 644 ${B}/${UBOOT_ELF} ${D}/boot/${UBOOT_ELF_IMAGE}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500168 ln -sf ${UBOOT_ELF_IMAGE} ${D}/boot/${UBOOT_ELF_BINARY}
169 fi
170 fi
171
172 if [ -e ${WORKDIR}/fw_env.config ] ; then
173 install -d ${D}${sysconfdir}
174 install -m 644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config
175 fi
176
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600177 if [ -n "${SPL_BINARY}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500178 then
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600179 if [ -n "${UBOOT_CONFIG}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500180 then
181 for config in ${UBOOT_MACHINE}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600182 i=$(expr $i + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500183 for type in ${UBOOT_CONFIG}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600184 j=$(expr $j + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500185 if [ $j -eq $i ]
186 then
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600187 install -m 644 ${B}/${config}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE}-${type}-${PV}-${PR}
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500188 ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${D}/boot/${SPL_BINARYNAME}-${type}
189 ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${D}/boot/${SPL_BINARYNAME}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500190 fi
191 done
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500192 unset j
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500193 done
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500194 unset i
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500195 else
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600196 install -m 644 ${B}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE}
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500197 ln -sf ${SPL_IMAGE} ${D}/boot/${SPL_BINARYNAME}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500198 fi
199 fi
200
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600201 if [ -n "${UBOOT_ENV}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500202 then
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600203 install -m 644 ${WORKDIR}/${UBOOT_ENV_BINARY} ${D}/boot/${UBOOT_ENV_IMAGE}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500204 ln -sf ${UBOOT_ENV_IMAGE} ${D}/boot/${UBOOT_ENV_BINARY}
205 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600206
207 if [ "${UBOOT_EXTLINUX}" = "1" ]
208 then
209 install -Dm 0644 ${UBOOT_EXTLINUX_CONFIG} ${D}/${UBOOT_EXTLINUX_INSTALL_DIR}/${UBOOT_EXTLINUX_CONF_NAME}
210 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500211}
212
Andrew Geissler82c905d2020-04-13 13:39:40 -0500213PACKAGE_BEFORE_PN += "${PN}-env"
214
215RPROVIDES_${PN}-env += "u-boot-default-env"
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500216ALLOW_EMPTY_${PN}-env = "1"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500217FILES_${PN}-env = " \
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500218 ${@ '${sysconfdir}/${UBOOT_INITIAL_ENV}*' if d.getVar('UBOOT_INITIAL_ENV') else ''} \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500219 ${sysconfdir}/fw_env.config \
220"
221
222FILES_${PN} = "/boot ${datadir}"
223RDEPENDS_${PN} += "${PN}-env"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500224
225do_deploy () {
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600226 if [ -n "${UBOOT_CONFIG}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500227 then
228 for config in ${UBOOT_MACHINE}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600229 i=$(expr $i + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500230 for type in ${UBOOT_CONFIG}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600231 j=$(expr $j + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500232 if [ $j -eq $i ]
233 then
Andrew Geissler82c905d2020-04-13 13:39:40 -0500234 install -D -m 644 ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${DEPLOYDIR}/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500235 cd ${DEPLOYDIR}
236 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}-${type}
237 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}
238 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY}-${type}
239 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${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}/${config}/u-boot-initial-env-${type} ${DEPLOYDIR}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR}
244 cd ${DEPLOYDIR}
245 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}
246 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${UBOOT_INITIAL_ENV}-${type}
247 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600248 fi
249 done
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500250 unset j
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500251 done
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500252 unset i
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500253 else
Andrew Geissler82c905d2020-04-13 13:39:40 -0500254 install -D -m 644 ${B}/${UBOOT_BINARY} ${DEPLOYDIR}/${UBOOT_IMAGE}
255
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500256 cd ${DEPLOYDIR}
257 rm -f ${UBOOT_BINARY} ${UBOOT_SYMLINK}
258 ln -sf ${UBOOT_IMAGE} ${UBOOT_SYMLINK}
259 ln -sf ${UBOOT_IMAGE} ${UBOOT_BINARY}
Andrew Geissler82c905d2020-04-13 13:39:40 -0500260
261 # Deploy the uboot-initial-env
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500262 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
263 install -D -m 644 ${B}/u-boot-initial-env ${DEPLOYDIR}/${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR}
264 cd ${DEPLOYDIR}
265 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${UBOOT_INITIAL_ENV}-${MACHINE}
266 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${UBOOT_INITIAL_ENV}
267 fi
Andrew Geissler82c905d2020-04-13 13:39:40 -0500268 fi
269
270 if [ -e ${WORKDIR}/fw_env.config ] ; then
271 install -D -m 644 ${WORKDIR}/fw_env.config ${DEPLOYDIR}/fw_env.config-${MACHINE}-${PV}-${PR}
272 cd ${DEPLOYDIR}
273 ln -sf fw_env.config-${MACHINE}-${PV}-${PR} fw_env.config-${MACHINE}
274 ln -sf fw_env.config-${MACHINE}-${PV}-${PR} fw_env.config
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800275 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500276
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600277 if [ -n "${UBOOT_ELF}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500278 then
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600279 if [ -n "${UBOOT_CONFIG}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500280 then
281 for config in ${UBOOT_MACHINE}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600282 i=$(expr $i + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500283 for type in ${UBOOT_CONFIG}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600284 j=$(expr $j + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500285 if [ $j -eq $i ]
286 then
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600287 install -m 644 ${B}/${config}/${UBOOT_ELF} ${DEPLOYDIR}/u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500288 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}-${type}
289 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}
290 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}-${type}
291 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}
292 fi
293 done
294 unset j
295 done
296 unset i
297 else
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600298 install -m 644 ${B}/${UBOOT_ELF} ${DEPLOYDIR}/${UBOOT_ELF_IMAGE}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500299 ln -sf ${UBOOT_ELF_IMAGE} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}
300 ln -sf ${UBOOT_ELF_IMAGE} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}
301 fi
302 fi
303
304
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600305 if [ -n "${SPL_BINARY}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500306 then
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800307 if [ -n "${UBOOT_CONFIG}" ]
308 then
309 for config in ${UBOOT_MACHINE}; do
310 i=$(expr $i + 1);
311 for type in ${UBOOT_CONFIG}; do
312 j=$(expr $j + 1);
313 if [ $j -eq $i ]
314 then
315 install -m 644 ${B}/${config}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE}-${type}-${PV}-${PR}
316 rm -f ${DEPLOYDIR}/${SPL_BINARYNAME} ${DEPLOYDIR}/${SPL_SYMLINK}-${type}
317 ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_BINARYNAME}-${type}
318 ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_BINARYNAME}
319 ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_SYMLINK}-${type}
320 ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_SYMLINK}
321 fi
322 done
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500323 unset j
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800324 done
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500325 unset i
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800326 else
327 install -m 644 ${B}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE}
328 rm -f ${DEPLOYDIR}/${SPL_BINARYNAME} ${DEPLOYDIR}/${SPL_SYMLINK}
329 ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_BINARYNAME}
330 ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_SYMLINK}
331 fi
332 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500333
334
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600335 if [ -n "${UBOOT_ENV}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500336 then
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600337 install -m 644 ${WORKDIR}/${UBOOT_ENV_BINARY} ${DEPLOYDIR}/${UBOOT_ENV_IMAGE}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500338 rm -f ${DEPLOYDIR}/${UBOOT_ENV_BINARY} ${DEPLOYDIR}/${UBOOT_ENV_SYMLINK}
339 ln -sf ${UBOOT_ENV_IMAGE} ${DEPLOYDIR}/${UBOOT_ENV_BINARY}
340 ln -sf ${UBOOT_ENV_IMAGE} ${DEPLOYDIR}/${UBOOT_ENV_SYMLINK}
341 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600342
343 if [ "${UBOOT_EXTLINUX}" = "1" ]
344 then
345 install -m 644 ${UBOOT_EXTLINUX_CONFIG} ${DEPLOYDIR}/${UBOOT_EXTLINUX_SYMLINK}
346 ln -sf ${UBOOT_EXTLINUX_SYMLINK} ${DEPLOYDIR}/${UBOOT_EXTLINUX_CONF_NAME}-${MACHINE}
347 ln -sf ${UBOOT_EXTLINUX_SYMLINK} ${DEPLOYDIR}/${UBOOT_EXTLINUX_CONF_NAME}
348 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500349}
350
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500351addtask deploy before do_build after do_compile