summaryrefslogtreecommitdiffstats
path: root/meta/classes/kernel-uimage.bbclass
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2015-05-14 14:31:09 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-05-26 10:57:51 +0100
commit7f131b88631223df342148e54811a2b125b73819 (patch)
tree4c74f566762727e29282ae8048b4aa9aeff97ceb /meta/classes/kernel-uimage.bbclass
parent12f983b66ac00525745d7ad0fb11cba77c431fad (diff)
downloadpoky-7f131b88631223df342148e54811a2b125b73819.tar.gz
kernel: Pull uImage generation into separate class
Pull the uImage image format generation from kernel.bbclass into a separate kernel-uimage.bbclass. Introduce new KERNEL_CLASSES variable, which allows registration of additional classes which implement new kernel image types. The default value of is to register kernel-uimage to preserve the original behavior. (From OE-Core rev: 086536ac84fcc9350802c09166f600becd52a1f8) Signed-off-by: Marek Vasut <marex@denx.de> Cc: Richard Purdie <richard.purdie@linuxfoundation.org> Cc: Koen Kooi <koen@dominion.thruhere.net> Cc: Paul Eggleton <paul.eggleton@linux.intel.com> Cc: Ross Burton <ross.burton@intel.com> Cc: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/kernel-uimage.bbclass')
-rw-r--r--meta/classes/kernel-uimage.bbclass48
1 files changed, 48 insertions, 0 deletions
diff --git a/meta/classes/kernel-uimage.bbclass b/meta/classes/kernel-uimage.bbclass
new file mode 100644
index 0000000000..8a3efc6835
--- /dev/null
+++ b/meta/classes/kernel-uimage.bbclass
@@ -0,0 +1,48 @@
1python __anonymous () {
2 kerneltype = d.getVar('KERNEL_IMAGETYPE', True)
3 if kerneltype == 'uImage':
4 depends = d.getVar("DEPENDS", True)
5 depends = "%s u-boot-mkimage-native" % depends
6 d.setVar("DEPENDS", depends)
7}
8
9uboot_prep_kimage() {
10 if test -e arch/${ARCH}/boot/compressed/vmlinux ; then
11 vmlinux_path="arch/${ARCH}/boot/compressed/vmlinux"
12 linux_suffix=""
13 linux_comp="none"
14 else
15 vmlinux_path="vmlinux"
16 linux_suffix=".gz"
17 linux_comp="gzip"
18 fi
19
20 ${OBJCOPY} -O binary -R .note -R .comment -S "${vmlinux_path}" linux.bin
21
22 if [ "${linux_comp}" != "none" ] ; then
23 rm -f linux.bin
24 gzip -9 linux.bin
25 mv -f "linux.bin${linux_suffix}" linux.bin
26 fi
27
28 echo "${linux_comp}"
29}
30
31do_uboot_mkimage() {
32 if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then
33 if test "x${KEEPUIMAGE}" != "xyes" ; then
34 uboot_prep_kimage
35
36 ENTRYPOINT=${UBOOT_ENTRYPOINT}
37 if test -n "${UBOOT_ENTRYSYMBOL}"; then
38 ENTRYPOINT=`${HOST_PREFIX}nm ${S}/vmlinux | \
39 awk '$3=="${UBOOT_ENTRYSYMBOL}" {print $1}'`
40 fi
41
42 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
43 rm -f linux.bin
44 fi
45 fi
46}
47
48addtask uboot_mkimage before do_install after do_compile