Explaining package versioning

Package versioning is used to differentiate the same package in different stages of its life cycle. From Poky's perspective, it is also used as part of the equation that generates the checksum used by BitBake to verify whether a task must be rebuilt.

The package version, also known as PV, plays a central role when we select which recipe to build. The default behavior of Poky is to always prefer the newest recipe version, unless there is an explicit different preference, as we discussed in the Chapter 4, Grasping the BitBake Tool. For example, consider that we have two versions of the recipe myrecipe—myrecipe_1.0.bb and myrecipe_1.1.bb. BitBake, by default, builds the recipe with version 1.1.

Inside the recipe, we may have other variables that compose package versioning with the PV variable. These are package epoch, known as PE and package revision, known as PR.

The PE variable has a default value of zero and is used when the package version schema is changed, breaking the possibility of usual ordering. The package epoch is prepended in the package version, forcing a higher number when needed. For example, if a package uses the date to compose PV variables such as 20140101 and 20140201, the version schema is changed for a reason, and a new version, 1.0, is released, it is impossible to determine whether version 1.0 is higher than version 20140201. So, PE = "1" is used, forcing version 1.0 to be higher than 20140201 since 1:1.0 is greater than 0:20140101.

The PR variable has a default value of r0 and is used as part of package versioning. When it is updated, it forces BitBake to rebuild all tasks of a specific recipe. We can update it manually in the recipe metadata to force a rebuild we know is needed. Although the approach of manually setting the PR variables inside recipes may seem attractive, it is very fragile because it relies on human interaction and knowledge when it is required. Since Yocto Project 1.5 (Dora), BitBake uses the task checksums to control what needs to be rebuilt, and the manual PR increment is only used in extremely rare cases when the task checksum does not change.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.131.168