All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] remove duplicated code from linux.inc
@ 2009-07-29  4:30 Graham Gower
  2009-07-29  7:34 ` Koen Kooi
  0 siblings, 1 reply; 22+ messages in thread
From: Graham Gower @ 2009-07-29  4:30 UTC (permalink / raw)
  To: openembedded-devel

Hello,

The contents of the do_compile_append() function below can also be found in 
kernel.bbclass: do_deploy().

I've removed it from linux.inc because I want to dynamically set
UBOOT_ENTRYPOINT in my linux-blah.bb based upon the resultant kernel binary
and this makes it easier.

-Graham

diff --git a/recipes/linux/linux.inc b/recipes/linux/linux.inc
index 96feba6..3dbb1ec 100644
--- a/recipes/linux/linux.inc
+++ b/recipes/linux/linux.inc
@@ -158,22 +158,6 @@ do_configure_append() {
 	fi
 }
 
-do_compile_append() {
-    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
-            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
-            rm -f linux.bin.gz
-        fi
-    fi
-}
-
 do_devicetree_image() {
     if test -n "${KERNEL_DEVICETREE}" ; then
         dtc -I dts -O dtb ${KERNEL_DEVICETREE_FLAGS} -o devicetree ${KERNEL_DEVICETREE}



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH] remove duplicated code from linux.inc
  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
  0 siblings, 2 replies; 22+ messages in thread
From: Koen Kooi @ 2009-07-29  7:34 UTC (permalink / raw)
  To: openembedded-devel

NAK, this breaks the resulting kernel-image ipk

On 29-07-09 06:30, Graham Gower wrote:

> The contents of the do_compile_append() function below can also be found
> in kernel.bbclass: do_deploy().
>
> I've removed it from linux.inc because I want to dynamically set
> UBOOT_ENTRYPOINT in my linux-blah.bb based upon the resultant kernel binary
> and this makes it easier.
>
> -Graham
>
> diff --git a/recipes/linux/linux.inc b/recipes/linux/linux.inc
> index 96feba6..3dbb1ec 100644
> --- a/recipes/linux/linux.inc
> +++ b/recipes/linux/linux.inc
> @@ -158,22 +158,6 @@ do_configure_append() {
> fi
> }
>
> -do_compile_append() {
> - 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
> - 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
> - rm -f linux.bin.gz
> - fi
> - fi
> -}
> -
> do_devicetree_image() {
> if test -n "${KERNEL_DEVICETREE}" ; then
> dtc -I dts -O dtb ${KERNEL_DEVICETREE_FLAGS} -o devicetree
> ${KERNEL_DEVICETREE}





^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] remove duplicated code from linux.inc
  2009-07-29  7:34 ` Koen Kooi
@ 2009-07-29  8:36   ` Marcin Juszkiewicz
  2009-07-29  8:38   ` Graeme Gregory
  1 sibling, 0 replies; 22+ messages in thread
From: Marcin Juszkiewicz @ 2009-07-29  8:36 UTC (permalink / raw)
  To: openembedded-devel

Dnia środa, 29 lipca 2009 o 09:34:05 Koen Kooi napisał(a):
> NAK, this breaks the resulting kernel-image ipk

So we have to check why this code has to be duplicated.

Regards, 
-- 
JID:      hrw@jabber.org
Website:  http://marcin.juszkiewicz.com.pl/
LinkedIn: http://www.linkedin.com/in/marcinjuszkiewicz





^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] remove duplicated code from linux.inc
  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
  1 sibling, 1 reply; 22+ messages in thread
From: Graeme Gregory @ 2009-07-29  8:38 UTC (permalink / raw)
  To: openembedded-devel

Koen Kooi wrote:
> NAK, this breaks the resulting kernel-image ipk
>
Double NAK, read the git log, I put this there to specifically make 
stuff work, I thought I had removed it from kernel.bbclass but I 
obviously forgot to push that patch. Doing it in do_deploy is just 
totally wrong.

Graeme

> On 29-07-09 06:30, Graham Gower wrote:
>
>> The contents of the do_compile_append() function below can also be found
>> in kernel.bbclass: do_deploy().
>>
>> I've removed it from linux.inc because I want to dynamically set
>> UBOOT_ENTRYPOINT in my linux-blah.bb based upon the resultant kernel 
>> binary
>> and this makes it easier.
>>
>> -Graham
>>
>> diff --git a/recipes/linux/linux.inc b/recipes/linux/linux.inc
>> index 96feba6..3dbb1ec 100644
>> --- a/recipes/linux/linux.inc
>> +++ b/recipes/linux/linux.inc
>> @@ -158,22 +158,6 @@ do_configure_append() {
>> fi
>> }
>>
>> -do_compile_append() {
>> - 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
>> - 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
>> - rm -f linux.bin.gz
>> - fi
>> - fi
>> -}
>> -
>> do_devicetree_image() {
>> if test -n "${KERNEL_DEVICETREE}" ; then
>> dtc -I dts -O dtb ${KERNEL_DEVICETREE_FLAGS} -o devicetree
>> ${KERNEL_DEVICETREE}
>
>
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel




^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] remove duplicated code from linux.inc
  2009-07-29  8:38   ` Graeme Gregory
@ 2009-07-29  9:31     ` Marcin Juszkiewicz
  2009-07-30  5:11       ` Graham Gower
  0 siblings, 1 reply; 22+ messages in thread
From: Marcin Juszkiewicz @ 2009-07-29  9:31 UTC (permalink / raw)
  To: openembedded-devel

Dnia środa, 29 lipca 2009 o 10:38:12 Graeme Gregory napisał(a):
> Koen Kooi wrote:
> > NAK, this breaks the resulting kernel-image ipk
>
> Double NAK, read the git log, I put this there to specifically make
> stuff work, I thought I had removed it from kernel.bbclass but I
> obviously forgot to push that patch. Doing it in do_deploy is just
> totally wrong.

So maybe remove it from kernel.bbclass/do_deploy and move 
linux.inc/do_compile_append to kernel.bbclass?

We need to clean linux.inc by moving stuff from it to kernel.bbclass.

Regards, 
-- 
JID:      hrw@jabber.org
Website:  http://marcin.juszkiewicz.com.pl/
LinkedIn: http://www.linkedin.com/in/marcinjuszkiewicz





^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] remove duplicated code from linux.inc
  2009-07-29  9:31     ` Marcin Juszkiewicz
@ 2009-07-30  5:11       ` Graham Gower
  2009-07-30  5:33         ` Tom Rini
  0 siblings, 1 reply; 22+ messages in thread
From: Graham Gower @ 2009-07-30  5:11 UTC (permalink / raw)
  To: openembedded-devel

2009/7/29 Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>:
> Dnia środa, 29 lipca 2009 o 10:38:12 Graeme Gregory napisał(a):
>> Koen Kooi wrote:
>> > NAK, this breaks the resulting kernel-image ipk
>>
>> Double NAK, read the git log, I put this there to specifically make
>> stuff work, I thought I had removed it from kernel.bbclass but I
>> obviously forgot to push that patch. Doing it in do_deploy is just
>> totally wrong.
>
> So maybe remove it from kernel.bbclass/do_deploy and move
> linux.inc/do_compile_append to kernel.bbclass?
>
> We need to clean linux.inc by moving stuff from it to kernel.bbclass.
>

Ok, my patch is bogus. It doesn't even let me do what I wanted.
*smacks self for not testing first*

The real issue is that my kernel entry point is not fixed. The entry
point can be found by searching for the 'kernel_entry' symbol in the
vmlinux. And unfortunately, I can't search for this at an appropriate
time to be able to set UBOOT_ENTRYPOINT.

What I would need is something like the following, post do_compile.

UBOOT_ENTRYPOINT=`${NM} ${S}/vmlinux | \
		awk '$3=="${UBOOT_ENTRYSYMBOL}" {print $1}'

Where UBOOT_ENTRYSYMBOL="kernel_entry" could be set from the ${MACHINE}.conf.


Presumably no one else's machine with a variable entry point is using
u-boot.... The uImage makefile target in my kernel tree generates a
uImage anyway. Perhaps this step could simply be skipped if the
${S}/arch/${ARCH}/uImage file already exists?

-Graham



^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] remove duplicated code from linux.inc
  2009-07-30  5:11       ` Graham Gower
@ 2009-07-30  5:33         ` Tom Rini
  2009-07-30  5:49           ` Graham Gower
  0 siblings, 1 reply; 22+ messages in thread
From: Tom Rini @ 2009-07-30  5:33 UTC (permalink / raw)
  To: openembedded-devel

On Thu, Jul 30, 2009 at 02:41:30PM +0930, Graham Gower wrote:
[snip]
> The real issue is that my kernel entry point is not fixed. The entry
> point can be found by searching for the 'kernel_entry' symbol in the
> vmlinux. And unfortunately, I can't search for this at an appropriate
> time to be able to set UBOOT_ENTRYPOINT.
> 
> What I would need is something like the following, post do_compile.
> 
> UBOOT_ENTRYPOINT=`${NM} ${S}/vmlinux | \
> 		awk '$3=="${UBOOT_ENTRYSYMBOL}" {print $1}'
> 
> Where UBOOT_ENTRYSYMBOL="kernel_entry" could be set from the ${MACHINE}.conf.

That should work.

-- 
Tom Rini



^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] remove duplicated code from linux.inc
  2009-07-30  5:33         ` Tom Rini
@ 2009-07-30  5:49           ` Graham Gower
  2009-07-30  8:59             ` Graeme Gregory
  0 siblings, 1 reply; 22+ messages in thread
From: Graham Gower @ 2009-07-30  5:49 UTC (permalink / raw)
  To: openembedded-devel

2009/7/30 Tom Rini <trini@embeddedalley.com>:
> That should work.

Could you show me how?
I have tried, but the ${UBOOT_ENTRYPOINT} used by either linux.inc or
kernel.bbclass is parsed and put into the run.do_foo file before the
symbol searching occurs.



^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] remove duplicated code from linux.inc
  2009-07-30  5:49           ` Graham Gower
@ 2009-07-30  8:59             ` Graeme Gregory
  2009-07-31  2:24               ` Graham Gower
  0 siblings, 1 reply; 22+ messages in thread
From: Graeme Gregory @ 2009-07-30  8:59 UTC (permalink / raw)
  To: openembedded-devel

Graham Gower wrote:
> 2009/7/30 Tom Rini <trini@embeddedalley.com>:
>   
>> That should work.
>>     
>
> Could you show me how?
> I have tried, but the ${UBOOT_ENTRYPOINT} used by either linux.inc or
> kernel.bbclass is parsed and put into the run.do_foo file before the
> symbol searching occurs.
>
>   
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.

Graeme




^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] remove duplicated code from linux.inc
  2009-07-30  8:59             ` Graeme Gregory
@ 2009-07-31  2:24               ` Graham Gower
  2009-07-31  7:12                 ` Graeme Gregory
  0 siblings, 1 reply; 22+ messages in thread
From: Graham Gower @ 2009-07-31  2:24 UTC (permalink / raw)
  To: openembedded-devel

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



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH] remove duplicated code from linux.inc
  2009-07-31  2:24               ` Graham Gower
@ 2009-07-31  7:12                 ` Graeme Gregory
  2009-07-31  7:40                   ` Graham Gower
  2009-07-31  7:50                   ` Andrea Adami
  0 siblings, 2 replies; 22+ messages in thread
From: Graeme Gregory @ 2009-07-31  7:12 UTC (permalink / raw)
  To: openembedded-devel

Graham Gower wrote:
> 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.
>
Looks good to me, do you fancy moving that do_compile_append into 
kernel.bbclass? You can then have the added kudos of fixing OE core 
files :-)

Graeme




^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] remove duplicated code from linux.inc
  2009-07-31  7:12                 ` Graeme Gregory
@ 2009-07-31  7:40                   ` Graham Gower
  2009-07-31  8:55                     ` Graeme Gregory
                                       ` (2 more replies)
  2009-07-31  7:50                   ` Andrea Adami
  1 sibling, 3 replies; 22+ messages in thread
From: Graham Gower @ 2009-07-31  7:40 UTC (permalink / raw)
  To: openembedded-devel

Graeme Gregory wrote:
> Looks good to me, do you fancy moving that do_compile_append into 
> kernel.bbclass? You can then have the added kudos of fixing OE core 
> files :-)

Kudos sound tasty.

-Graham

diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass
index ef16669..b498760 100644
--- a/classes/kernel.bbclass
+++ b/classes/kernel.bbclass
@@ -485,6 +485,29 @@ do_sizecheck() {
 
 addtask sizecheck before do_install after do_compile
 
+do_uboot_mkimage() {
+    if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then 
+        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
+    fi
+}
+
+addtask uboot_mkimage before do_install after do_compile
+
 KERNEL_IMAGE_BASE_NAME ?= "${KERNEL_IMAGETYPE}-${PV}-${PR}-${MACHINE}"
 KERNEL_IMAGE_SYMLINK_NAME ?= "${KERNEL_IMAGETYPE}-${MACHINE}"
 
@@ -497,21 +520,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..3dbb1ec 100644
--- a/recipes/linux/linux.inc
+++ b/recipes/linux/linux.inc
@@ -158,22 +158,6 @@ do_configure_append() {
 	fi
 }
 
-do_compile_append() {
-    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
-            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
-            rm -f linux.bin.gz
-        fi
-    fi
-}
-
 do_devicetree_image() {
     if test -n "${KERNEL_DEVICETREE}" ; then
         dtc -I dts -O dtb ${KERNEL_DEVICETREE_FLAGS} -o devicetree ${KERNEL_DEVICETREE}



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH] remove duplicated code from linux.inc
  2009-07-31  7:12                 ` Graeme Gregory
  2009-07-31  7:40                   ` Graham Gower
@ 2009-07-31  7:50                   ` Andrea Adami
  2009-07-31  9:03                     ` Graham Gower
  1 sibling, 1 reply; 22+ messages in thread
From: Andrea Adami @ 2009-07-31  7:50 UTC (permalink / raw)
  To: openembedded-devel

>> Graeme Gregory wrote:
> Looks good to me, do you fancy moving that do_compile_append into
> kernel.bbclass? You can then have the added kudos of fixing OE core files

Graeme, do you remember "[oe] [PATCH] Automate uboot entry/load
addresses detection" [*] from Ihar (booxter) ?
Perhaps Graham could try it.

I tested it but had strange results...

Regards

Andrea


[*] http://thread.gmane.org/gmane.comp.handhelds.openembedded/20843/focus=25154



^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] remove duplicated code from linux.inc
  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
  2 siblings, 0 replies; 22+ messages in thread
From: Graeme Gregory @ 2009-07-31  8:55 UTC (permalink / raw)
  To: openembedded-devel

Graham Gower wrote:
> Graeme Gregory wrote:
>> Looks good to me, do you fancy moving that do_compile_append into 
>> kernel.bbclass? You can then have the added kudos of fixing OE core 
>> files :-)
>
> Kudos sound tasty.
>
Works in my testing thanks for your work.

Acked-by: Graeme Gregory <dp@xora.org.uk>




^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] remove duplicated code from linux.inc
  2009-07-31  7:50                   ` Andrea Adami
@ 2009-07-31  9:03                     ` Graham Gower
  0 siblings, 0 replies; 22+ messages in thread
From: Graham Gower @ 2009-07-31  9:03 UTC (permalink / raw)
  To: openembedded-devel

2009/7/31 Andrea Adami <andrea.adami@gmail.com>:
>>> Graeme Gregory wrote:
>> Looks good to me, do you fancy moving that do_compile_append into
>> kernel.bbclass? You can then have the added kudos of fixing OE core files
>
> Graeme, do you remember "[oe] [PATCH] Automate uboot entry/load
> addresses detection" [*] from Ihar (booxter) ?
> Perhaps Graham could try it.
>
> I tested it but had strange results...
>
> Regards
>
> Andrea
>
>
> [*] http://thread.gmane.org/gmane.comp.handhelds.openembedded/20843/focus=25154

Well, the objdump command(s) work on the mipsel kernel that I'm
building, but on my i686 host vmlinux,

[grg@rak linux]$ objdump -p vmlinux | sed -n 's/LOAD.*vaddr \([^ ]*\).*/\1/p'
    0xc0100000
    0xc08f0000

Multiple lines beginning with 'LOAD'. I don't know whether this is
typical of other architectures also. I'll keep playing on Monday and
report back.

-Graham



^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] remove duplicated code from linux.inc
  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
  2 siblings, 0 replies; 22+ messages in thread
From: Koen Kooi @ 2009-07-31  9:59 UTC (permalink / raw)
  To: openembedded-devel

On 31-07-09 09:40, Graham Gower wrote:
> Graeme Gregory wrote:
>> Looks good to me, do you fancy moving that do_compile_append into
>> kernel.bbclass? You can then have the added kudos of fixing OE core
>> files :-)
>
> Kudos sound tasty.

Acked-by: Koen Kooi <koen@openembedded.org>




^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] remove duplicated code from linux.inc
  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 17:45                       ` Koen Kooi
  2 siblings, 2 replies; 22+ messages in thread
From: Graeme Gregory @ 2009-07-31 11:33 UTC (permalink / raw)
  To: openembedded-devel

Graham Gower wrote:
> Graeme Gregory wrote:
>> Looks good to me, do you fancy moving that do_compile_append into 
>> kernel.bbclass? You can then have the added kudos of fixing OE core 
>> files :-)
>
> Kudos sound tasty.
>
Thanks for your hard work, have now applied to OE.

Graeme




^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] remove duplicated code from linux.inc
  2009-07-31 11:33                     ` Graeme Gregory
@ 2009-07-31 12:35                       ` Graham Gower
  2009-07-31 13:24                         ` Marcin Juszkiewicz
  2009-07-31 17:45                       ` Koen Kooi
  1 sibling, 1 reply; 22+ messages in thread
From: Graham Gower @ 2009-07-31 12:35 UTC (permalink / raw)
  To: openembedded-devel

And for those playing at home, the value to assign to UBOOT_ENTRYSYM
for a given arch can be found by grepping
linux/arch/${ARCH}/kernel/vmlinux.lds.S for 'ENTRY'.

-Graham



^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] remove duplicated code from linux.inc
  2009-07-31 12:35                       ` Graham Gower
@ 2009-07-31 13:24                         ` Marcin Juszkiewicz
  2009-08-01  9:45                           ` Graham Gower
  0 siblings, 1 reply; 22+ messages in thread
From: Marcin Juszkiewicz @ 2009-07-31 13:24 UTC (permalink / raw)
  To: openembedded-devel

Dnia piątek, 31 lipca 2009 o 14:35:19 Graham Gower napisał(a):
> And for those playing at home, the value to assign to UBOOT_ENTRYSYM
> for a given arch can be found by grepping
> linux/arch/${ARCH}/kernel/vmlinux.lds.S for 'ENTRY'.

So according to your post for ARM it will be 'stext':

15:10 hrw@home:linux-2.6.30$ grep ^ENTRY arch/arm/kernel/vmlinux.lds.S
ENTRY(stext)

For AT91SAM9263-EK we get:

15:10 hrw@home:linux-2.6.30$ arm-angstrom-linux-gnueabi-nm vmlinux|grep 
stext
c0008000 T _stext
c0008000 T stext

But when I boot this device I have:

## Booting kernel from Legacy Image at 22200000 ...                                                                                                        
   Image Name:   Angstrom/2.6.30/at91sam9263ek                                                                                                             
   Image Type:   ARM Linux Kernel Image (uncompressed)                                                                                                     
   Data Size:    2074384 Bytes =  2 MB                                                                                                                     
   Load Address: 20008000                                                                                                                                  
   Entry Point:  20008000                                                                                                                                  
   Verifying Checksum ... OK                                                                                                                               
   Loading Kernel Image ... OK                                                                                                                             

So entry point is different.

For NHK15 which runs kernel 2.6.20 I got "stext" same as Entry point 
used by U-Boot:

15:12 hrw@home:linux-2.6.20$ arm-angstrom-linux-gnueabi-nm vmlinux|grep 
stext
c0008000 T _stext
c02bcba0 t snstext
c0008000 T stext

## Booting image at 00100000 ...
   Image Name:   Linux-2.6.20   
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1714260 Bytes =  1.6 MB              
   Load Address: 00008000                             
   Entry Point:  00008000                             
OK          

For BUG which runs 2.6.27.2 I got:

15:16 hrw@home:bug-linux-2.6.27.2$ arm-angstrom-linux-gnueabi-nm 
vmlinux|grep stext
c0008000 T _stext
c0008000 T stext

When U-Boot says:

## Booting kernel from Legacy Image at 80800000 ...
   Image Name:   Linux-2.6.27.2
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1722736 Bytes =  1.6 MB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

I also have avr32 NGW100 but lack kernel tree for it to check values. 
Can test will those devices boot with entry point set to 0x00080000 
address.

Regards, 
-- 
JID:      hrw@jabber.org
Website:  http://marcin.juszkiewicz.com.pl/
LinkedIn: http://www.linkedin.com/in/marcinjuszkiewicz





^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] remove duplicated code from linux.inc
  2009-07-31 11:33                     ` Graeme Gregory
  2009-07-31 12:35                       ` Graham Gower
@ 2009-07-31 17:45                       ` Koen Kooi
  1 sibling, 0 replies; 22+ messages in thread
From: Koen Kooi @ 2009-07-31 17:45 UTC (permalink / raw)
  To: openembedded-devel

On 31-07-09 13:33, Graeme Gregory wrote:
> Graham Gower wrote:
>> Graeme Gregory wrote:
>>> Looks good to me, do you fancy moving that do_compile_append into
>>> kernel.bbclass? You can then have the added kudos of fixing OE core
>>> files :-)
>>
>> Kudos sound tasty.
>>
> Thanks for your hard work, have now applied to OE.

"Oh nooooes! My build fails!" -> bitbake -c clean virtual/kernel

regards,

Koen




^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] remove duplicated code from linux.inc
  2009-07-31 13:24                         ` Marcin Juszkiewicz
@ 2009-08-01  9:45                           ` Graham Gower
  2009-08-03  6:54                             ` Marcin Juszkiewicz
  0 siblings, 1 reply; 22+ messages in thread
From: Graham Gower @ 2009-08-01  9:45 UTC (permalink / raw)
  To: openembedded-devel

2009/7/31 Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>:
> Dnia piątek, 31 lipca 2009 o 14:35:19 Graham Gower napisał(a):
>> And for those playing at home, the value to assign to UBOOT_ENTRYSYM

Of course, that should have read UBOOT_ENTRYSYMBOL.

>> for a given arch can be found by grepping
>> linux/arch/${ARCH}/kernel/vmlinux.lds.S for 'ENTRY'.
>
> So according to your post for ARM it will be 'stext':
>
> 15:10 hrw@home:linux-2.6.30$ grep ^ENTRY arch/arm/kernel/vmlinux.lds.S
> ENTRY(stext)
>
> For AT91SAM9263-EK we get:
>
> 15:10 hrw@home:linux-2.6.30$ arm-angstrom-linux-gnueabi-nm vmlinux|grep
> stext
> c0008000 T _stext
> c0008000 T stext
>
> But when I boot this device I have:
>
> ## Booting kernel from Legacy Image at 22200000 ...
>   Image Name:   Angstrom/2.6.30/at91sam9263ek
>   Image Type:   ARM Linux Kernel Image (uncompressed)
>   Data Size:    2074384 Bytes =  2 MB
>   Load Address: 20008000
>   Entry Point:  20008000
>   Verifying Checksum ... OK
>   Loading Kernel Image ... OK
>
> So entry point is different.

Yes, the linux kernel links to a virtual address. If u-boot leaves the
MMU disabled on your platform then you will need to use a physical
address. I haven't checked u-boot to see if this is common or not.

Does the resulting uImage with entry point c0008000 boot for you?

-Graham



^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] remove duplicated code from linux.inc
  2009-08-01  9:45                           ` Graham Gower
@ 2009-08-03  6:54                             ` Marcin Juszkiewicz
  0 siblings, 0 replies; 22+ messages in thread
From: Marcin Juszkiewicz @ 2009-08-03  6:54 UTC (permalink / raw)
  To: openembedded-devel

Dnia sobota, 1 sierpnia 2009 o 11:45:12 Graham Gower napisał(a):
> 2009/7/31 Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>:

> > For AT91SAM9263-EK we get:
> >
> > 15:10 hrw@home:linux-2.6.30$ arm-angstrom-linux-gnueabi-nm
> > vmlinux|grep stext
> > c0008000 T _stext
> > c0008000 T stext
> >
> > But when I boot this device I have:
> >
> > ## Booting kernel from Legacy Image at 22200000 ...
> >   Image Name:   Angstrom/2.6.30/at91sam9263ek
> >   Image Type:   ARM Linux Kernel Image (uncompressed)
> >   Data Size:    2074384 Bytes =  2 MB
> >   Load Address: 20008000
> >   Entry Point:  20008000
> >   Verifying Checksum ... OK
> >   Loading Kernel Image ... OK
> >
> > So entry point is different.
>
> Yes, the linux kernel links to a virtual address. If u-boot leaves
> the MMU disabled on your platform then you will need to use a
> physical address. I haven't checked u-boot to see if this is common
> or not.

> Does the resulting uImage with entry point c0008000 boot for you?

## Booting kernel from Legacy Image at 22200000 ...
   Image Name:   Angstrom/2.6.30/at91sam9263ek
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2074380 Bytes =  2 MB
   Load Address: 20008000
   Entry Point:  c0008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

And HANG...

Then I changed kernel.bbclass so LoadAddress == EntryPoint and that 
hangs at loading kernel (which was expected). So it looks like that 
patch is not so safe to use...

Regards, 
-- 
JID:      hrw@jabber.org
Website:  http://marcin.juszkiewicz.com.pl/
LinkedIn: http://www.linkedin.com/in/marcinjuszkiewicz





^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2009-08-03  7:09 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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.