remove duplicated code from linux.inc
PATCH 1/1 remove duplicated code from linux.inc
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
recipes/linux/linux.inc +0 -0
@@ -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}Koen Kooi
NAKNAK, this breaks the resulting kernel-image ipk
Quoted 42 lines · Graham Gower
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_ENTRYPOINTin my linux-blah.bb based upon the resultant kernel binary and this makes it easier.(quoted diff) +0
-1-Grahamrecipes/linux/linux.inc +0
-0@@ -158,22 +158,6 @@ do_configure_append() {fi
}-do_compile_append() {
- if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then - if test -earch/${ARCH}/boot/compressed/vmlinux; then
- ${OBJCOPY} -O binary -R .note -R .comment -Sarch/${ARCH}/boot/compressed/vmlinuxlinux.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.binarch/${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.gzarch/${ARCH}/boot/uImage
- rm -f linux.bin.gz
- fi
- firecipes/linux/linux.inc +0
-2-} -
do_devicetree_image(){
if test -n "${KERNEL_DEVICETREE}" ; then
dtc -I dts -O dtb ${KERNEL_DEVICETREE_FLAGS} -o devicetree ${KERNEL_DEVICETREE}
Dnia środa, 29 lipca 2009 o 09:34:05 Koen Kooi napisał(a):
Quoted 1 line
NAK, this breaks the resulting kernel-image ipk
So we have to check why this code has to be duplicated.
Regards,
Signature · 3 lines
JID: [email protected] Website: http://marcin.juszkiewicz.com.pl/ LinkedIn: http://www.linkedin.com/in/marcinjuszkiewicz
Quoted 2 lines · Koen Kooi
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
Quoted 51 lines · Graham Gower
Quoted 39 lines
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_ENTRYPOINTin my linux-blah.bb based upon the resultant kernel binary and this makes it easier.(quoted diff) +0
-1-Grahamrecipes/linux/linux.inc +0
-0@@ -158,22 +158,6 @@ do_configure_append() {fi
}-do_compile_append() {
- if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then - if test -earch/${ARCH}/boot/compressed/vmlinux; then
- ${OBJCOPY} -O binary -R .note -R .comment -Sarch/${ARCH}/boot/compressed/vmlinuxlinux.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.binarch/${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.gzarch/${ARCH}/boot/uImage
- rm -f linux.bin.gz
- fi
- firecipes/linux/linux.inc +0
-2-} -Quoted 4 lines
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
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
Dnia środa, 29 lipca 2009 o 10:38:12 Graeme Gregory napisał(a):
Quoted 7 lines
Quoted 1 line · Koen Kooi
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_deployis 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,
Signature · 3 lines
JID: [email protected] Website: http://marcin.juszkiewicz.com.pl/ LinkedIn: http://www.linkedin.com/in/marcinjuszkiewicz
2009/7/29 Marcin Juszkiewicz <[email protected]>:
Quoted 9 lines
Dnia środa, 29 lipca 2009 o 10:38:12 Graeme Gregory napisał(a):
Quoted 7 lines
Quoted 1 line · Koen Kooi
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_deployis just totally wrong.
Quoted 5 lines
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
On Thu, Jul 30, 2009 at 02:41:30PM +0930, Graham Gower wrote:
[snip]
Quoted 11 lines
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 setUBOOT_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.
Signature · 1 line
Tom Rini
2009/7/30 Tom Rini <[email protected]>:
Quoted 1 line
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.
Quoted 11 lines · Graham Gower
2009/7/30 Tom Rini <[email protected]>:
Quoted 2 lines
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
Quoted 1 line · Graeme Gregory
Why dont you prepend it to the current uImage creation code running only conditionally on
UBOOT_ENTRYSYMBOLbeing set? As its in the same bit of shell code your resetting ofUBOOT_ENTRYPOINTwill 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
classes/kernel.bbclass +0 -0
@@ -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}.binrecipes/linux/linux.inc +0 -0
@@ -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
Quoted 9 lines · Graham Gower
Quoted 1 line · Graeme Gregory
Why dont you prepend it to the current uImage creation code running only conditionally on
UBOOT_ENTRYSYMBOLbeing set? As its in the same bit of shell code your resetting ofUBOOT_ENTRYPOINTwill 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_ENTRYSYMBOLand 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
Quoted 1 line · Graeme Gregory
Looks good to me, do you fancy moving that
do_compile_appendinto kernel.bbclass? You can then have the added kudos of fixing OE core files :-)
Kudos sound tasty.
-Graham
classes/kernel.bbclass +0 -0
@@ -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}.binrecipes/linux/linux.inc +0 -0
@@ -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}Graeme Gregory
Acked-byQuoted 5 lines · Graham Gower
Quoted 1 line · Graeme Gregory
Looks good to me, do you fancy moving that
do_compile_appendinto 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.
Koen Kooi
Acked-byQuoted 6 lines · Graham Gower
Quoted 3 lines · Graeme Gregory
Looks good to me, do you fancy moving that
do_compile_appendinto kernel.bbclass? You can then have the added kudos of fixing OE core files :-)Kudos sound tasty.
Quoted 5 lines · Graham Gower
Quoted 1 line · Graeme Gregory
Looks good to me, do you fancy moving that
do_compile_appendinto 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
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
Dnia piątek, 31 lipca 2009 o 14:35:19 Graham Gower napisał(a):
Quoted 3 lines
And for those playing at home, the value to assign to
UBOOT_ENTRYSYMfor a given arch can be found by greppinglinux/arch/${ARCH}/kernel/vmlinux.lds.Sfor '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 stextc0008000 T _stextc0008000 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 stextc0008000 T _stextc02bcba0 t snstextc0008000 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 stextc0008000 T _stextc0008000 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,
Signature · 3 lines
JID: [email protected] Website: http://marcin.juszkiewicz.com.pl/ LinkedIn: http://www.linkedin.com/in/marcinjuszkiewicz
2009/7/31 Marcin Juszkiewicz <[email protected]>:
Quoted 2 lines
Dnia piątek, 31 lipca 2009 o 14:35:19 Graham Gower napisał(a):
Quoted 1 line
And for those playing at home, the value to assign to
UBOOT_ENTRYSYM
Of course, that should have read UBOOT_ENTRYSYMBOL.
Quoted 26 lines
Quoted 2 lines
for a given arch can be found by grepping
linux/arch/${ARCH}/kernel/vmlinux.lds.Sfor '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.SENTRY(stext)For AT91SAM9263-EK we get:
15:10 hrw@home:linux-2.6.30$ arm-angstrom-linux-gnueabi-nm vmlinux|grep stext
c0008000T_stextc0008000T stextBut 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
Quoted 1 line
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
Dnia sobota, 1 sierpnia 2009 o 11:45:12 Graham Gower napisał(a):
Quoted 20 lines
2009/7/31 Marcin Juszkiewicz <[email protected]>:
Quoted 18 lines
For AT91SAM9263-EK we get:
15:10 hrw@home:linux-2.6.30$ arm-angstrom-linux-gnueabi-nm vmlinux|grep stext
c0008000T_stextc0008000T stextBut 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 MBLoad Address: 20008000
Entry Point: 20008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
Quoted 8 lines
Quoted 1 line
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
c0008000boot 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,
Signature · 3 lines
JID: [email protected] Website: http://marcin.juszkiewicz.com.pl/ LinkedIn: http://www.linkedin.com/in/marcinjuszkiewicz
Quoted 9 lines · Graeme Gregory
Quoted 7 lines · Graham Gower
Quoted 3 lines · Graeme Gregory
Looks good to me, do you fancy moving that
do_compile_appendinto 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
Quoted 3 lines
Quoted 1 line
Graeme Gregory wrote:
Looks good to me, do you fancy moving that
do_compile_appendinto 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
2009/7/31 Andrea Adami <[email protected]>:
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Graeme Gregory wrote:
Looks good to me, do you fancy moving that
do_compile_appendinto kernel.bbclass? You can then have the added kudos of fixing OE core filesGraeme, do you remember "[oe] [PATCH] Automate uboot entry/load addresses detection" [*] from Ihar (booxter) ? Perhaps Graham could try it.
Quoted 8 lines
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
0xc08f0000Multiple 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