All of lore.kernel.org
 help / color / mirror / Atom feed
* about virtual variable
@ 2020-06-22 12:48 zhouyuanqing8
  2020-06-22 13:43 ` Adrian Ambrożewicz
  0 siblings, 1 reply; 4+ messages in thread
From: zhouyuanqing8 @ 2020-06-22 12:48 UTC (permalink / raw)
  To: openbmc; +Cc: uperic@163.com

[-- Attachment #1: Type: text/plain, Size: 878 bytes --]

Hi everyone,

     I would like to ask, is virtual a variable defined by bitbake? I did not find it in the bitbake manual. What is the use of the virtual variable? What would be the problem without this variable?
2.4. Preferences¶<https://www.yoctoproject.org/docs/latest/bitbake-user-manual/bitbake-user-manual.html#bb-bitbake-preferences>

The PROVIDES list is only part of the solution for figuring out a target's recipes. Because targets might have multiple providers, BitBake needs to prioritize providers by determining provider preferences.

A common example in which a target has multiple providers is "virtual/kernel", which is on the PROVIDES list for each kernel recipe. Each machine often selects the best kernel provider by using a line similar to the following in the machine configuration file:

     PREFERRED_PROVIDER_virtual/kernel = "linux-yocto"


[-- Attachment #2: Type: text/html, Size: 2918 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: about virtual variable
  2020-06-22 12:48 about virtual variable zhouyuanqing8
@ 2020-06-22 13:43 ` Adrian Ambrożewicz
  2020-06-22 13:55   ` Adrian Ambrożewicz
  0 siblings, 1 reply; 4+ messages in thread
From: Adrian Ambrożewicz @ 2020-06-22 13:43 UTC (permalink / raw)
  To: zhouyuanqing8@outlook.com, openbmc; +Cc: uperic@163.com

I feel rude for pointing out link to StackOverflow, but this guy really 
nailed it when it comes to easy explanation of 'virtual/' variable 
namespace :)

https://stackoverflow.com/a/37823742/8226884

W dniu 6/22/2020 o 14:48, zhouyuanqing8@outlook.com pisze:
> Hi everyone,
> 
>       I would like to ask, is virtual a variable defined by bitbake? I 
> did not find it in the bitbake manual. What is the use of the virtual 
> variable? What would be the problem without this variable?
> 
> 
>     2.4. Preferences¶
>     <https://www.yoctoproject.org/docs/latest/bitbake-user-manual/bitbake-user-manual.html#bb-bitbake-preferences>
> 
> The|PROVIDES|list is only part of the solution for figuring out a 
> target's recipes. Because targets might have multiple providers, BitBake 
> needs to prioritize providers by determining provider preferences.
> 
> A common example in which a target has multiple providers is 
> "virtual/kernel", which is on the|PROVIDES|list for each kernel recipe. 
> Each machine often selects the best kernel provider by using a line 
> similar to the following in the machine configuration file:
> 
>       PREFERRED_PROVIDER_virtual/kernel = "linux-yocto"
> 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: about virtual variable
  2020-06-22 13:43 ` Adrian Ambrożewicz
@ 2020-06-22 13:55   ` Adrian Ambrożewicz
  2020-07-13  7:50     ` 回复: " 周 远清
  0 siblings, 1 reply; 4+ messages in thread
From: Adrian Ambrożewicz @ 2020-06-22 13:55 UTC (permalink / raw)
  To: zhouyuanqing8@outlook.com, openbmc; +Cc: uperic@163.com

In other words - virtual/XYZ is exported by recipes delivering the same 
stuff, conflicting with each other . In your system you have to choose 
the compiler, kernel etc. While many recipes might deliver those 
components, recipe creators use the same 'meta-name' (from 'virtual' 
namespace), so then by choosing "PREFERRED_PROVIDER" you can decide 
which of the 'implementations' you would like to actually use.

With 'virtual' variables you can use 'virtual/xyz' as a generic alias. 
You can then introduce BitBake code depending on magic 'virtual/kernel' 
instead of using concrete name of implementations (like linux-aspeed / 
linux-nuvoton / linux-yocto / linux-yocto-rt).

Regards,
Adrian

W dniu 6/22/2020 o 15:43, Adrian Ambrożewicz pisze:
> I feel rude for pointing out link to StackOverflow, but this guy really 
> nailed it when it comes to easy explanation of 'virtual/' variable 
> namespace :)
> 
> https://stackoverflow.com/a/37823742/8226884
> 
> W dniu 6/22/2020 o 14:48, zhouyuanqing8@outlook.com pisze:
>> Hi everyone,
>>
>>       I would like to ask, is virtual a variable defined by bitbake? I 
>> did not find it in the bitbake manual. What is the use of the virtual 
>> variable? What would be the problem without this variable?
>>
>>
>>     2.4. Preferences¶
>>     
>> <https://www.yoctoproject.org/docs/latest/bitbake-user-manual/bitbake-user-manual.html#bb-bitbake-preferences> 
>>
>>
>> The|PROVIDES|list is only part of the solution for figuring out a 
>> target's recipes. Because targets might have multiple providers, 
>> BitBake needs to prioritize providers by determining provider 
>> preferences.
>>
>> A common example in which a target has multiple providers is 
>> "virtual/kernel", which is on the|PROVIDES|list for each kernel 
>> recipe. Each machine often selects the best kernel provider by using a 
>> line similar to the following in the machine configuration file:
>>
>>       PREFERRED_PROVIDER_virtual/kernel = "linux-yocto"
>>
>>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* 回复: about virtual variable
  2020-06-22 13:55   ` Adrian Ambrożewicz
@ 2020-07-13  7:50     ` 周 远清
  0 siblings, 0 replies; 4+ messages in thread
From: 周 远清 @ 2020-07-13  7:50 UTC (permalink / raw)
  To: Adrian Ambrożewicz, openbmc; +Cc: uperic@163.com

[-- Attachment #1: Type: text/plain, Size: 2503 bytes --]

Hi Adrian,

    Thank you very much, your explanation below is clear. There may have been a delay in my mail server last month and I have recently received mail.

harley

________________________________
发件人: Adrian Ambrożewicz <adrian.ambrozewicz@linux.intel.com>
发送时间: 2020年6月22日 21:55
收件人: zhouyuanqing8@outlook.com <zhouyuanqing8@outlook.com>; openbmc <openbmc@lists.ozlabs.org>
抄送: uperic@163.com <uperic@163.com>
主题: Re: about virtual variable

In other words - virtual/XYZ is exported by recipes delivering the same
stuff, conflicting with each other . In your system you have to choose
the compiler, kernel etc. While many recipes might deliver those
components, recipe creators use the same 'meta-name' (from 'virtual'
namespace), so then by choosing "PREFERRED_PROVIDER" you can decide
which of the 'implementations' you would like to actually use.

With 'virtual' variables you can use 'virtual/xyz' as a generic alias.
You can then introduce BitBake code depending on magic 'virtual/kernel'
instead of using concrete name of implementations (like linux-aspeed /
linux-nuvoton / linux-yocto / linux-yocto-rt).

Regards,
Adrian

W dniu 6/22/2020 o 15:43, Adrian Ambrożewicz pisze:
> I feel rude for pointing out link to StackOverflow, but this guy really
> nailed it when it comes to easy explanation of 'virtual/' variable
> namespace :)
>
> https://stackoverflow.com/a/37823742/8226884
>
> W dniu 6/22/2020 o 14:48, zhouyuanqing8@outlook.com pisze:
>> Hi everyone,
>>
>>       I would like to ask, is virtual a variable defined by bitbake? I
>> did not find it in the bitbake manual. What is the use of the virtual
>> variable? What would be the problem without this variable?
>>
>>
>>     2.4. Preferences¶
>>
>> <https://www.yoctoproject.org/docs/latest/bitbake-user-manual/bitbake-user-manual.html#bb-bitbake-preferences>
>>
>>
>> The|PROVIDES|list is only part of the solution for figuring out a
>> target's recipes. Because targets might have multiple providers,
>> BitBake needs to prioritize providers by determining provider
>> preferences.
>>
>> A common example in which a target has multiple providers is
>> "virtual/kernel", which is on the|PROVIDES|list for each kernel
>> recipe. Each machine often selects the best kernel provider by using a
>> line similar to the following in the machine configuration file:
>>
>>       PREFERRED_PROVIDER_virtual/kernel = "linux-yocto"
>>
>>

[-- Attachment #2: Type: text/html, Size: 5856 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-07-13  7:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-22 12:48 about virtual variable zhouyuanqing8
2020-06-22 13:43 ` Adrian Ambrożewicz
2020-06-22 13:55   ` Adrian Ambrożewicz
2020-07-13  7:50     ` 回复: " 周 远清

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.