blob: 15e949b8b4c4b06d4cfe917def7fe67cb992a3bf [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
Patrick Williams2390b1b2022-11-03 13:47:49 -05008inherit uboot-config uboot-extlinux-config uboot-sign deploy 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 Williams2390b1b2022-11-03 13:47:49 -050029do_savedefconfig() {
30 bbplain "Saving defconfig to:\n${B}/defconfig"
31 oe_runmake -C ${B} savedefconfig
32}
33do_savedefconfig[nostamp] = "1"
34addtask savedefconfig after do_configure
35
Patrick Williamsc124f4f2015-09-15 14:41:29 -050036do_compile () {
Andrew Geissler4ed12e12020-06-05 18:00:41 -050037 if [ "${@bb.utils.filter('DISTRO_FEATURES', 'ld-is-gold', d)}" ]; then
38 sed -i 's/$(CROSS_COMPILE)ld$/$(CROSS_COMPILE)ld.bfd/g' ${S}/config.mk
39 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050040
Andrew Geissler4ed12e12020-06-05 18:00:41 -050041 unset LDFLAGS
42 unset CFLAGS
43 unset CPPFLAGS
Patrick Williamsc124f4f2015-09-15 14:41:29 -050044
Andrew Geissler4ed12e12020-06-05 18:00:41 -050045 if [ ! -e ${B}/.scmversion -a ! -e ${S}/.scmversion ]
46 then
47 echo ${UBOOT_LOCALVERSION} > ${B}/.scmversion
48 echo ${UBOOT_LOCALVERSION} > ${S}/.scmversion
49 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -060050
Andrew Geisslerd25ed322020-06-27 00:28:28 -050051 if [ -n "${UBOOT_CONFIG}" -o -n "${UBOOT_DELTA_CONFIG}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -050052 then
Patrick Williamsc0f7c042017-02-23 20:41:17 -060053 unset i j k
Patrick Williamsc124f4f2015-09-15 14:41:29 -050054 for config in ${UBOOT_MACHINE}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -060055 i=$(expr $i + 1);
56 for type in ${UBOOT_CONFIG}; do
57 j=$(expr $j + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -050058 if [ $j -eq $i ]
59 then
Patrick Williamsc0f7c042017-02-23 20:41:17 -060060 oe_runmake -C ${S} O=${B}/${config} ${UBOOT_MAKE_TARGET}
61 for binary in ${UBOOT_BINARIES}; do
62 k=$(expr $k + 1);
63 if [ $k -eq $i ]; then
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050064 cp ${B}/${config}/${binary} ${B}/${config}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX}
Patrick Williamsc0f7c042017-02-23 20:41:17 -060065 fi
66 done
Andrew Geissler82c905d2020-04-13 13:39:40 -050067
68 # Generate the uboot-initial-env
Andrew Geissler4ed12e12020-06-05 18:00:41 -050069 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
70 oe_runmake -C ${S} O=${B}/${config} u-boot-initial-env
71 cp ${B}/${config}/u-boot-initial-env ${B}/${config}/u-boot-initial-env-${type}
72 fi
Andrew Geissler82c905d2020-04-13 13:39:40 -050073
Patrick Williamsc0f7c042017-02-23 20:41:17 -060074 unset k
Patrick Williamsc124f4f2015-09-15 14:41:29 -050075 fi
76 done
Andrew Geissler4ed12e12020-06-05 18:00:41 -050077 unset j
Patrick Williamsc124f4f2015-09-15 14:41:29 -050078 done
Andrew Geissler4ed12e12020-06-05 18:00:41 -050079 unset i
Patrick Williamsc124f4f2015-09-15 14:41:29 -050080 else
Patrick Williamsc0f7c042017-02-23 20:41:17 -060081 oe_runmake -C ${S} O=${B} ${UBOOT_MAKE_TARGET}
Andrew Geissler82c905d2020-04-13 13:39:40 -050082
83 # Generate the uboot-initial-env
Andrew Geissler4ed12e12020-06-05 18:00:41 -050084 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
85 oe_runmake -C ${S} O=${B} u-boot-initial-env
86 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050087 fi
Andrew Geisslereff27472021-10-29 15:35:00 -050088
89 if [ -n "${UBOOT_ENV}" ] && [ "${UBOOT_ENV_SUFFIX}" = "scr" ]
90 then
91 ${UBOOT_MKIMAGE} -C none -A ${UBOOT_ARCH} -T script -d ${WORKDIR}/${UBOOT_ENV_SRC} ${WORKDIR}/${UBOOT_ENV_BINARY}
92 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050093}
94
95do_install () {
Patrick Williamsc0f7c042017-02-23 20:41:17 -060096 if [ -n "${UBOOT_CONFIG}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -050097 then
98 for config in ${UBOOT_MACHINE}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -060099 i=$(expr $i + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500100 for type in ${UBOOT_CONFIG}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600101 j=$(expr $j + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500102 if [ $j -eq $i ]
103 then
Andrew Geisslerd159c7f2021-09-02 21:05:58 -0500104 install -D -m 644 ${B}/${config}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
105 ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type}
106 ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}
Andrew Geissler82c905d2020-04-13 13:39:40 -0500107
108 # Install the uboot-initial-env
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500109 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
110 install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR}
111 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}
112 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${type}
113 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}
114 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500115 fi
116 done
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500117 unset j
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500118 done
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500119 unset i
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500120 else
Andrew Geissler82c905d2020-04-13 13:39:40 -0500121 install -D -m 644 ${B}/${UBOOT_BINARY} ${D}/boot/${UBOOT_IMAGE}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500122 ln -sf ${UBOOT_IMAGE} ${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}/u-boot-initial-env ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR}
127 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}
128 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}
129 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500130 fi
131
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600132 if [ -n "${UBOOT_ELF}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500133 then
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600134 if [ -n "${UBOOT_CONFIG}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500135 then
136 for config in ${UBOOT_MACHINE}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600137 i=$(expr $i + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500138 for type in ${UBOOT_CONFIG}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600139 j=$(expr $j + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500140 if [ $j -eq $i ]
141 then
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600142 install -m 644 ${B}/${config}/${UBOOT_ELF} ${D}/boot/u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500143 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type}
144 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY}
145 fi
146 done
147 unset j
148 done
149 unset i
150 else
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600151 install -m 644 ${B}/${UBOOT_ELF} ${D}/boot/${UBOOT_ELF_IMAGE}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500152 ln -sf ${UBOOT_ELF_IMAGE} ${D}/boot/${UBOOT_ELF_BINARY}
153 fi
154 fi
155
156 if [ -e ${WORKDIR}/fw_env.config ] ; then
157 install -d ${D}${sysconfdir}
158 install -m 644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config
159 fi
160
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600161 if [ -n "${SPL_BINARY}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500162 then
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600163 if [ -n "${UBOOT_CONFIG}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500164 then
165 for config in ${UBOOT_MACHINE}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600166 i=$(expr $i + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500167 for type in ${UBOOT_CONFIG}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600168 j=$(expr $j + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500169 if [ $j -eq $i ]
170 then
Andrew Geisslerd159c7f2021-09-02 21:05:58 -0500171 install -m 644 ${B}/${config}/${SPL_BINARY} ${D}/boot/${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX}
172 ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${D}/boot/${SPL_BINARYFILE}-${type}
173 ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${D}/boot/${SPL_BINARYFILE}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500174 fi
175 done
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500176 unset j
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500177 done
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500178 unset i
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500179 else
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600180 install -m 644 ${B}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE}
Andrew Geisslerd159c7f2021-09-02 21:05:58 -0500181 ln -sf ${SPL_IMAGE} ${D}/boot/${SPL_BINARYFILE}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500182 fi
183 fi
184
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600185 if [ -n "${UBOOT_ENV}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500186 then
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600187 install -m 644 ${WORKDIR}/${UBOOT_ENV_BINARY} ${D}/boot/${UBOOT_ENV_IMAGE}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500188 ln -sf ${UBOOT_ENV_IMAGE} ${D}/boot/${UBOOT_ENV_BINARY}
189 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600190
191 if [ "${UBOOT_EXTLINUX}" = "1" ]
192 then
193 install -Dm 0644 ${UBOOT_EXTLINUX_CONFIG} ${D}/${UBOOT_EXTLINUX_INSTALL_DIR}/${UBOOT_EXTLINUX_CONF_NAME}
194 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500195}
196
Patrick Williams0ca19cc2021-08-16 14:03:13 -0500197PACKAGE_BEFORE_PN += "${PN}-env ${PN}-extlinux"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500198
Patrick Williams213cb262021-08-07 19:21:33 -0500199RPROVIDES:${PN}-env += "u-boot-default-env"
200ALLOW_EMPTY:${PN}-env = "1"
201FILES:${PN}-env = " \
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500202 ${@ '${sysconfdir}/${UBOOT_INITIAL_ENV}*' if d.getVar('UBOOT_INITIAL_ENV') else ''} \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500203 ${sysconfdir}/fw_env.config \
204"
205
Patrick Williams0ca19cc2021-08-16 14:03:13 -0500206FILES:${PN}-extlinux = "${UBOOT_EXTLINUX_INSTALL_DIR}/${UBOOT_EXTLINUX_CONF_NAME}"
207RDEPENDS:${PN} += "${@bb.utils.contains('UBOOT_EXTLINUX', '1', '${PN}-extlinux', '', d)}"
208
Patrick Williams213cb262021-08-07 19:21:33 -0500209FILES:${PN} = "/boot ${datadir}"
210RDEPENDS:${PN} += "${PN}-env"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500211
212do_deploy () {
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600213 if [ -n "${UBOOT_CONFIG}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500214 then
215 for config in ${UBOOT_MACHINE}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600216 i=$(expr $i + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500217 for type in ${UBOOT_CONFIG}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600218 j=$(expr $j + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500219 if [ $j -eq $i ]
220 then
Andrew Geisslerd159c7f2021-09-02 21:05:58 -0500221 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 -0500222 cd ${DEPLOYDIR}
Andrew Geisslerd159c7f2021-09-02 21:05:58 -0500223 ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}-${type}
224 ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}
225 ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY}-${type}
226 ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY}
Andrew Geissler82c905d2020-04-13 13:39:40 -0500227
228 # Deploy the uboot-initial-env
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500229 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
230 install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${DEPLOYDIR}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR}
231 cd ${DEPLOYDIR}
232 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}
233 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${UBOOT_INITIAL_ENV}-${type}
234 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600235 fi
236 done
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500237 unset j
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500238 done
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500239 unset i
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500240 else
Andrew Geissler82c905d2020-04-13 13:39:40 -0500241 install -D -m 644 ${B}/${UBOOT_BINARY} ${DEPLOYDIR}/${UBOOT_IMAGE}
242
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500243 cd ${DEPLOYDIR}
244 rm -f ${UBOOT_BINARY} ${UBOOT_SYMLINK}
245 ln -sf ${UBOOT_IMAGE} ${UBOOT_SYMLINK}
246 ln -sf ${UBOOT_IMAGE} ${UBOOT_BINARY}
Andrew Geissler82c905d2020-04-13 13:39:40 -0500247
248 # Deploy the uboot-initial-env
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500249 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
250 install -D -m 644 ${B}/u-boot-initial-env ${DEPLOYDIR}/${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR}
251 cd ${DEPLOYDIR}
252 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${UBOOT_INITIAL_ENV}-${MACHINE}
253 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${UBOOT_INITIAL_ENV}
254 fi
Andrew Geissler82c905d2020-04-13 13:39:40 -0500255 fi
256
257 if [ -e ${WORKDIR}/fw_env.config ] ; then
258 install -D -m 644 ${WORKDIR}/fw_env.config ${DEPLOYDIR}/fw_env.config-${MACHINE}-${PV}-${PR}
259 cd ${DEPLOYDIR}
260 ln -sf fw_env.config-${MACHINE}-${PV}-${PR} fw_env.config-${MACHINE}
261 ln -sf fw_env.config-${MACHINE}-${PV}-${PR} fw_env.config
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800262 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500263
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600264 if [ -n "${UBOOT_ELF}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500265 then
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600266 if [ -n "${UBOOT_CONFIG}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500267 then
268 for config in ${UBOOT_MACHINE}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600269 i=$(expr $i + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500270 for type in ${UBOOT_CONFIG}; do
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600271 j=$(expr $j + 1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500272 if [ $j -eq $i ]
273 then
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600274 install -m 644 ${B}/${config}/${UBOOT_ELF} ${DEPLOYDIR}/u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500275 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}-${type}
276 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}
277 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}-${type}
278 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}
279 fi
280 done
281 unset j
282 done
283 unset i
284 else
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600285 install -m 644 ${B}/${UBOOT_ELF} ${DEPLOYDIR}/${UBOOT_ELF_IMAGE}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500286 ln -sf ${UBOOT_ELF_IMAGE} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}
287 ln -sf ${UBOOT_ELF_IMAGE} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}
288 fi
289 fi
290
291
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600292 if [ -n "${SPL_BINARY}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500293 then
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800294 if [ -n "${UBOOT_CONFIG}" ]
295 then
296 for config in ${UBOOT_MACHINE}; do
297 i=$(expr $i + 1);
298 for type in ${UBOOT_CONFIG}; do
299 j=$(expr $j + 1);
300 if [ $j -eq $i ]
301 then
Andrew Geisslerd159c7f2021-09-02 21:05:58 -0500302 install -m 644 ${B}/${config}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX}
303 rm -f ${DEPLOYDIR}/${SPL_BINARYFILE} ${DEPLOYDIR}/${SPL_SYMLINK}
304 ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_BINARYFILE}-${type}
305 ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_BINARYFILE}
306 ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_SYMLINK}-${type}
307 ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_SYMLINK}
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800308 fi
309 done
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500310 unset j
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800311 done
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500312 unset i
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800313 else
314 install -m 644 ${B}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE}
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800315 ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_BINARYNAME}
316 ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_SYMLINK}
317 fi
318 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500319
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600320 if [ -n "${UBOOT_ENV}" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500321 then
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600322 install -m 644 ${WORKDIR}/${UBOOT_ENV_BINARY} ${DEPLOYDIR}/${UBOOT_ENV_IMAGE}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500323 ln -sf ${UBOOT_ENV_IMAGE} ${DEPLOYDIR}/${UBOOT_ENV_BINARY}
324 ln -sf ${UBOOT_ENV_IMAGE} ${DEPLOYDIR}/${UBOOT_ENV_SYMLINK}
325 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600326
327 if [ "${UBOOT_EXTLINUX}" = "1" ]
328 then
329 install -m 644 ${UBOOT_EXTLINUX_CONFIG} ${DEPLOYDIR}/${UBOOT_EXTLINUX_SYMLINK}
330 ln -sf ${UBOOT_EXTLINUX_SYMLINK} ${DEPLOYDIR}/${UBOOT_EXTLINUX_CONF_NAME}-${MACHINE}
331 ln -sf ${UBOOT_EXTLINUX_SYMLINK} ${DEPLOYDIR}/${UBOOT_EXTLINUX_CONF_NAME}
332 fi
Andrew Geissler09036742021-06-25 14:25:14 -0500333
334 if [ -n "${UBOOT_DTB}" ]
335 then
336 install -m 644 ${B}/arch/${UBOOT_ARCH}/dts/${UBOOT_DTB_BINARY} ${DEPLOYDIR}/
337 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500338}
339
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500340addtask deploy before do_build after do_compile