Patchwork image_types: fix default location of kernel when generating elf images

login
register
mail settings
Submitter Tomas Frydrych
Date May 1, 2013, 8:24 p.m.
Message ID <1367439862-4658-1-git-send-email-tf+lists.yocto@r-finger.com>
Download mbox | patch
Permalink /patch/49221/
State New
Headers show

Comments

Tomas Frydrych - May 1, 2013, 8:24 p.m.
From: Tomas Frydrych <tomas@sleepfive.com>

The kernel is now located in DEPLOY_DIR_IMAGE rather than sysroot.

Signed-off-by: Tomas Frydrych <tomas@sleepfive.com>
---
 meta/classes/image_types.bbclass |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Darren Hart - May 1, 2013, 8:29 p.m.
On 05/01/2013 01:24 PM, tf+lists.yocto@r-finger.com wrote:
> From: Tomas Frydrych <tomas@sleepfive.com>
> 
> The kernel is now located in DEPLOY_DIR_IMAGE rather than sysroot.
> 
> Signed-off-by: Tomas Frydrych <tomas@sleepfive.com>
> ---
>  meta/classes/image_types.bbclass |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
> index 98d31f5..0e1ad3a 100644
> --- a/meta/classes/image_types.bbclass
> +++ b/meta/classes/image_types.bbclass
> @@ -185,7 +185,7 @@ IMAGE_CMD_cpio () {
>  	cd ${IMAGE_ROOTFS} && (find . | cpio -o -H newc >${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio)
>  }
>  
> -ELF_KERNEL ?= "${STAGING_DIR_HOST}/kernel/${KERNEL_IMAGETYPE}"
> +ELF_KERNEL ?= "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin"


Looks correct, how did this fail before? What was the symptom?


>  ELF_APPEND ?= "ramdisk_size=32768 root=/dev/ram0 rw console="
>  
>  IMAGE_CMD_elf () {
>
Tomas Frydrych - May 1, 2013, 8:51 p.m.
On 01/05/13 21:29, Darren Hart wrote:
> 
> 
> On 05/01/2013 01:24 PM, tf+lists.yocto@r-finger.com wrote:
>> From: Tomas Frydrych <tomas@sleepfive.com>
>>
>> The kernel is now located in DEPLOY_DIR_IMAGE rather than sysroot.
>>
>> Signed-off-by: Tomas Frydrych <tomas@sleepfive.com>
>> ---
>>  meta/classes/image_types.bbclass |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
>> index 98d31f5..0e1ad3a 100644
>> --- a/meta/classes/image_types.bbclass
>> +++ b/meta/classes/image_types.bbclass
>> @@ -185,7 +185,7 @@ IMAGE_CMD_cpio () {
>>  	cd ${IMAGE_ROOTFS} && (find . | cpio -o -H newc >${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio)
>>  }
>>  
>> -ELF_KERNEL ?= "${STAGING_DIR_HOST}/kernel/${KERNEL_IMAGETYPE}"
>> +ELF_KERNEL ?= "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin"
> 
> 
> Looks correct, how did this fail before? What was the symptom?

e.g.,

| Cannot open `...../tmp/sysroots/nuc/kernel/bzImage': (null)

Two bugs really, the location has changed, and it was using a kernel
that is not machine-specific. I'll make a patch with better commit
message tomorrow.

Tomas
Richard Purdie - May 3, 2013, 11:50 a.m.
On Wed, 2013-05-01 at 21:51 +0100, Tomas Frydrych wrote:
> On 01/05/13 21:29, Darren Hart wrote:
> > 
> > 
> > On 05/01/2013 01:24 PM, tf+lists.yocto@r-finger.com wrote:
> >> From: Tomas Frydrych <tomas@sleepfive.com>
> >>
> >> The kernel is now located in DEPLOY_DIR_IMAGE rather than sysroot.
> >>
> >> Signed-off-by: Tomas Frydrych <tomas@sleepfive.com>
> >> ---
> >>  meta/classes/image_types.bbclass |    2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
> >> index 98d31f5..0e1ad3a 100644
> >> --- a/meta/classes/image_types.bbclass
> >> +++ b/meta/classes/image_types.bbclass
> >> @@ -185,7 +185,7 @@ IMAGE_CMD_cpio () {
> >>  	cd ${IMAGE_ROOTFS} && (find . | cpio -o -H newc >${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio)
> >>  }
> >>  
> >> -ELF_KERNEL ?= "${STAGING_DIR_HOST}/kernel/${KERNEL_IMAGETYPE}"
> >> +ELF_KERNEL ?= "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin"
> > 
> > 
> > Looks correct, how did this fail before? What was the symptom?
> 
> e.g.,
> 
> | Cannot open `...../tmp/sysroots/nuc/kernel/bzImage': (null)
> 
> Two bugs really, the location has changed, and it was using a kernel
> that is not machine-specific. I'll make a patch with better commit
> message tomorrow.

Just for reference, STAGING_DIR_HOST is machine specific these days.

This patch also changes the dependency from do_populate_sysroot (which
is encapsulated by DEPENDS) to do_deploy (which is not). Did you account
for that?

I suspect that fixing the path might be safer than this change...

Cheers,

Richard
Tomas Frydrych - May 3, 2013, 12:09 p.m.
On 03/05/13 12:50, Richard Purdie wrote:
> On Wed, 2013-05-01 at 21:51 +0100, Tomas Frydrych wrote:
>> On 01/05/13 21:29, Darren Hart wrote:
>>>
>>>
>>> On 05/01/2013 01:24 PM, tf+lists.yocto@r-finger.com wrote:
>>>> From: Tomas Frydrych <tomas@sleepfive.com>
>>>>
>>>> The kernel is now located in DEPLOY_DIR_IMAGE rather than sysroot.
>>>>
>>>> Signed-off-by: Tomas Frydrych <tomas@sleepfive.com>
>>>> ---
>>>>  meta/classes/image_types.bbclass |    2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
>>>> index 98d31f5..0e1ad3a 100644
>>>> --- a/meta/classes/image_types.bbclass
>>>> +++ b/meta/classes/image_types.bbclass
>>>> @@ -185,7 +185,7 @@ IMAGE_CMD_cpio () {
>>>>  	cd ${IMAGE_ROOTFS} && (find . | cpio -o -H newc >${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio)
>>>>  }
>>>>  
>>>> -ELF_KERNEL ?= "${STAGING_DIR_HOST}/kernel/${KERNEL_IMAGETYPE}"
>>>> +ELF_KERNEL ?= "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin"
>>>
>>>
>>> Looks correct, how did this fail before? What was the symptom?
>>
>> e.g.,
>>
>> | Cannot open `...../tmp/sysroots/nuc/kernel/bzImage': (null)
>>
>> Two bugs really, the location has changed, and it was using a kernel
>> that is not machine-specific. I'll make a patch with better commit
>> message tomorrow.
> 
> Just for reference, STAGING_DIR_HOST is machine specific these days.
> 
> This patch also changes the dependency from do_populate_sysroot (which
> is encapsulated by DEPENDS) to do_deploy (which is not). Did you account
> for that?
> 
> I suspect that fixing the path might be safer than this change...

Right, I see it now, the bzImage is under STAGING_DIR_HOST/usr/src/kernel

I shall make another patch.

Tomas

Patch

diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index 98d31f5..0e1ad3a 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -185,7 +185,7 @@  IMAGE_CMD_cpio () {
 	cd ${IMAGE_ROOTFS} && (find . | cpio -o -H newc >${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio)
 }
 
-ELF_KERNEL ?= "${STAGING_DIR_HOST}/kernel/${KERNEL_IMAGETYPE}"
+ELF_KERNEL ?= "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin"
 ELF_APPEND ?= "ramdisk_size=32768 root=/dev/ram0 rw console="
 
 IMAGE_CMD_elf () {