Patchwork [1/1] image.bbclass: depends on virtual/kernel

login
register
mail settings
Submitter Qi.Chen@windriver.com
Date Nov. 22, 2013, 5:39 a.m.
Message ID <8403fc751bcf1e0b62b600ed40e00256963f357d.1385098685.git.Qi.Chen@windriver.com>
Download mbox | patch
Permalink /patch/62195/
State New
Headers show

Comments

Qi.Chen@windriver.com - Nov. 22, 2013, 5:39 a.m.
From: Chen Qi <Qi.Chen@windriver.com>

Add 'virtual/kernel' to DEPENDS in image.bbclass so that the kernel
can get built by default. Otherwise, the kernel will not get built
unless it's required by other packages like v86d. As a result, if
we build 'core-image-minimal' for qemumips, the kernel is not built,
and we have 'bitbake linux-yocto' before we can use runqemu to start
the target.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/classes/image.bbclass |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Martin Jansa - Nov. 22, 2013, 11:38 a.m.
On Fri, Nov 22, 2013 at 01:39:02PM +0800, Qi.Chen@windriver.com wrote:
> From: Chen Qi <Qi.Chen@windriver.com>
> 
> Add 'virtual/kernel' to DEPENDS in image.bbclass so that the kernel
> can get built by default. Otherwise, the kernel will not get built
> unless it's required by other packages like v86d. As a result, if
> we build 'core-image-minimal' for qemumips, the kernel is not built,
> and we have 'bitbake linux-yocto' before we can use runqemu to start
> the target.

Even when it's not really build time requirement for images I understand
the scenario above and this seems like better place than packagegroup
where it was before.

My only concern is small initramfs images like
meta-initramfs/recipes-bsp/images/initramfs-kexecboot-image.bb:inherit image

which could in turn be DEPENDS of real virtual/kernel causing circular
dependency.

> 
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>  meta/classes/image.bbclass |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index bc60f0d..ccb6bf3 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -10,7 +10,7 @@ inherit gzipnative
>  
>  LICENSE = "MIT"
>  PACKAGES = ""
> -DEPENDS += "${MLPREFIX}qemuwrapper-cross ${MLPREFIX}depmodwrapper-cross"
> +DEPENDS += "${MLPREFIX}qemuwrapper-cross ${MLPREFIX}depmodwrapper-cross virtual/kernel"
>  RDEPENDS += "${PACKAGE_INSTALL} ${LINGUAS_INSTALL}"
>  RRECOMMENDS += "${PACKAGE_INSTALL_ATTEMPTONLY}"
>  
> -- 
> 1.7.9.5
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
Phil Blundell - Nov. 22, 2013, 11:41 a.m.
On Fri, 2013-11-22 at 13:39 +0800, Qi.Chen@windriver.com wrote:
> Add 'virtual/kernel' to DEPENDS in image.bbclass so that the kernel
> can get built by default. Otherwise, the kernel will not get built
> unless it's required by other packages like v86d. As a result, if
> we build 'core-image-minimal' for qemumips, the kernel is not built,
> and we have 'bitbake linux-yocto' before we can use runqemu to start
> the target.

Not all images do actually need a kernel, and this will cause a
dependency loop for old-style initramfs images that are dependencies of
virtual/kernel itself.

If you just want to ensure that the kernel is available at deployment
time, perhaps you could make virtual/kernel be a dependency of do_deploy
specifically (rather than do_configure as you have it here).
Alternatively, if this is a specific problem for core-image-minimal,
maybe the virtual/kernel dependency should just go in there.

p.
Richard Purdie - Nov. 22, 2013, 12:06 p.m.
On Fri, 2013-11-22 at 11:41 +0000, Phil Blundell wrote:
> On Fri, 2013-11-22 at 13:39 +0800, Qi.Chen@windriver.com wrote:
> > Add 'virtual/kernel' to DEPENDS in image.bbclass so that the kernel
> > can get built by default. Otherwise, the kernel will not get built
> > unless it's required by other packages like v86d. As a result, if
> > we build 'core-image-minimal' for qemumips, the kernel is not built,
> > and we have 'bitbake linux-yocto' before we can use runqemu to start
> > the target.
> 
> Not all images do actually need a kernel, and this will cause a
> dependency loop for old-style initramfs images that are dependencies of
> virtual/kernel itself.
> 
> If you just want to ensure that the kernel is available at deployment
> time, perhaps you could make virtual/kernel be a dependency of do_deploy
> specifically (rather than do_configure as you have it here).
> Alternatively, if this is a specific problem for core-image-minimal,
> maybe the virtual/kernel dependency should just go in there.

I think it just happens that core-image-minimal doesn't install any
kernel modules so shows the symptoms.

The best thing to do here is probably have a dependency on specifically
on virtual/kernel:do_deploy since anyone building an image would usually
want to trigger that. I appreciate there are some cases where you
wouldn't but those are in a minority.

Cheers,

Richard
Otavio Salvador - Nov. 22, 2013, 7:58 p.m.
On Fri, Nov 22, 2013 at 3:39 AM,  <Qi.Chen@windriver.com> wrote:
> From: Chen Qi <Qi.Chen@windriver.com>
>
> Add 'virtual/kernel' to DEPENDS in image.bbclass so that the kernel
> can get built by default. Otherwise, the kernel will not get built
> unless it's required by other packages like v86d. As a result, if
> we build 'core-image-minimal' for qemumips, the kernel is not built,
> and we have 'bitbake linux-yocto' before we can use runqemu to start
> the target.
>
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>

If I have a board without modules there's no need to have the depends.
Why you need this?
Andrea Adami - Nov. 22, 2013, 10:32 p.m.
On Fri, Nov 22, 2013 at 8:58 PM, Otavio Salvador
<otavio@ossystems.com.br> wrote:
> On Fri, Nov 22, 2013 at 3:39 AM,  <Qi.Chen@windriver.com> wrote:
>> From: Chen Qi <Qi.Chen@windriver.com>
>>
>> Add 'virtual/kernel' to DEPENDS in image.bbclass so that the kernel
>> can get built by default. Otherwise, the kernel will not get built
>> unless it's required by other packages like v86d. As a result, if
>> we build 'core-image-minimal' for qemumips, the kernel is not built,
>> and we have 'bitbake linux-yocto' before we can use runqemu to start
>> the target.
>>
>> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
>
> If I have a board without modules there's no need to have the depends.
> Why you need this?
>

The first quenstion in my mind when I read the post:

Odd...wasn't core-image-minimal purposedly lean, mutilated and without
kernel modules ?
(Not that really 'used' it, just booted 'cause was small and could
always fit on nand/nor)

It has always been like this: if one needs the kernel and the modules
can add that in his machine.conf.
For more demanding tasks, the next logical step is core-image-base.


My 2 cents

Andrea



> --
> Otavio Salvador                             O.S. Systems
> http://www.ossystems.com.br        http://code.ossystems.com.br
> Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
Qi.Chen@windriver.com - Nov. 25, 2013, 12:09 p.m.
On 11/23/2013 06:32 AM, Andrea Adami wrote:
> On Fri, Nov 22, 2013 at 8:58 PM, Otavio Salvador
> <otavio@ossystems.com.br> wrote:
>> On Fri, Nov 22, 2013 at 3:39 AM,  <Qi.Chen@windriver.com> wrote:
>>> From: Chen Qi <Qi.Chen@windriver.com>
>>>
>>> Add 'virtual/kernel' to DEPENDS in image.bbclass so that the kernel
>>> can get built by default. Otherwise, the kernel will not get built
>>> unless it's required by other packages like v86d. As a result, if
>>> we build 'core-image-minimal' for qemumips, the kernel is not built,
>>> and we have 'bitbake linux-yocto' before we can use runqemu to start
>>> the target.
>>>
>>> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
>> If I have a board without modules there's no need to have the depends.
>> Why you need this?
>>
> The first quenstion in my mind when I read the post:
>
> Odd...wasn't core-image-minimal purposedly lean, mutilated and without
> kernel modules ?
> (Not that really 'used' it, just booted 'cause was small and could
> always fit on nand/nor)

What I want to do here is to trigger building of kernel when building 
out an image. I'm not proposing to make all images have kernel -modules 
installed.

> It has always been like this: if one needs the kernel and the modules
> can add that in his machine.conf.

Previously, the kernel is built out by default because 
packagegroup-core-boot has a dependency on it. Now the dependency is gone.

I'm not talking about installing kernel modules onto images.

Best Regards,
Chen Qi

> For more demanding tasks, the next logical step is core-image-base.
>
>
> My 2 cents
>
> Andrea
>
>
>
>> --
>> Otavio Salvador                             O.S. Systems
>> http://www.ossystems.com.br        http://code.ossystems.com.br
>> Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
Otavio Salvador - Nov. 25, 2013, 12:28 p.m.
On Mon, Nov 25, 2013 at 10:09 AM, ChenQi <Qi.Chen@windriver.com> wrote:
> On 11/23/2013 06:32 AM, Andrea Adami wrote:
>>
>> On Fri, Nov 22, 2013 at 8:58 PM, Otavio Salvador
>> <otavio@ossystems.com.br> wrote:
>>>
>>> On Fri, Nov 22, 2013 at 3:39 AM,  <Qi.Chen@windriver.com> wrote:
>>>>
>>>> From: Chen Qi <Qi.Chen@windriver.com>
>>>>
>>>> Add 'virtual/kernel' to DEPENDS in image.bbclass so that the kernel
>>>> can get built by default. Otherwise, the kernel will not get built
>>>> unless it's required by other packages like v86d. As a result, if
>>>> we build 'core-image-minimal' for qemumips, the kernel is not built,
>>>> and we have 'bitbake linux-yocto' before we can use runqemu to start
>>>> the target.
>>>>
>>>> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
>>>
>>> If I have a board without modules there's no need to have the depends.
>>> Why you need this?
>>>
>> The first quenstion in my mind when I read the post:
>>
>> Odd...wasn't core-image-minimal purposedly lean, mutilated and without
>> kernel modules ?
>> (Not that really 'used' it, just booted 'cause was small and could
>> always fit on nand/nor)
>
>
> What I want to do here is to trigger building of kernel when building out an
> image. I'm not proposing to make all images have kernel -modules installed.

Yes but you're proposing *all* images to depends on kernel. This is not a need.

>> It has always been like this: if one needs the kernel and the modules
>> can add that in his machine.conf.
>
>
> Previously, the kernel is built out by default because
> packagegroup-core-boot has a dependency on it. Now the dependency is gone.
>
> I'm not talking about installing kernel modules onto images.

and I am not keen to have all image depending on kernel build. Sorry.

Nack!
Richard Purdie - Nov. 25, 2013, 12:57 p.m.
On Mon, 2013-11-25 at 10:28 -0200, Otavio Salvador wrote:
> On Mon, Nov 25, 2013 at 10:09 AM, ChenQi <Qi.Chen@windriver.com> wrote:
> > On 11/23/2013 06:32 AM, Andrea Adami wrote:
> >>
> >> On Fri, Nov 22, 2013 at 8:58 PM, Otavio Salvador
> >> <otavio@ossystems.com.br> wrote:
> >>>
> >>> On Fri, Nov 22, 2013 at 3:39 AM,  <Qi.Chen@windriver.com> wrote:
> >>>>
> >>>> From: Chen Qi <Qi.Chen@windriver.com>
> >>>>
> >>>> Add 'virtual/kernel' to DEPENDS in image.bbclass so that the kernel
> >>>> can get built by default. Otherwise, the kernel will not get built
> >>>> unless it's required by other packages like v86d. As a result, if
> >>>> we build 'core-image-minimal' for qemumips, the kernel is not built,
> >>>> and we have 'bitbake linux-yocto' before we can use runqemu to start
> >>>> the target.
> >>>>
> >>>> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> >>>
> >>> If I have a board without modules there's no need to have the depends.
> >>> Why you need this?
> >>>
> >> The first quenstion in my mind when I read the post:
> >>
> >> Odd...wasn't core-image-minimal purposedly lean, mutilated and without
> >> kernel modules ?
> >> (Not that really 'used' it, just booted 'cause was small and could
> >> always fit on nand/nor)
> >
> >
> > What I want to do here is to trigger building of kernel when building out an
> > image. I'm not proposing to make all images have kernel -modules installed.
> 
> Yes but you're proposing *all* images to depends on kernel. This is not a need.
> 
> >> It has always been like this: if one needs the kernel and the modules
> >> can add that in his machine.conf.
> >
> >
> > Previously, the kernel is built out by default because
> > packagegroup-core-boot has a dependency on it. Now the dependency is gone.
> >
> > I'm not talking about installing kernel modules onto images.
> 
> and I am not keen to have all image depending on kernel build. Sorry.
> 
> Nack!

Right now we have a fairly serious regression where the documented use
cases in the manual don't work and people find that behaviours that used
to work no longer do. This is quite damaging.

I'd appreciate working towards a constructive resolution of the
regression, thanks.

Richard

Patch

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index bc60f0d..ccb6bf3 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -10,7 +10,7 @@  inherit gzipnative
 
 LICENSE = "MIT"
 PACKAGES = ""
-DEPENDS += "${MLPREFIX}qemuwrapper-cross ${MLPREFIX}depmodwrapper-cross"
+DEPENDS += "${MLPREFIX}qemuwrapper-cross ${MLPREFIX}depmodwrapper-cross virtual/kernel"
 RDEPENDS += "${PACKAGE_INSTALL} ${LINGUAS_INSTALL}"
 RRECOMMENDS += "${PACKAGE_INSTALL_ATTEMPTONLY}"