[OE-core] [PATCH 5/7] kernel: Separate out uboot_prep_kimage

Marek Vasut marex at denx.de
Sun Oct 19 19:15:45 UTC 2014


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 at denx.de>
Cc: Richard Purdie <richard.purdie at linuxfoundation.org>
Cc: Koen Kooi <koen at dominion.thruhere.net>
Cc: Paul Eggleton <paul.eggleton at linux.intel.com>
---
 meta/classes/kernel-uboot.bbclass  | 25 +++++++++++++++++++++++++
 meta/classes/kernel-uimage.bbclass | 26 +-------------------------
 2 files changed, 26 insertions(+), 25 deletions(-)
 create mode 100644 meta/classes/kernel-uboot.bbclass

diff --git a/meta/classes/kernel-uboot.bbclass b/meta/classes/kernel-uboot.bbclass
new file mode 100644
index 0000000..57bb950
--- /dev/null
+++ b/meta/classes/kernel-uboot.bbclass
@@ -0,0 +1,25 @@
+inherit kernel
+
+DEPENDS += " u-boot-mkimage-native "
+
+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}"
+}
diff --git a/meta/classes/kernel-uimage.bbclass b/meta/classes/kernel-uimage.bbclass
index f51321b..1ea0400 100644
--- a/meta/classes/kernel-uimage.bbclass
+++ b/meta/classes/kernel-uimage.bbclass
@@ -1,28 +1,4 @@
-inherit kernel
-
-DEPENDS += " u-boot-mkimage-native "
-
-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}"
-}
+inherit kernel-uboot
 
 do_uboot_mkimage() {
 	if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then
-- 
2.1.1




More information about the Openembedded-core mailing list