From: Graham Gower <graham.gower@gmail.com>
To: openembedded-devel@lists.openembedded.org
Subject: Re: [PATCH] remove duplicated code from linux.inc
Date: Fri, 31 Jul 2009 11:54:19 +0930 [thread overview]
Message-ID: <4A7255D3.9020703@gmail.com> (raw)
In-Reply-To: <4A7160F2.8030000@xora.org.uk>
Graeme Gregory wrote:
> Why dont you prepend it to the current uImage creation code running only
> conditionally on UBOOT_ENTRYSYMBOL being set? As its in the same bit of
> shell code your resetting of UBOOT_ENTRYPOINT will take precedence! Also
> means other machines can use it.
Once I realised that ${FOO} is replaced before the shell function is run,
while $FOO is not, things made a lot more sense.
Allow a dynamic entry point via UBOOT_ENTRYSYMBOL and remove redundant
uboot-mkimage code in kernel.bbclass.
-Graham
diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass
index ef16669..94c73a5 100644
--- a/classes/kernel.bbclass
+++ b/classes/kernel.bbclass
@@ -497,21 +497,6 @@ do_deploy() {
tar -cvzf ${DEPLOY_DIR_IMAGE}/modules-${PV}-${PR}-${MACHINE}.tgz -C ${D} lib
fi
- if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then
- 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 ${UBOOT_ENTRYPOINT} -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin ${DEPLOY_DIR_IMAGE}/${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 ${UBOOT_ARCH} -O linux -T kernel -C gzip -a ${UBOOT_LOADADDRESS} -e ${UBOOT_ENTRYPOINT} -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin.gz ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.bin
- rm -f linux.bin.gz
- fi
- package_stagefile_shell ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.bin
- fi
-
cd ${DEPLOY_DIR_IMAGE}
rm -f ${KERNEL_IMAGE_SYMLINK_NAME}.bin
ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${KERNEL_IMAGE_SYMLINK_NAME}.bin
diff --git a/recipes/linux/linux.inc b/recipes/linux/linux.inc
index 96feba6..02243ca 100644
--- a/recipes/linux/linux.inc
+++ b/recipes/linux/linux.inc
@@ -159,16 +159,21 @@ do_configure_append() {
}
do_compile_append() {
+ ENTRYPOINT=${UBOOT_ENTRYPOINT}
+ if test -n "${UBOOT_ENTRYSYMBOL}"; then
+ ENTRYPOINT=`${HOST_PREFIX}nm ${S}/vmlinux | \
+ awk '$3=="${UBOOT_ENTRYSYMBOL}" {print $1}'`
+ fi
if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then
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 ${UBOOT_ENTRYPOINT} -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin arch/${ARCH}/boot/uImage
+ 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 ${UBOOT_ENTRYPOINT} -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin.gz arch/${ARCH}/boot/uImage
+ 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
fi
next prev parent reply other threads:[~2009-07-31 2:39 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-29 4:30 [PATCH] remove duplicated code from linux.inc Graham Gower
2009-07-29 7:34 ` Koen Kooi
2009-07-29 8:36 ` Marcin Juszkiewicz
2009-07-29 8:38 ` Graeme Gregory
2009-07-29 9:31 ` Marcin Juszkiewicz
2009-07-30 5:11 ` Graham Gower
2009-07-30 5:33 ` Tom Rini
2009-07-30 5:49 ` Graham Gower
2009-07-30 8:59 ` Graeme Gregory
2009-07-31 2:24 ` Graham Gower [this message]
2009-07-31 7:12 ` Graeme Gregory
2009-07-31 7:40 ` Graham Gower
2009-07-31 8:55 ` Graeme Gregory
2009-07-31 9:59 ` Koen Kooi
2009-07-31 11:33 ` Graeme Gregory
2009-07-31 12:35 ` Graham Gower
2009-07-31 13:24 ` Marcin Juszkiewicz
2009-08-01 9:45 ` Graham Gower
2009-08-03 6:54 ` Marcin Juszkiewicz
2009-07-31 17:45 ` Koen Kooi
2009-07-31 7:50 ` Andrea Adami
2009-07-31 9:03 ` Graham Gower
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=4A7255D3.9020703@gmail.com \
--to=graham.gower@gmail.com \
--cc=openembedded-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.