* Enable a recipe/package only when other dependent recipe/package is part of image.
@ 2016-04-22 11:09 Valluri, Amarnath
2016-04-25 7:03 ` Amarnath Valluri
0 siblings, 1 reply; 6+ messages in thread
From: Valluri, Amarnath @ 2016-04-22 11:09 UTC (permalink / raw)
To: yocto@yoctoproject.org
[-- Attachment #1: Type: text/plain, Size: 1665 bytes --]
Hello,
I have my own layer, that provides configuration packages for core Linux components, for example 'connman-conf' for 'connman' package.
I would like to provide a pakcagegroup-config, that should automatically select the configuration packages that are part of image configuration. Say if 'connman' is part of image then it should add 'connman-conf' to its RDEPENDS_${PN}.
For this I try to use 'oe.packagedata.pkgmap', to check if the core component exists as below:
--------------------------------------------------------------------
def check_if_enabled(comp, trueval, d):
import oe.packagedata
pkgmap = oe.packagedata.pkgmap(d)
if pkgmap is not None and pkgmap.get(comp) is not None:
return trueval
return ""
RDEPENDS_${PN} = " \
${@check_if_enabled("connman", "connman-conf", d)} \
"
-----------------------------------------------------------
This works as expected when the packagedata is available, i.e., image is build at least once first, then my layer is added to BBLAYERS and then rebuild the image.
But this fails when there is no packagedata cache available.
Can someone help me to resolve this properly.
Thanks,
Amarnath
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki
Business Identity Code: 0357606 - 4
Domiciled in Helsinki
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
[-- Attachment #2: Type: text/html, Size: 5426 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Enable a recipe/package only when other dependent recipe/package is part of image.
2016-04-22 11:09 Enable a recipe/package only when other dependent recipe/package is part of image Valluri, Amarnath
@ 2016-04-25 7:03 ` Amarnath Valluri
0 siblings, 0 replies; 6+ messages in thread
From: Amarnath Valluri @ 2016-04-25 7:03 UTC (permalink / raw)
To: yocto@yoctoproject.org
[-- Attachment #1: Type: text/plain, Size: 1841 bytes --]
On Friday 22 April 2016 02:09 PM, Valluri, Amarnath wrote:
>
> Hello,
>
> I have my own layer, that provides configuration packages for core
> Linux components, for example ‘connman-conf’ for ‘connman’ package.
>
> I would like to provide a pakcagegroup-config, that should
> automatically select the configuration packages that are part of image
> configuration. Say if ‘connman’ is part of image then it should add
> ‘connman-conf’ to its RDEPENDS_${PN}.
>
> For this I try to use ‘oe.packagedata.pkgmap’, to check if the core
> component exists as below:
>
> --------------------------------------------------------------------
>
> def check_if_enabled(comp, trueval, d):
>
> import oe.packagedata
>
> pkgmap = oe.packagedata.pkgmap(d)
>
> if pkgmap is not None and pkgmap.get(comp) is not None:
>
> return trueval
>
> return “”
>
> RDEPENDS_${PN} = “ \
>
> ${@check_if_enabled(“connman”, “connman-conf”, d)} \
>
> “
>
> -----------------------------------------------------------
>
> This works as expected when the packagedata is available, i.e., image
> is build at least once first, then my layer is added to BBLAYERS and
> then rebuild the image.
>
> But this fails when there is no packagedata cache available.
>
> Can someone help me to resolve this properly.
>
> Thanks,
>
> Amarnath
>
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki
Business Identity Code: 0357606 - 4
Domiciled in Helsinki
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
[-- Attachment #2: Type: text/html, Size: 5843 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Enable a recipe/package only when other dependent recipe/package is part of image.
@ 2016-04-25 6:46 Amarnath Valluri
2016-04-25 11:46 ` Burton, Ross
0 siblings, 1 reply; 6+ messages in thread
From: Amarnath Valluri @ 2016-04-25 6:46 UTC (permalink / raw)
To: yocto
[-- Attachment #1: Type: text/plain, Size: 1684 bytes --]
Hello,
I have my own layer, that provides configuration packages for core Linux
components, for example ‘connman-conf’ for ‘connman’ package.
I would like to provide a pakcagegroup-config, that should automatically
select the configuration packages that are part of image configuration.
Say if ‘connman’ is part of image then it should add ‘connman-conf’ to
its RDEPENDS_${PN}.
For this I tried to use ‘oe.packagedata.pkgmap’, to check if the core
component exists as below:
--------------------------------------------------------------------
def check_if_enabled(comp, trueval, d):
import oe.packagedata
pkgmap = oe.packagedata.pkgmap(d)
if pkgmap is not None and pkgmap.get(comp) is not None:
return trueval
return “”
RDEPENDS_${PN} = “ \
${@check_if_enabled(“connman”, “connman-conf”, d)} \
“
-----------------------------------------------------------
This works as expected when the packagedata is available, i.e., image is
build at least once first, then my layer is added to BBLAYERS and then
rebuild the image.
But this fails when there is no packagedata cache available.
Can someone help me to resolve this properly.
Thanks,
Amarnath
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki
Business Identity Code: 0357606 - 4
Domiciled in Helsinki
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
[-- Attachment #2: Type: text/html, Size: 3373 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Enable a recipe/package only when other dependent recipe/package is part of image.
2016-04-25 6:46 Amarnath Valluri
@ 2016-04-25 11:46 ` Burton, Ross
2016-04-25 12:04 ` Amarnath Valluri
0 siblings, 1 reply; 6+ messages in thread
From: Burton, Ross @ 2016-04-25 11:46 UTC (permalink / raw)
To: Amarnath Valluri; +Cc: yocto@yoctoproject.org
[-- Attachment #1: Type: text/plain, Size: 1221 bytes --]
On 25 April 2016 at 07:46, Amarnath Valluri <amarnath.valluri@intel.com>
wrote:
> I would like to provide a pakcagegroup-config, that should automatically
> select the configuration packages that are part of image configuration. Say
> if ‘connman’ is part of image then it should add ‘connman-conf’ to its
> RDEPENDS_${PN}.
>
>
You can't do that.
A packagegroup is just a recipe that generates packages with no contents,
just dependencies. They are built once and don't know what image they're
being "built for", or what other packages are being built. What would you
packagegroup do if it were built directly, not via dependencies from an
image?
The low-fi way to implement this would be for the layer that adds
connman-conf to also add a bbappend for connman to depend on connman-conf.
An alternative would be to have some naming pattern for conf packages
(-conf is reasonable) and invent a new image-feature called conf-packages
that uses a glob to find all complementary packages matching the *-conf
pattern. This is how dev-pkgs, dbg-pkgs, doc-pkgs etc work. I believe
this is just a matter of setting COMPLEMENTARY_GLOB[conf-pkgs] = '*-conf'
in your configuration.
Ross
[-- Attachment #2: Type: text/html, Size: 1969 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Enable a recipe/package only when other dependent recipe/package is part of image.
2016-04-25 11:46 ` Burton, Ross
@ 2016-04-25 12:04 ` Amarnath Valluri
2016-04-28 12:30 ` Amarnath Valluri
0 siblings, 1 reply; 6+ messages in thread
From: Amarnath Valluri @ 2016-04-25 12:04 UTC (permalink / raw)
To: Burton, Ross; +Cc: yocto@yoctoproject.org
[-- Attachment #1: Type: text/plain, Size: 2082 bytes --]
Thanks Ross for your suggestions.
On Monday 25 April 2016 02:46 PM, Burton, Ross wrote:
>
> On 25 April 2016 at 07:46, Amarnath Valluri
> <amarnath.valluri@intel.com <mailto:amarnath.valluri@intel.com>> wrote:
>
> I would like to provide a pakcagegroup-config, that should
> automatically select the configuration packages that are part of
> image configuration. Say if ‘connman’ is part of image then it
> should add ‘connman-conf’ to its RDEPENDS_${PN}.
>
>
> You can't do that.
>
> A packagegroup is just a recipe that generates packages with no
> contents, just dependencies. They are built once and don't know what
> image they're being "built for", or what other packages are being
> built. What would you packagegroup do if it were built directly, not
> via dependencies from an image?
Yes, i agree.
>
> The low-fi way to implement this would be for the layer that adds
> connman-conf to also add a bbappend for connman to depend on connman-conf.
I considered this initially, but the issue with .bbappend is it leads to
rebuilding of core packages when this configuration layer add to
bblayers, to (re)build image, which we would like to avoid.
>
> An alternative would be to have some naming pattern for conf packages
> (-conf is reasonable) and invent a new image-feature called
> conf-packages that uses a glob to find all complementary packages
> matching the *-conf pattern. This is how dev-pkgs, dbg-pkgs, doc-pkgs
> etc work. I believe this is just a matter of
> setting COMPLEMENTARY_GLOB[conf-pkgs] = '*-conf' in your configuration.
I will try this, thanks.
- Amarnath
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki
Business Identity Code: 0357606 - 4
Domiciled in Helsinki
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
[-- Attachment #2: Type: text/html, Size: 3923 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Enable a recipe/package only when other dependent recipe/package is part of image.
2016-04-25 12:04 ` Amarnath Valluri
@ 2016-04-28 12:30 ` Amarnath Valluri
0 siblings, 0 replies; 6+ messages in thread
From: Amarnath Valluri @ 2016-04-28 12:30 UTC (permalink / raw)
To: yocto
Hi Ross,
>
>>
>> An alternative would be to have some naming pattern for conf packages
>> (-conf is reasonable) and invent a new image-feature called
>> conf-packages that uses a glob to find all complementary packages
>> matching the *-conf pattern. This is how dev-pkgs, dbg-pkgs,
>> doc-pkgs etc work. I believe this is just a matter of
>> setting COMPLEMENTARY_GLOB[conf-pkgs] = '*-conf' in your configuration.
> I will try this, thanks.
I tried this solution:
COMPLEMENTARY_GLOB[conf-pkgs] = '*-conf'
IMAGE_FEATURES_append = " conf-pkgs"
But this did not work for me. The obvious reason(i guess) is no matching
packages build for '*-conf', though all configuration recipes provides
'<base_component>-conf' packages, but the dependency is missing to build
those packages :(.
My layer provides configuration packages for core components, such as
'connman', 'openssh', 'dropbear', etc., which needs to/can be configured
with our configuration framework. I would like to find a way to pick the
corresponding config packages based on the image configuration, for
example 'openssh-conf' or 'dropbear-conf' whichever the image is
configured to use.
Thanks,
Amarnath
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki
Business Identity Code: 0357606 - 4
Domiciled in Helsinki
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-04-28 12:28 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-22 11:09 Enable a recipe/package only when other dependent recipe/package is part of image Valluri, Amarnath
2016-04-25 7:03 ` Amarnath Valluri
-- strict thread matches above, loose matches on Subject: below --
2016-04-25 6:46 Amarnath Valluri
2016-04-25 11:46 ` Burton, Ross
2016-04-25 12:04 ` Amarnath Valluri
2016-04-28 12:30 ` Amarnath Valluri
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.