<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="caret-color: rgb(50, 49, 48); color: rgb(50, 49, 48); font-family: "Microsoft Yahei UI", Verdana, Simsun, "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif; font-size: 14.666666984558105px; background-color: rgb(255, 255, 255); display: inline !important">Hi
 Adrian,</span><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="caret-color: rgb(50, 49, 48); color: rgb(50, 49, 48); font-family: "Microsoft Yahei UI", Verdana, Simsun, "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif; font-size: 14.666666984558105px; background-color: rgb(255, 255, 255); display: inline !important"><br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="caret-color: rgb(50, 49, 48); color: rgb(50, 49, 48); font-family: "Microsoft Yahei UI", Verdana, Simsun, "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif; font-size: 14.666666984558105px; background-color: rgb(255, 255, 255); display: inline !important"> 
   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.</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="caret-color: rgb(50, 49, 48); color: rgb(50, 49, 48); font-family: "Microsoft Yahei UI", Verdana, Simsun, "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif; font-size: 14.666666984558105px; background-color: rgb(255, 255, 255); display: inline !important"><br>
</span></div>
<div><span style="font-size: 14.666666984558105px;">harley</span></div>
<div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>发件人:</b> Adrian Ambrożewicz <adrian.ambrozewicz@linux.intel.com><br>
<b>发送时间:</b> 2020年6月22日 21:55<br>
<b>收件人:</b> zhouyuanqing8@outlook.com <zhouyuanqing8@outlook.com>; openbmc <openbmc@lists.ozlabs.org><br>
<b>抄送:</b> uperic@163.com <uperic@163.com><br>
<b>主题:</b> Re: about virtual variable</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">In other words - virtual/XYZ is exported by recipes delivering the same
<br>
stuff, conflicting with each other . In your system you have to choose <br>
the compiler, kernel etc. While many recipes might deliver those <br>
components, recipe creators use the same 'meta-name' (from 'virtual' <br>
namespace), so then by choosing "PREFERRED_PROVIDER" you can decide <br>
which of the 'implementations' you would like to actually use.<br>
<br>
With 'virtual' variables you can use 'virtual/xyz' as a generic alias. <br>
You can then introduce BitBake code depending on magic 'virtual/kernel' <br>
instead of using concrete name of implementations (like linux-aspeed / <br>
linux-nuvoton / linux-yocto / linux-yocto-rt).<br>
<br>
Regards,<br>
Adrian<br>
<br>
W dniu 6/22/2020 o 15:43, Adrian Ambrożewicz pisze:<br>
> I feel rude for pointing out link to StackOverflow, but this guy really <br>
> nailed it when it comes to easy explanation of 'virtual/' variable <br>
> namespace :)<br>
> <br>
> <a href="https://stackoverflow.com/a/37823742/8226884">https://stackoverflow.com/a/37823742/8226884</a><br>
> <br>
> W dniu 6/22/2020 o 14:48, zhouyuanqing8@outlook.com pisze:<br>
>> Hi everyone,<br>
>><br>
>>       I would like to ask, is virtual a variable defined by bitbake? I <br>
>> did not find it in the bitbake manual. What is the use of the virtual <br>
>> variable? What would be the problem without this variable?<br>
>><br>
>><br>
>>     2.4. Preferences¶<br>
>>     <br>
>> <<a href="https://www.yoctoproject.org/docs/latest/bitbake-user-manual/bitbake-user-manual.html#bb-bitbake-preferences">https://www.yoctoproject.org/docs/latest/bitbake-user-manual/bitbake-user-manual.html#bb-bitbake-preferences</a>>
<br>
>><br>
>><br>
>> The|PROVIDES|list is only part of the solution for figuring out a <br>
>> target's recipes. Because targets might have multiple providers, <br>
>> BitBake needs to prioritize providers by determining provider <br>
>> preferences.<br>
>><br>
>> A common example in which a target has multiple providers is <br>
>> "virtual/kernel", which is on the|PROVIDES|list for each kernel <br>
>> recipe. Each machine often selects the best kernel provider by using a <br>
>> line similar to the following in the machine configuration file:<br>
>><br>
>>       PREFERRED_PROVIDER_virtual/kernel = "linux-yocto"<br>
>><br>
>><br>
</div>
</span></font></div>
</div>
</body>
</html>