From: Ming Liu <liu.min...@gmail.com>

It allows the end users to be able to override it to set their own
customized mkimage commands instead of a fixed uboot-mkimage command
with fixed parameters.

Also splits out normalize_entrypoint to be used by other tasks.

Signed-off-by: Ming Liu <liu.min...@gmail.com>
---
 meta/classes/kernel-uimage.bbclass | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/meta/classes/kernel-uimage.bbclass 
b/meta/classes/kernel-uimage.bbclass
index a3a3d33..4826427 100644
--- a/meta/classes/kernel-uimage.bbclass
+++ b/meta/classes/kernel-uimage.bbclass
@@ -20,16 +20,31 @@ python __anonymous () {
             bb.build.addtask('do_uboot_mkimage', 'do_install', 
'do_kernel_link_images', d)
 }
 
-do_uboot_mkimage[dirs] += "${B}"
-do_uboot_mkimage() {
-       uboot_prep_kimage
+normalize_entrypoint() {
+       local entrypoint=${UBOOT_ENTRYPOINT}
+       if [ -n "${UBOOT_ENTRYSYMBOL}" ]; then
+               entrypoint=`${HOST_PREFIX}nm ${B}/vmlinux | \
+                       awk '$3=="${UBOOT_ENTRYSYMBOL}" {print "0x"$1;exit}'`
+       fi
+       echo $entrypoint
+}
 
+uboot_make_kimage() {
        ENTRYPOINT=${UBOOT_ENTRYPOINT}
        if [ -n "${UBOOT_ENTRYSYMBOL}" ]; then
                ENTRYPOINT=`${HOST_PREFIX}nm ${B}/vmlinux | \
                        awk '$3=="${UBOOT_ENTRYSYMBOL}" {print "0x"$1;exit}'`
        fi
 
-       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 ${B}/arch/${ARCH}/boot/uImage
+       uboot-mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C "${linux_comp}" -a 
${UBOOT_LOADADDRESS} \
+               -e `normalize_entrypoint` -n "${DISTRO_NAME}/${PV}/${MACHINE}" 
-d linux.bin ${B}/arch/${ARCH}/boot/uImage
+}
+
+UBOOT_MKIMAGE_COMMANDS ?= "uboot_make_kimage"
+
+do_uboot_mkimage[dirs] += "${B}"
+do_uboot_mkimage() {
+       uboot_prep_kimage
+       ${UBOOT_MKIMAGE_COMMANDS}
        rm -f linux.bin
 }
-- 
2.7.4

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to