summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/kernel.bbclass41
1 files changed, 25 insertions, 16 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index e8f0f9a44f..fefa608500 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -507,28 +507,37 @@ KERNEL_IMAGE_BASE_NAME ?= "${KERNEL_IMAGETYPE}-${PV}-${PR}-${MACHINE}-${DATETIME
507KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME" 507KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
508KERNEL_IMAGE_SYMLINK_NAME ?= "${KERNEL_IMAGETYPE}-${MACHINE}" 508KERNEL_IMAGE_SYMLINK_NAME ?= "${KERNEL_IMAGETYPE}-${MACHINE}"
509 509
510do_uboot_mkimage() {
511 if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then
512 if test ! -e arch/${ARCH}/boot/uImage ; then
513 ENTRYPOINT=${UBOOT_ENTRYPOINT}
514 if test -n "${UBOOT_ENTRYSYMBOL}"; then
515 ENTRYPOINT=`${HOST_PREFIX}nm ${S}/vmlinux | \
516 awk '$3=="${UBOOT_ENTRYSYMBOL}" {print $1}'`
517 fi
518 if test -e arch/${ARCH}/boot/compressed/vmlinux ; then
519 ${OBJCOPY} -O binary -R .note -R .comment -S arch/${ARCH}/boot/compressed/vmlinux linux.bin
520 uboot-mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C none -a ${UBOOT_LOADADDRESS} -e $ENTRYPOINT -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin arch/${ARCH}/boot/uImage
521 rm -f linux.bin
522 else
523 ${OBJCOPY} -O binary -R .note -R .comment -S vmlinux linux.bin
524 rm -f linux.bin.gz
525 gzip -9 linux.bin
526 uboot-mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C gzip -a ${UBOOT_LOADADDRESS} -e $ENTRYPOINT -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin.gz arch/${ARCH}/boot/uImage
527 rm -f linux.bin.gz
528 fi
529 fi
530 fi
531}
532
533addtask uboot_mkimage before do_install after do_compile
534
510kernel_do_deploy() { 535kernel_do_deploy() {
511 install -m 0644 ${KERNEL_OUTPUT} ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin 536 install -m 0644 ${KERNEL_OUTPUT} ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin
512 if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then 537 if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
513 tar -cvzf ${DEPLOYDIR}/modules-${KERNEL_VERSION}-${PR}-${MACHINE}.tgz -C ${D} lib 538 tar -cvzf ${DEPLOYDIR}/modules-${KERNEL_VERSION}-${PR}-${MACHINE}.tgz -C ${D} lib
514 fi 539 fi
515 540
516 if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then
517 if test -e arch/${ARCH}/boot/uImage ; then
518 cp arch/${ARCH}/boot/uImage ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin
519 elif test -e arch/${ARCH}/boot/compressed/vmlinux ; then
520 ${OBJCOPY} -O binary -R .note -R .comment -S arch/${ARCH}/boot/compressed/vmlinux linux.bin
521 uboot-mkimage -A ${ARCH} -O linux -T kernel -C none -a ${UBOOT_ENTRYPOINT} -e ${UBOOT_ENTRYPOINT} -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin
522 rm -f linux.bin
523 else
524 ${OBJCOPY} -O binary -R .note -R .comment -S vmlinux linux.bin
525 rm -f linux.bin.gz
526 gzip -9 linux.bin
527 uboot-mkimage -A ${ARCH} -O linux -T kernel -C gzip -a ${UBOOT_ENTRYPOINT} -e ${UBOOT_ENTRYPOINT} -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin.gz ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin
528 rm -f linux.bin.gz
529 fi
530 fi
531
532 cd ${DEPLOYDIR} 541 cd ${DEPLOYDIR}
533 rm -f ${KERNEL_IMAGE_SYMLINK_NAME}.bin 542 rm -f ${KERNEL_IMAGE_SYMLINK_NAME}.bin
534 ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${KERNEL_IMAGE_SYMLINK_NAME}.bin 543 ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${KERNEL_IMAGE_SYMLINK_NAME}.bin