Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | inherit kernel-uboot |
| 2 | |
| 3 | python __anonymous () { |
| 4 | kerneltype = d.getVar('KERNEL_IMAGETYPE', True) |
| 5 | if kerneltype == 'uImage': |
| 6 | depends = d.getVar("DEPENDS", True) |
| 7 | depends = "%s u-boot-mkimage-native" % depends |
| 8 | d.setVar("DEPENDS", depends) |
| 9 | |
| 10 | # Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal |
| 11 | # to kernel.bbclass . We override the variable here, since we need |
| 12 | # to build uImage using the kernel build system if and only if |
| 13 | # KEEPUIMAGE == yes. Otherwise, we pack compressed vmlinux into |
| 14 | # the uImage . |
| 15 | if d.getVar("KEEPUIMAGE", True) != 'yes': |
| 16 | d.setVar("KERNEL_IMAGETYPE_FOR_MAKE", "zImage") |
| 17 | } |
| 18 | |
| 19 | do_uboot_mkimage() { |
| 20 | if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then |
| 21 | if test "x${KEEPUIMAGE}" != "xyes" ; then |
| 22 | uboot_prep_kimage |
| 23 | |
| 24 | ENTRYPOINT=${UBOOT_ENTRYPOINT} |
| 25 | if test -n "${UBOOT_ENTRYSYMBOL}"; then |
| 26 | ENTRYPOINT=`${HOST_PREFIX}nm ${S}/vmlinux | \ |
| 27 | awk '$3=="${UBOOT_ENTRYSYMBOL}" {print $1}'` |
| 28 | fi |
| 29 | |
| 30 | 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 |
| 31 | rm -f linux.bin |
| 32 | fi |
| 33 | fi |
| 34 | } |
| 35 | |
| 36 | addtask uboot_mkimage before do_install after do_compile |