Brad Bishop | 038c66a | 2015-10-06 00:17:30 -0400 | [diff] [blame] | 1 | # Essentially kernel-uimage, but for cuImage. |
| 2 | |
| 3 | inherit kernel-uboot |
| 4 | |
| 5 | KBUILD_HAS_CUIMAGE ?= "no" |
| 6 | |
| 7 | python __anonymous () { |
| 8 | kerneltype = d.getVar('KERNEL_IMAGETYPE', True) |
| 9 | if kerneltype == 'cuImage': |
| 10 | depends = d.getVar("DEPENDS", True) |
| 11 | depends = "%s u-boot-mkimage-native" % depends |
| 12 | d.setVar("DEPENDS", depends) |
| 13 | |
| 14 | # Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal |
| 15 | # to kernel.bbclass . We override the variable here, since we need |
| 16 | # to build cuImage using the kernel build system if and only if |
| 17 | # KBUILD_HAS_CUIMAGE == yes. Otherwise, we pack compressed vmlinux into |
| 18 | # the cuImage . |
| 19 | if d.getVar("KBUILD_HAS_CUIMAGE", True) != 'yes': |
| 20 | d.setVar("KERNEL_IMAGETYPE_FOR_MAKE", "zImage") |
| 21 | } |
| 22 | |
| 23 | do_uboot_mkcimage() { |
| 24 | dt="arch/${ARCH}/boot/dts/${KERNEL_DEVICETREE}" |
| 25 | if ! test -r $dt; then |
| 26 | dt="" |
| 27 | fi |
| 28 | |
| 29 | if test "x${KERNEL_IMAGETYPE}" = "xcuImage" ; then |
| 30 | if test "x${KBUILD_HAS_CUIMAGE}" != "xyes" ; then |
| 31 | uboot_prep_kimage |
| 32 | cat linux.bin $dt > linux-dts.bin |
| 33 | ENTRYPOINT=${UBOOT_ENTRYPOINT} |
| 34 | if test -n "${UBOOT_ENTRYSYMBOL}"; then |
| 35 | ENTRYPOINT=`${HOST_PREFIX}nm ${S}/vmlinux | \ |
| 36 | awk '$3=="${UBOOT_ENTRYSYMBOL}" {print $1}'` |
| 37 | fi |
| 38 | |
| 39 | uboot-mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C "${linux_comp}" -a ${UBOOT_LOADADDRESS} -e $ENTRYPOINT -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux-dts.bin arch/${ARCH}/boot/cuImage |
| 40 | rm -f linux.bin linux-dts.bin |
| 41 | fi |
| 42 | fi |
| 43 | } |
| 44 | |
| 45 | addtask uboot_mkcimage before do_bundle_initramfs after do_compile |