Patchwork [3/5] kernel.bbclass: move uImage handling to separate task

login
register
mail settings
Submitter lumag
Date Sept. 17, 2011, 10:18 p.m.
Message ID <1316297897-698-3-git-send-email-dbaryshkov@gmail.com>
Download mbox | patch
Permalink /patch/11617/
State New, archived
Headers show

Comments

lumag - Sept. 17, 2011, 10:18 p.m.
As per org.oe.dev and meta-oe's kernel.bbclass move uImage creation to
separate task from do_deploy. The only major feature of oe-core's
version (not to recreate uImage if it exists) is retained in this patch.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 meta/classes/kernel.bbclass |   40 ++++++++++++++++++++++++----------------
 1 files changed, 24 insertions(+), 16 deletions(-)
Otavio Salvador - Sept. 17, 2011, 10:25 p.m.
This was nack'ed but I don't remember why; Richard?

On Sat, Sep 17, 2011 at 19:18, Dmitry Eremin-Solenikov
<dbaryshkov@gmail.com> wrote:
> As per org.oe.dev and meta-oe's kernel.bbclass move uImage creation to
> separate task from do_deploy. The only major feature of oe-core's
> version (not to recreate uImage if it exists) is retained in this patch.
>
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
>  meta/classes/kernel.bbclass |   40 ++++++++++++++++++++++++----------------
>  1 files changed, 24 insertions(+), 16 deletions(-)
>
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index b44e3b5..6ff4018 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -486,6 +486,30 @@ do_sizecheck() {
>
>  addtask sizecheck before do_install after do_compile
>
> +do_uboot_mkimage() {
> +    if test "x${KERNEL_IMAGETYPE}" = "xuImage" -a \
> +            ! -e arch/${ARCH}/boot/uImage ; 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}-${DATETIME}"
>  # Don't include the DATETIME variable in the sstate package signatures
>  KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
> @@ -497,22 +521,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.2.5
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
lumag - Sept. 21, 2011, 1:09 p.m.
On 09/18/2011 02:25 AM, Otavio Salvador wrote:
> This was nack'ed but I don't remember why; Richard?

This was nack'ed because that version of the patch didn't check
for existence of uImage built by kernel tree (not present in 
oe-dev/meta-oe, added in oe-core as somebody had problems with 
regenerated uImage). My version of the patch has such check, so it can 
go in probably.

>
> On Sat, Sep 17, 2011 at 19:18, Dmitry Eremin-Solenikov
> <dbaryshkov@gmail.com>  wrote:
>> As per org.oe.dev and meta-oe's kernel.bbclass move uImage creation to
>> separate task from do_deploy. The only major feature of oe-core's
>> version (not to recreate uImage if it exists) is retained in this patch.
>>
>> Signed-off-by: Dmitry Eremin-Solenikov<dbaryshkov@gmail.com>
>> ---
>>   meta/classes/kernel.bbclass |   40 ++++++++++++++++++++++++----------------
>>   1 files changed, 24 insertions(+), 16 deletions(-)
>>
>> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
>> index b44e3b5..6ff4018 100644
>> --- a/meta/classes/kernel.bbclass
>> +++ b/meta/classes/kernel.bbclass
>> @@ -486,6 +486,30 @@ do_sizecheck() {
>>
>>   addtask sizecheck before do_install after do_compile
>>
>> +do_uboot_mkimage() {
>> +    if test "x${KERNEL_IMAGETYPE}" = "xuImage" -a \
>> +            ! -e arch/${ARCH}/boot/uImage ; 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}-${DATETIME}"
>>   # Don't include the DATETIME variable in the sstate package signatures
>>   KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
>> @@ -497,22 +521,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.2.5
>>
>>
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>>
>
>
>
Bruce Ashfield - Sept. 27, 2011, 1:39 p.m.
On Sat, Sep 17, 2011 at 6:18 PM, Dmitry Eremin-Solenikov
<dbaryshkov@gmail.com> wrote:
> As per org.oe.dev and meta-oe's kernel.bbclass move uImage creation to
> separate task from do_deploy. The only major feature of oe-core's
> version (not to recreate uImage if it exists) is retained in this patch.

I'm getting around to commenting on this patch series, sorry for the
slow replies.
Things have been a bit busy.

This seems reasonable to me, but I was wondering if we could document in the
commit header why this is a good thing ? Not everyone is familiar with oe-dev
or the history behind these changes. Having to cross reference to another
repository for the high level reasoning behind a change is not really
ideal, and
tossing something into the commit that explains things a bit is minimal up
front effort.

What I mean is "sync'ing oe-core to oe-dev" isn't the reason I'd like
to see. Are
the advantages that breaking this out into a separate task that it allows finer
grained scheduling by bitbake ? flexibility to be done at different times, etc ?

But the change does seem reasonable to me, I'm just looking to capture some
of the technical advantages in the commit messages.

Cheers,

Bruce

>
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
>  meta/classes/kernel.bbclass |   40 ++++++++++++++++++++++++----------------
>  1 files changed, 24 insertions(+), 16 deletions(-)
>
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index b44e3b5..6ff4018 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -486,6 +486,30 @@ do_sizecheck() {
>
>  addtask sizecheck before do_install after do_compile
>
> +do_uboot_mkimage() {
> +    if test "x${KERNEL_IMAGETYPE}" = "xuImage" -a \
> +            ! -e arch/${ARCH}/boot/uImage ; 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}-${DATETIME}"
>  # Don't include the DATETIME variable in the sstate package signatures
>  KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
> @@ -497,22 +521,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.2.5
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>

Patch

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index b44e3b5..6ff4018 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -486,6 +486,30 @@  do_sizecheck() {
 
 addtask sizecheck before do_install after do_compile
 
+do_uboot_mkimage() {
+    if test "x${KERNEL_IMAGETYPE}" = "xuImage" -a \
+            ! -e arch/${ARCH}/boot/uImage ; 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}-${DATETIME}"
 # Don't include the DATETIME variable in the sstate package signatures
 KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
@@ -497,22 +521,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