blob: 2a187f549296b1499589fdc0a86a0acdd3b1e7d1 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001inherit kernel-uboot
2
3python __anonymous () {
He Zhefe76b1e2016-05-25 04:47:16 -04004 if "uImage" in (d.getVar('KERNEL_IMAGETYPES', True) or "").split():
Patrick Williamsc124f4f2015-09-15 14:41:29 -05005 depends = d.getVar("DEPENDS", True)
6 depends = "%s u-boot-mkimage-native" % depends
7 d.setVar("DEPENDS", depends)
8
He Zhefe76b1e2016-05-25 04:47:16 -04009 # Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal
10 # to kernel.bbclass . We override the variable here, since we need
11 # to build uImage using the kernel build system if and only if
12 # KEEPUIMAGE == yes. Otherwise, we pack compressed vmlinux into
13 # the uImage .
14 if d.getVar("KEEPUIMAGE", True) != 'yes':
15 typeformake = d.getVar("KERNEL_IMAGETYPE_FOR_MAKE", True) or ""
16 if "uImage" in typeformake.split():
17 typeformake.replace('uImage', 'vmlinux')
18 d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake)
Patrick Williamsc124f4f2015-09-15 14:41:29 -050019}
20
21do_uboot_mkimage() {
He Zhefe76b1e2016-05-25 04:47:16 -040022 if echo "${KERNEL_IMAGETYPES}" | grep -wq "uImage"; then
Patrick Williamsc124f4f2015-09-15 14:41:29 -050023 if test "x${KEEPUIMAGE}" != "xyes" ; then
24 uboot_prep_kimage
25
26 ENTRYPOINT=${UBOOT_ENTRYPOINT}
27 if test -n "${UBOOT_ENTRYSYMBOL}"; then
28 ENTRYPOINT=`${HOST_PREFIX}nm ${S}/vmlinux | \
29 awk '$3=="${UBOOT_ENTRYSYMBOL}" {print $1}'`
30 fi
31
32 uboot-mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C "${linux_comp}" -a ${UBOOT_LOADADDRESS} -e $ENTRYPOINT -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin arch/${ARCH}/boot/uImage
33 rm -f linux.bin
34 fi
35 fi
36}
37
38addtask uboot_mkimage before do_install after do_compile