Automate uboot entry/load addresses detection.
PATCH 1/1 Automate uboot entry/load addresses detection.
Automated UBOOT_LOADADDRESS and UBOOT_ENTRYPOINT variables detection (no need to specify them for every machine and/or kernel now).
--- classes/kernel.bbclass | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
classes/kernel.bbclass +4 -4
@@ -69,10 +69,6 @@ KERNEL_LOCALVERSION ?= "" # kernels are generally machine specific PACKAGE_ARCH = "${MACHINE_ARCH}" -# U-Boot support -UBOOT_ENTRYPOINT ?= "20008000" -UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}" - kernel_do_compile() { if [ ! -z "${INITRAMFS_IMAGE}" ]; then cp "${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.cpio.gz" initramfs.cpio.gz
@@ -489,12 +485,16 @@ do_deploy() { 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_LOADADDRESS=`${OBJDUMP} -p arch/${ARCH}/boot/compressed/vmlinux | sed -n 's/LOAD.*vaddr \([^ ]*\).*/\1/p'`; \ + UBOOT_ENTRYPOINT=`${OBJDUMP} -f arch/${ARCH}/boot/compressed/vmlinux | sed -n 's/.*start address \([^ ]*\).*/\1/p'`; \ 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_LOADADDRESS=`${OBJDUMP} -p vmlinux | sed -n 's/LOAD.*vaddr \([^ ]*\).*/\1/p'`; \ + UBOOT_ENTRYPOINT=`${OBJDUMP} -f vmlinux | sed -n 's/.*start address \([^ ]*\).*/\1/p'`; \ 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
Signature · 1 line
1.5.6.3
Quoted 4 lines · Ihar Hrachyshka
Automated
UBOOT_LOADADDRESSandUBOOT_ENTRYPOINTvariables detection (no need to specify them for every machine and/or kernel now).
Looks like a nice patch! I think this should probably go it.
Graeme
Any chances for inclusion?
Quoted 45 lines · Ihar Hrachyshka
Automated
UBOOT_LOADADDRESSandUBOOT_ENTRYPOINTvariables detection (no need to specify them for every machine and/or kernel now).Signed-off-by Ihar Hrachyshka <[email protected]>--- classes/kernel.bbclass | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)classes/kernel.bbclass +4
-5@@ -69,10 +69,6 @@ KERNEL_LOCALVERSION ?= "" # kernels are generally machine specific PACKAGE_ARCH = "${MACHINE_ARCH}" -# U-Boot support -UBOOT_ENTRYPOINT ?= "20008000" -UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}" - kernel_do_compile() { if [ ! -z "${INITRAMFS_IMAGE}" ]; then cp "${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.cpio.gz" initramfs.cpio.gz@@ -489,12 +485,16 @@ do_deploy() { 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_LOADADDRESS=`${OBJDUMP} -p arch/${ARCH}/boot/compressed/vmlinux | sed -n 's/LOAD.*vaddr \([^ ]*\).*/\1/p'`; \ + UBOOT_ENTRYPOINT=`${OBJDUMP} -f arch/${ARCH}/boot/compressed/vmlinux | sed -n 's/.*start address \([^ ]*\).*/\1/p'`; \ 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_LOADADDRESS=`${OBJDUMP} -p vmlinux | sed -n 's/LOAD.*vaddr \([^ ]*\).*/\1/p'`; \ + UBOOT_ENTRYPOINT=`${OBJDUMP} -f vmlinux | sed -n 's/.*start address \([^ ]*\).*/\1/p'`; \ 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 --1.5.6.3
Quoted 1 line · Ihar Hrachyshka
Any chances for inclusion?
It looks pretty good to me, but I'd like to hear from people that tested it :)
regards,
Koen
Quoted 47 lines
Quoted 45 lines · Ihar Hrachyshka
Automated
UBOOT_LOADADDRESSandUBOOT_ENTRYPOINTvariables detection (no need to specify them for every machine and/or kernel now).Signed-off-by Ihar Hrachyshka<[email protected]>--- classes/kernel.bbclass | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)classes/kernel.bbclass +4
-5@@ -69,10 +69,6 @@ KERNEL_LOCALVERSION ?= "" # kernels are generally machine specific PACKAGE_ARCH = "${MACHINE_ARCH}" -# U-Boot support -UBOOT_ENTRYPOINT ?= "20008000" -UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}" - kernel_do_compile() { if [ ! -z "${INITRAMFS_IMAGE}" ]; then cp "${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.cpio.gz" initramfs.cpio.gz@@ -489,12 +485,16 @@ do_deploy() { 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_LOADADDRESS=`${OBJDUMP} -p arch/${ARCH}/boot/compressed/vmlinux | sed -n 's/LOAD.*vaddr \([^ ]*\).*/\1/p'`; \ + UBOOT_ENTRYPOINT=`${OBJDUMP} -f arch/${ARCH}/boot/compressed/vmlinux | sed -n 's/.*start address \([^ ]*\).*/\1/p'`; \ 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_LOADADDRESS=`${OBJDUMP} -p vmlinux | sed -n 's/LOAD.*vaddr \([^ ]*\).*/\1/p'`; \ + UBOOT_ENTRYPOINT=`${OBJDUMP} -f vmlinux | sed -n 's/.*start address \([^ ]*\).*/\1/p'`; \ 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 --1.5.6.3
Bumping the thread after a month of no activity...
Quoted 84 lines · Koen Kooi
Quoted 2 lines · Ihar Hrachyshka
Any chances for inclusion?
It looks pretty good to me, but I'd like to hear from people that tested it :)
regards,
Koen
Quoted 56 lines
Quoted 54 lines · Ihar Hrachyshka
Automated
UBOOT_LOADADDRESSandUBOOT_ENTRYPOINTvariables detection (no need to specify them for every machine and/or kernel now).Signed-off-by Ihar Hrachyshka<[email protected]>---
classes/kernel.bbclass | 8 ++++----1 files changed, 4 insertions(+), 4 deletions(-)classes/kernel.bbclass +0
-0@@ -69,10 +69,6 @@ KERNEL_LOCALVERSION ?= "" # kernels are generally machine specificPACKAGE_ARCH = "${MACHINE_ARCH}"
classes/kernel.bbclass +0
-4-# U-Boot support -UBOOT_ENTRYPOINT ?= "20008000" -UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}" -kernel_do_compile() {
if [ ! -z "${INITRAMFS_IMAGE}" ]; then
cp "${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.cpio.gz" initramfs.cpio.gzclasses/kernel.bbclass +0
-0@@ -489,12 +485,16 @@ do_deploy() {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_LOADADDRESS=${OBJDUMP} -p arch/${ARCH}/boot/compressed/vmlinux | sed -n 's/LOAD.*vaddr \([^ ]*\).*/\1/p'; \
+ UBOOT_ENTRYPOINT=${OBJDUMP} -f arch/${ARCH}/boot/compressed/vmlinux | sed -n 's/.*start address \([^ ]*\).*/\1/p'; \
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_LOADADDRESS=${OBJDUMP} -p vmlinux | sed -n 's/LOAD.*vaddr \([^ ]*\).*/\1/p'; \
+ UBOOT_ENTRYPOINT=${OBJDUMP} -f vmlinux | sed -n 's/.*start address \([^ ]*\).*/\1/p'; \
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.gzQuoted 8 lines
Quoted 8 lines
${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.bin
rm -f linux.bin.gz
fi
--
1.5.6.3_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
Hi, I've tested the patch and it seems to work.
Thanks
Andrea
PATCH 1/1 kernel.bbclass: Automate uboot entry/load addresses detection.
--- classes/kernel.bbclass | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
classes/kernel.bbclass +4 -4
@@ -69,10 +69,6 @@ KERNEL_LOCALVERSION ?= "" # kernels are generally machine specific PACKAGE_ARCH = "${MACHINE_ARCH}" -# U-Boot support -UBOOT_ENTRYPOINT ?= "20008000" -UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}" - kernel_do_compile() { unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE oe_runmake include/linux/version.h CC="${KERNEL_CC}" LD="${KERNEL_LD}"
@@ -491,12 +487,16 @@ do_deploy() { 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_LOADADDRESS=`${OBJDUMP} -p arch/${ARCH}/boot/compressed/vmlinux | sed -n 's/LOAD.*vaddr \([^ ]*\).*/\1/p'`; \ + UBOOT_ENTRYPOINT=`${OBJDUMP} -f arch/${ARCH}/boot/compressed/vmlinux | sed -n 's/.*start address \([^ ]*\).*/\1/p'`; \ 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_LOADADDRESS=`${OBJDUMP} -p vmlinux | sed -n 's/LOAD.*vaddr \([^ ]*\).*/\1/p'`; \ + UBOOT_ENTRYPOINT=`${OBJDUMP} -f vmlinux | sed -n 's/.*start address \([^ ]*\).*/\1/p'`; \ 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
Signature · 1 line
1.6.0.6
Maybe I don't get it, but why do you need to send the patch on the ML again - with your own credit stuff?
2009/3/30 Andrea Adami <[email protected]>:
Quoted 10 lines
Hi, I've tested the patch and it seems to work.
ThanksAndrea
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
Andrea Adami
NAKehm...the Author part doesn't appear..sorry.
For the rest, I replied to my own message (and here you see it correctly threaded:
http://lists.linuxtogo.org/pipermail/openembedded-devel/2009-March/thread.html).
There is a problem anyway...it works if you pre-define the two vars...otherwise these are not expanded.
uboot-mkimage -A arm -O linux -T kernel -C none -a ${UBOOT_LOADADDRESS} -e ${UBOOT_ENTRYPOINT} -n "Angstrom/2.6.26/c7x0" -d linux.bin /oe/build/tmp/angstrom /deploy/glibc/images/c7x0/uImage-2.6.26-r9-c7x0.bin
I need to check more thoroughly.
NACK
Sorry for the noise
Andrea
Andrea Adami
Acked-byuboot-mkimage -A arm -O linux -T kernel -C none -a 0x800
08000 -e 0x80008000 -n "Angstrom/2.6.26/c7x0" -d linux.bin /oe/build/tmp/angstro m/deploy/glibc/images/c7x0/uImage-2.6.26-r9-c7x0.bin
Ok, it just works after some cleanings...silly me... I'm not a core-dev but I tested it and you get my ack.
Regards
Andrea
Any chance for patch inclusion?
Quoted 17 lines · Andrea Adami
uboot-mkimage -A arm -O linux -T kernel -C none -a
0x800
08000 -e0x80008000-n "Angstrom/2.6.26/c7x0" -d linux.bin /oe/build/tmp/angstro m/deploy/glibc/images/c7x0/uImage-2.6.26-r9-c7x0.binOk, it just works after some cleanings...silly me... I'm not a core-dev but I tested it and you get my ack.
Acked-by Andrea Adami ([email protected])Regards
Andrea_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
Ihar,
the patch sounds very interesting but I had issues with the version you posted...
1) You need to ECHO out the two vars, then it 'works' -UBOOT_LOADADDRESS=`${OBJDUMP} -p ...
+echo UBOOT_LOADADDRESS=`${OBJDUMP} -p ...
2) the values don't correspond to the mkimage parameters...(tested for Zaurus+u-boot)
So, for the moment, NACK, my ack was premature
Still, I appreciate very much your efforts, unfortunately I have not yet full knowledge about that matter.
Hopefully some kernel hacker will jump in...
Regards
Andrea