Bug 10415

Summary: devtool: add: override preferred kernel when a new one is added
Product: [Yocto Project Subprojects] eSDK Reporter: Paul Eggleton <bluelightning>
Component: eSDKAssignee: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Medium+ CC: leonardo.sandoval.gonzalez
Version: unspecified   
Target Milestone: 2.5   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Bug Depends on: 11102    
Bug Blocks:    

Description Paul Eggleton 2016-10-12 01:44:16 UTC
If you use devtool add on a kernel source tree, a kernel recipe is generated based on the one in meta-skeleton. However in order to actually build that, PREFERRED_PROVIDER_virtual/kernel needs to be changed. If we're not inside the eSDK then we can just display a warning, but within the eSDK the configuration is controlled so we can just change it within the tool. Presumably we'd only want to allow having one kernel recipe in the workspace at a time though.
Comment 1 Paul Eggleton 2016-10-12 01:48:42 UTC
A further thought - we might want to implement this generically for any configured PREFERRED_PROVIDER rather than just doing it specifically for PREFERRED_PROVIDER_virtual/kernel.
Comment 2 Leonardo Sandoval Gonzalez 2017-02-23 17:45:55 UTC
bug 11102 must be completed in order to fully test this enhancement.
Comment 3 Leonardo Sandoval Gonzalez 2017-02-23 18:25:36 UTC
(In reply to comment #1)
> A further thought - we might want to implement this generically for any
> configured PREFERRED_PROVIDER rather than just doing it specifically for
> PREFERRED_PROVIDER_virtual/kernel.

Paul, at least for the kernel, this is the proposed patch

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=lsandov1/devtool-override-prefered-kernel


This is done on the add plugin.
Comment 4 Leonardo Sandoval Gonzalez 2017-06-12 16:11:15 UTC
The dependency is not complete yet, so moving it to next milestone.
Comment 5 Jose Lamego 2017-07-13 16:31:30 UTC
Paul: can you elaborate on why setting PREFERRED_PROVIDER should be done in other place rather than at the add plugin as Leo's proposal? (scripts/lib/devtool/standard.py)

So far, I manually included the missing directory mentioned in bug 11102 to be able to test Leo's patch and it allows to successfully create the recipe with devtool add and then remove it using devtool reset (solves the errors "Nothing PROVIDES 'ly2'", "ly2 was skipped: Set PREFERRED_PROVIDER_virtual/kernel to ly2 to enable it").
Comment 6 Paul Eggleton 2017-07-20 15:48:03 UTC
It's not about where it is set, it's about handling the generic PREFERRED_PROVIDER mechanism rather than doing it specifically for PREFERRED_PROVIDER_virtual/kernel. I would suggest iterating over the items in PROVIDES and then check if PREFERRED_PROVIDER for each one is set to a value that it is different to PN for the recipe we are dealing with.

BTW, the proposed patch cannot work, it sets PREFERRED_PROVIDER_virtual/kernel in a bbappend which will not take effect. In order to work this needs to be set at the configuration level.