]> code.ossystems Code Review - openembedded-core.git/commitdiff
kernel: Separate out uboot_prep_kimage
authorMarek Vasut <marex@denx.de>
Thu, 14 May 2015 12:31:10 +0000 (14:31 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 26 May 2015 09:57:41 +0000 (10:57 +0100)
Separate the function which prepares the kernel for packing into
uImage into separate class, so this function can be reused by the
fitImage class.

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>
meta/classes/kernel-uboot.bbclass [new file with mode: 0644]
meta/classes/kernel-uimage.bbclass

diff --git a/meta/classes/kernel-uboot.bbclass b/meta/classes/kernel-uboot.bbclass
new file mode 100644 (file)
index 0000000..8ab30b8
--- /dev/null
@@ -0,0 +1,21 @@
+uboot_prep_kimage() {
+       if test -e arch/${ARCH}/boot/compressed/vmlinux ; then
+               vmlinux_path="arch/${ARCH}/boot/compressed/vmlinux"
+               linux_suffix=""
+               linux_comp="none"
+       else
+               vmlinux_path="vmlinux"
+               linux_suffix=".gz"
+               linux_comp="gzip"
+       fi
+
+       ${OBJCOPY} -O binary -R .note -R .comment -S "${vmlinux_path}" linux.bin
+
+       if [ "${linux_comp}" != "none" ] ; then
+               rm -f linux.bin
+               gzip -9 linux.bin
+               mv -f "linux.bin${linux_suffix}" linux.bin
+       fi
+
+       echo "${linux_comp}"
+}
index 8a3efc683524e7aee84153a48443a4ec09ccae5f..ce8f96f65b0754a965fe8e14fd46fee0a0b35bc6 100644 (file)
@@ -1,3 +1,5 @@
+inherit kernel-uboot
+
 python __anonymous () {
     kerneltype = d.getVar('KERNEL_IMAGETYPE', True)
     if kerneltype == 'uImage':
@@ -6,28 +8,6 @@ python __anonymous () {
         d.setVar("DEPENDS", depends)
 }
 
-uboot_prep_kimage() {
-       if test -e arch/${ARCH}/boot/compressed/vmlinux ; then
-               vmlinux_path="arch/${ARCH}/boot/compressed/vmlinux"
-               linux_suffix=""
-               linux_comp="none"
-       else
-               vmlinux_path="vmlinux"
-               linux_suffix=".gz"
-               linux_comp="gzip"
-       fi
-
-       ${OBJCOPY} -O binary -R .note -R .comment -S "${vmlinux_path}" linux.bin
-
-       if [ "${linux_comp}" != "none" ] ; then
-               rm -f linux.bin
-               gzip -9 linux.bin
-               mv -f "linux.bin${linux_suffix}" linux.bin
-       fi
-
-       echo "${linux_comp}"
-}
-
 do_uboot_mkimage() {
        if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then
                if test "x${KEEPUIMAGE}" != "xyes" ; then