From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 1/5] kernel.bbclass: move uImage handling to separate task
Date: Sun, 18 Dec 2011 23:47:28 +0400 [thread overview]
Message-ID: <1324237652-15618-1-git-send-email-dbaryshkov@gmail.com> (raw)
As per org.oe.dev and meta-oe's kernel.bbclass move uImage creation to
separate task from do_deploy. This way the do_install task can also
benefit from generated uImage.
The only major feature of oe-core's version (not to recreate uImage
if it exists) is retained in this patch. On the contra, as this version
was merged from meta-oe/org.oe.dev, new function has another feature:
it permits overriding the u-boot entrypoint via u-boot symbol.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
meta/classes/kernel.bbclass | 43 +++++++++++++++++++++++++++----------------
1 files changed, 27 insertions(+), 16 deletions(-)
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 3f2f75a..8832a77 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -489,6 +489,33 @@ do_sizecheck() {
addtask sizecheck before do_install after do_compile
+# Define to 1 to force kernel.bbclass to recreate uImage for you
+KERNEL_RECREATE_UIMAGE ?= "0"
+
+do_uboot_mkimage() {
+ test "x${KERNEL_IMAGETYPE}" = "xuImage" || return 0
+ test "x${KERNEL_RECREATE_UIMAGE}" = "x1" -o ! -e arch/${ARCH}/boot/uImage || return 0
+
+ ENTRYPOINT=${UBOOT_ENTRYPOINT}
+ if test -n "${UBOOT_ENTRYSYMBOL}"; then
+ ENTRYPOINT=`${HOST_PREFIX}nm ${S}/vmlinux | \
+ awk '$3=="${UBOOT_ENTRYSYMBOL}" {print $1}'`
+ fi
+ if test -e arch/${ARCH}/boot/compressed/vmlinux ; then
+ ${OBJCOPY} -O binary -R .note -R .comment -S arch/${ARCH}/boot/compressed/vmlinux linux.bin
+ 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
+ rm -f linux.bin
+ else
+ ${OBJCOPY} -O binary -R .note -R .comment -S vmlinux linux.bin
+ rm -f linux.bin.gz
+ gzip -9 linux.bin
+ 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
+ rm -f linux.bin.gz
+ fi
+}
+
+addtask uboot_mkimage before do_install after do_compile
+
KERNEL_IMAGE_BASE_NAME ?= "${KERNEL_IMAGETYPE}-${PV}-${PR}-${MACHINE}-${DATETIME}"
# Don't include the DATETIME variable in the sstate package signatures
KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
@@ -500,22 +527,6 @@ kernel_do_deploy() {
tar -cvzf ${DEPLOYDIR}/modules-${KERNEL_VERSION}-${PR}-${MACHINE}.tgz -C ${D} lib
fi
- if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then
- if test -e arch/${ARCH}/boot/uImage ; then
- cp arch/${ARCH}/boot/uImage ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin
- elif test -e arch/${ARCH}/boot/compressed/vmlinux ; then
- ${OBJCOPY} -O binary -R .note -R .comment -S arch/${ARCH}/boot/compressed/vmlinux linux.bin
- 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
- rm -f linux.bin
- else
- ${OBJCOPY} -O binary -R .note -R .comment -S vmlinux linux.bin
- rm -f linux.bin.gz
- gzip -9 linux.bin
- 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
- rm -f linux.bin.gz
- fi
- fi
-
cd ${DEPLOYDIR}
rm -f ${KERNEL_IMAGE_SYMLINK_NAME}.bin
ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${KERNEL_IMAGE_SYMLINK_NAME}.bin
--
1.7.7.3
next reply other threads:[~2011-12-18 19:56 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-18 19:47 Dmitry Eremin-Solenikov [this message]
2011-12-18 19:47 ` [PATCH 2/5] Move check that all installed files are shipped into insane.bbclass Dmitry Eremin-Solenikov
2011-12-18 23:29 ` Khem Raj
2011-12-19 0:02 ` Richard Purdie
2011-12-19 4:49 ` Khem Raj
2011-12-18 19:47 ` [PATCH 3/5] ncurses: drop compatibility symlink to remove QA warning Dmitry Eremin-Solenikov
2011-12-18 19:47 ` [PATCH 4/5] libatomics-ops: move docs to correct directory Dmitry Eremin-Solenikov
2011-12-19 12:18 ` Richard Purdie
2011-12-18 19:47 ` [PATCH 5/5] icecc.bbclass: also use icecc for kernel modules compilation Dmitry Eremin-Solenikov
2011-12-19 12:19 ` Richard Purdie
2011-12-18 20:13 ` [PATCH 1/5] kernel.bbclass: move uImage handling to separate task Koen Kooi
2011-12-18 20:27 ` Bruce Ashfield
2011-12-18 21:19 ` Koen Kooi
2011-12-19 1:39 ` Bruce Ashfield
2011-12-19 5:06 ` Khem Raj
2011-12-19 5:23 ` Bruce Ashfield
2011-12-19 9:03 ` Koen Kooi
2011-12-19 12:47 ` Dmitry Eremin-Solenikov
[not found] ` <D018C1C3-1814-4EB5-BB3D-87002117514E@dominion.thruhere.net>
2011-12-19 13:02 ` Dmitry Eremin-Solenikov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1324237652-15618-1-git-send-email-dbaryshkov@gmail.com \
--to=dbaryshkov@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox