[bitbake-devel] howto build specific version package

张忠山 zzs213 at 126.com
Fri Aug 5 03:14:43 UTC 2016


在 2016年08月04日 19:44, Schroeder, Henning 写道:
>> -----Original Message-----
>> From: bitbake-devel-bounces at lists.openembedded.org [mailto:bitbake-
>> devel-bounces at lists.openembedded.org] On Behalf Of Richard Purdie
>> Sent: Wednesday, August 3, 2016 17:23
>> To: 张忠山 <zzs213 at 126.com>; Yang, Liezhi (Wind River)
>> <liezhi.yang at windriver.com>; bitbake-devel at lists.openembedded.org
>> Subject: Re: [bitbake-devel] howto build specific version package
>>
>> On Wed, 2016-08-03 at 14:14 +0800, 张忠山 wrote:
>>> 在 2016年08月02日 22:56, Robert Yang 写道:
>>>> Hi,
>>>>
>>>> On 08/02/2016 10:34 PM, zzs wrote:
>>>>>
>>>>>
>>>>> Hello, everyone
>>>>>
>>>>> I have two version .bb recipe, sya test_1.0.bb and test_2.0.bb.
>>>>> When build the `test` package  using the flowwing cmd:
>>>>>      bitbake test
>>>>> Always 2.0 was built.
>>>>> My question is: how to let bitbake to build version 1.0 of the
>>>>> test package
>>>>
>>>> You can:
>>>> 1) PREFERRED_VERSION_test = "1.0" in conf file such as local.conf
>>>> Or:
>>>> 2) Set DEFAULT_PREFERENCE = "-1" in test_2.0.bb.
>>>>
>>>> // Robert
>>>>
>>> Thanks for your repley.
>>>
>>> Your suggested method can select any version sure.
>>>
>>> But whenever I finish  my project. some time later I wan't rebuilt
>>> this project.
>>> Then I must edit the source to select specific version. It is not
>>> convenient and buggy.
>>> Is there a way to select version that no need to edit the source, e.g.
>>> select it on command line
>>
>> You can't select everything from the commandline. Its for the reasons of
>> reproducibility that we suggest people set things in configuration files like
>> local.conf. You can then provide the exact configuration to reproduce any
>> given build by saving that configuration file.
>>
>> Cheers,
>>
>> Richard
>
> Hi,
> I do see two options for you.
> 1.) As explained by the folks already you create two build directories which share download and sstate folders. Then you create one local.conf with the "Production Version" and one with the "Development Version". Depending on which build folder you utilize you get the product or development version.
> 2.) If you incline to use the command line to switch, there is the option to specify a config file explicitely read by bitbake. If called with "-R product.conf" you get your product version and otherwise you stick with Yocto choice of taking newest one.
>
> Example:
> bash-4.3$ cat -> product.conf
> PREFERRED_VERSION_test="1.0"
> bash-4.3$ bitbake -R product.conf test
> ...
>
> Option One is the most conflict free variant as your configurations are cleanly separated and your calls to bitbake are identical. At the cost of having the build directory two times and two different environments (Shell instances).
> Option Two is risky if you do not tell bitbake to clean (bitbake -c cleanall test) from the former build as you may end up with a mixed sysroot.
>
> Hope this helps.
>

Thanks very much.
Now I use the second option.





More information about the bitbake-devel mailing list