Summary
The goal is to provide a principle for eLxr package version strategy. It should be as concise and clear as possible to facilitate understanding and mastery
Both Ubuntu and eLxr are derived from Debian. Ubuntu rebuilds all packages from Debian. eLxr only rebuilds packages when we need to add changes, therefore Ubuntu package version strategy (Reference 1) can’t perfectly suit eLxr, but it should be a reference. On the other hand, beside Debian upstream, eLxr imports packages from the package upstream, and eLxr has own packages.
3 type packages
There are three types of packages in eLxr.
-
Debian package
-
Upstream package
- The package is from package upstream or 3rd party, for example, trivy, cri-o
-
eLxr package
- eLxr are the package the upstream, for example d2o tools, wr-elxr-pro
Basic pattern of package version
Debian supports 2 format packages, native and quilt. The Native package is modified directly on the source codes. It doesn’t have orig.tar.gz file, for example, desktop-base, base-files. The Quilt package needs to modify the source codes by adding patches in the debian/patches directory. It has orign.tar.gz file. Therefore, Native package doesn’t have revision (“-”) in version, but Quilt package must have revision (“-”).
Debian package
Quilt package: add elxrX appended to Debian revision
[upstream_version]-[debian_revision]elxr[elxr_revision]
Native package:
[debian_version]elxr[elxr_revision]
Upstream package
The package comes from package upstream instead of Debian. Normally, it should be quilt package to keep original source codes clean.
Add -elxrX append to upstream version
[upstream_version]-elxr[elxr_revision]
eLxr package
Normally, it should be native package since the package is own by eLxr.
Add elxrX append to package version.
[package_version]elxr[elxr_revision]
Adding a change
Changes require adding or incrementing the number immediately following the elxr string. Consequently, the first eLxr modification would have elxr1 appended to the Debian revision. Subsequent eLxr changes would increment this suffix, i.e. elxr1-->elxr2.
Here’s a listing of examples of the application of these rules:
| Previous version | Modification type | Recommended version |
|---|---|---|
13.8+deb13u1 |
eLxr change | 13.8+deb13u1elxr1 |
13.8+deb13u1elxr1 |
eLxr change | 13.8+deb13u1elxr2 |
0.66.0 |
eLxr change | 0.66.0-elxr1 |
No-change Rebuilds
Sometimes a package has previously successfully built into eLxr, and still does not require changes to the packaging or source code, but the generated binaries do require rebuilding against newer versions of dependencies, for example kernel OOT drivers, when we upgrade kernel version, we need to rebuild OOT drivers, like qat, dpdk-kmods. In this case, nothing to change except for changelog.
In this case one would:
-
Adding a
bXsuffix appended to previous version -
If there is already one such
bXsuffix present, increment it -
Removing the
bXonce adding a new change
List of this evolution of versions and further related examples:
| Previous version | Modification type | Recommended version |
|---|---|---|
| 1.1.40-00018elxr6 | No-change rebuild | 1.1.40-00018elxr6b1 |
| 1.1.40-00018elxr6b1 | No-change rebuild | 1.1.40-00018elxr6b2 |
| 1.1.40-00018elxr6b2 | eLxr change | 1.1.40-00018elxr7 |
| 1.1.40-00018elxr7 | No-change rebuild | 1.1.40-00018elxr7b1 |
Upgrading a package
If eLxr has local changes to the package from Debian, eLxr developer rebases the local changes to new version package. The counter for eLxr increments resets to 1, therefore the version for the new upload to the eLxr mirror is the version from Debian with a suffix of elxr1. There are 2 scenarios:
-
Migrating local changes of a package from an old eLxr main release to a new main release, for example aria → bianca
-
When Debian delivers a new revision package in same main release, eLxr needs to upgrade to the revision and rebase local changes.
After upgrading new version package, eLxr developer needs to git cherry-pick all local commits on top and merges all modifications of changelog into one modification on top of changelog.
The idea is from Debian, that Debian doesn’t request a change must update changelog in developing phase, because the changes aren’t exposed to end users until release. When reaching a milestone, the package maintainer will update all previous changes in one changelog item and increase the package version.
The package upgrading is a chance to merge all previous changelog items and reset the eLxr revision to 1 to avoid the eLxr revision number is carried to next main version.
List of this evolution of versions and further related examples:
| Previous version | Modification type | Recommended version | Note |
|---|---|---|---|
| 0.66-elxr2 | eLxr change | 0.66-elxr3 | |
| 0.66-elxr3 | eLxr change | 0.66-elxr4 | |
| 0.66-elxr4 | upgrade package | 0.68.2-elxr1 | Merge 4 revision to 1 |
| 0.68.2-elxr1 | eLxr change | 0.68.2-elxr2 |
Adding Debian NMU (bN) into source package revision
Debian supports NMU update (Reference 2), that the source package version isn’t changed, but a suffix +b appended binary version, for example
| Package | Source version | Binary version |
|---|---|---|
| busybox | 1:1.35.0-4 | 1:1.35.0-4+b2 |
According to the above rules to add eLxr revision, the version will be changed to 1:1.35.0-4elxr1. In Debian’s version specification, 1:1.35.0-4+b2 is higher than 1:1.35.0-4elxr1, that misleads end users think the newer version is 1:1.35.0-4+b2, and they fail to get the eLxr changes.
$ dpkg --compare-versions 1:1.35.0-4elxr1 gt 1:1.35.0-4+b2 && echo true || echo false
false
To ensure that eLxr version is always higher than the original version, eLxr developer needs to apply the +b into source package version along with eLxr revision.
[upstream_version]-[debian_revision]+bNelxr[elxr_revision]
List of this evolution of versions and further related examples:
| Previous version | Modification type | Recommended version | Note |
|---|---|---|---|
| 1:1.35.0-4 | eLxr change | 1:1.35.0-4+b2elxr1 | There is +b in binary version |
| 1:1.35.0-4+b2elxr1 | eLxr change | 1:1.35.0-4+b2elxr2 | |
| 1:1.35.0-4+b2elxr2 | No-change rebuild | 1:1.35.0-4+b2elxr2b1 | The fist b2 is Debian NUM update, the second b1 is eLxr No-change Rebuilds |
Same version of a package in multi-releases
If two eLxr releases have the same version package, then this would make the package non-upgradable and cause a version conflict (two builds, but not the same). It rarely happens on upstream or native package. For example, there isn’t change of a native package between aria and bianca, To resolve this, add the numeric .YY.MM release version appended to elxrX.
List of this evolution of versions and further related examples:
| Previous version | Recommended version | Note |
|---|---|---|
| 0.66.0-elxr1 in 3 releases | 0.66.0-elxr1 (aria) | aria is the first release of eLxr, so no need to append release version |
| 0.66.0-elxr1.26.04.01 (bianca) | ||
| 0.66.0-elxr1.27.04.01 (next eLxr main release) |
The idea is come from Ubuntu Version string format (Reference 1)
Kernel version
eLxr kernel is a special case. BSPs need to append a bundle of BSP changes, for example, NXP BSPs have 5000+ commits. If following standard process, it needs to add 5000+ local patch files in Debian folder, that‘s crazy. When upgrading kernel to next version, that needs to refresh the 5000+ local patches. If applying the 5000+ patches on top Linux git tree, it’s pretty easy to rebase the local commits via git rebase/merge commends. Consequently, all eLxr BSP changes are needed to pack into orig.tar.gz rather than debian.tar.xz, that requests to increase the package upstream version, please see the table below.
| Previous version | Modification type | Recommended version |
|---|---|---|
| 6.1.153-1 | eLxr BSP change | 6.1.153-elxr1-1 |
| 6.1.153-elxr1-1 | eLxr BSP change | 6.1.153-elxr2-1 |
| 6.1.153-elxr2-1 | Upgrade kernel version | 6.1.158-elxr1-1 |
linux_6.1.158.orig.tar.gz → linux_6.1.158-elxr1.orig.tar.gz
linux_6.1.158-1.debian.tar.xz → linux_6.1.158-elxr1-1.debian.tar.xz