[SRU precise/trusty] LP:#1838610 -- fix upload numbers in precise/trusty builds

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[SRU precise/trusty] LP:#1838610 -- fix upload numbers in precise/trusty builds

Andy Whitcroft-3
When we backport a version we now universally use ~<series version>.N
(eg ~12.04.1) rather than the previous ~preciseN.  This has exposed a
small parsing issue with the upload number.  This has little to no
effect other than not fully exposing the version in uname -a.  This is
not the canonical version source (/proc/version_signature is preferred)
but it is a change and should be fixed.

Following this email are three patches.  The first is only needed in
precise, the second and third are also needed in trusty.

Proposing for SRU in the next (if any) SRU cycle for precise/linux and
trusty/linux.

-apw

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[precise/master-next 1/3] UBUNTU: [debian] Allow for package revisions condusive for branching

Andy Whitcroft-3
From: dann frazier <[hidden email]>

TLDR; This changes the way that version strings are parsed in the packaging to
make it easier for me to maintain topic branches/PPA builds. There should
be no changes to how things work today for standard Ubuntu kernels. But,
it allows for topic-branch maintainers to add an optional ".X" in the ABI
name, for reasons described below.

<Regression Testing>
------------------
Old Parsing:
  = abinum =
  $ echo "33.58" | sed -e 's/\..*//'
  33
  = uploadnum =
  $ echo "33.58" | sed -e 's/.*\.//'
  58
  = abi =
  $ echo "33.58" | gawk -F. '{print $1}'
  33

New Parsing:
  = abinum =
  $ echo "33.58" | sed -r -e 's/([^\+]*)\.[^\.]+(\+.*)?$/\1/'
  33
  = uploadnum =
  $ echo "33.58" | sed -r -e 's/[^\+]*\.([^\.]+(\+.*)?$$)/\1/'
  58
  = abi =
  $ echo "33.58" | sed -r -e 's/([^\+]*)\.[^\.]+(\+.*)?$/\1/'
  33
</Regression Testing>

When maintaining topic customizations that track Ubuntu kernel releases, it
is nice have the following features:

 1) Ability to decipher the base Ubuntu kernel revision used from the topic
    kernel's revision number
 2) Use a version that dpkg sorts > the base Ubuntu version
 3) Use a version that dpkg sorts < the next expected Ubuntu version
 4) Ability to retains the same ABI as the base Ubuntu version when the
    ABI has indeed not changed. This helps with e.g. d-i compatibility.
 5) Make use of ABI tracking facilities (vs. just disabling them)

This is difficult to do with the current version scheme, which encodes the
ABI number in the version string:

  <upstream-version>-<abi>.<rev>

I can tack a "+topic.<N>" to the end of rev, we can solve 1-3, but only as
long as as the ABI is the same. Once the ABI changes, I don't have a good way
to bump it. If I increment the ABI, we'll overlap with the next Ubuntu ABI
(breaking #4). If we jump to a huge ABI number (e.g. x100 to go from 32 to
3200), we'll have a package revision that will never again upgrade to an Ubuntu
version (breaking #3), and never get back to the Ubuntu ABI (again breaking #4).
I can of course use a linux-meta package to e.g. transition from a 3200 ABI back
to a 32 ABI at the packaging level, but the bootloader will still consider
3200 to be newer and therefore the default.

I've therefore started using the following scheme:

  <upstream-version>-<abi>(.topicabi)?.<rev>(+<topic>.<topicrev>)?

Where topicabi must always be >= <rev> (ugly, but necessary).

If I don't break the ABI, I can then branch and return like so:

3.16.0-8.6 -------------------------------------------------> 3.16.0-8.7
   \                                                             ^
    \                                                            |
     \--> 3.16.0-8.6+topic.1 -------> 3.16.0-8.6+topic.2 --------/

If I do need to break the ABI, I can branch and return like so:

3.16.0-8.6 -------------------------------------------------> 3.16.0-9.1
   \                                                             ^
    \       ABI break #1                   ABI break #2          |
     \--> 3.16.0-8.6.6+topic.1 -------> 3.16.0-8.7.6+topic.2 ----/

Signed-off-by: dann frazier <[hidden email]>
Signed-off-by: Tim Gardner <[hidden email]>

[[hidden email]: drop getabis changes as that has separately been
 backported wholesale.]
BugLink: http://bugs.launchpad.net/bugs/1838610
Signed-off-by: Andy Whitcroft <[hidden email]>
---
 debian/rules.d/0-common-vars.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/debian/rules.d/0-common-vars.mk b/debian/rules.d/0-common-vars.mk
index 17eed6a25717..1fd6daffcb02 100644
--- a/debian/rules.d/0-common-vars.mk
+++ b/debian/rules.d/0-common-vars.mk
@@ -70,11 +70,11 @@ ifeq ($(full_build),false)
 skipdbg=true
 endif
 
-abinum := $(shell echo $(revision) | sed -e 's/\..*//')$(abi_suffix)
-prev_abinum := $(shell echo $(prev_revision) | sed -e 's/\..*//')$(abi_suffix)
+abinum := $(shell echo $(revision) | sed -r -e 's/([^\+]*)\.[^\.]+(\+.*)?$$/\1/')$(abi_suffix)
+prev_abinum := $(shell echo $(prev_revision) | sed -r -e 's/([^\+]*)\.[^\.]+(\+.*)?$$/\1/')$(abi_suffix)
 abi_release := $(release)-$(abinum)
 
-uploadnum := $(shell echo $(revision) | sed -e 's/.*\.//')
+uploadnum := $(shell echo $(revision) | sed -r -e 's/[^\+]*\.([^\.]+(\+.*)?$$)/\1/')
 ifneq ($(full_build),false)
   uploadnum := $(uploadnum)-Ubuntu
 endif
--
2.20.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[precise/master-next 2/3] UBUNTU: [debian] Fix regression with ABI subversions and backport

Andy Whitcroft-3
In reply to this post by Andy Whitcroft-3
From: dann frazier <[hidden email]>

Tim pointed out that 443b5814ee77f8c9083079ce0e6a0806e087630f broke the parsing
of backport versions, such as 8.13~14.10+ppa.1. This should fix it. I used the
following script to validate the regular expressions:

dannf@fluid:~$ cat test.sh

set -e

splitver() {
    local ver="$1"
    local abinum="$(echo $ver | sed -r -e 's/([^\+~]*)\.[^\.]+(~.*)?(\+.*)?$/\1/')"
    local uploadnum="$(echo $ver | sed -r -e 's/[^\+~]*\.([^\.~]+)(~.*)?(\+.*)?$/\1/')"

    echo "$abinum $uploadnum"
}

do_test() {
    local ver="$1"
    local expected="$2"

    local actual="$(splitver $ver)"

    if [ "$actual" = "$expected" ]; then
        echo "PASS: $ver"
        return 0
    fi
    echo "FAIL: $ver split as $actual"
    return 1
}

do_test "33.58" "33 58"
do_test "33.59.58" "33.59 58"
do_test "8.13~14.10" "8 13"
do_test "8.13~14.10+ppa.1" "8 13"
do_test "8.13.99~14.10+ppa.3" "8.13 99"
dannf@fluid:~$ ./test.sh
PASS: 33.58
PASS: 33.59.58
PASS: 8.13~14.10
PASS: 8.13~14.10+ppa.1
PASS: 8.13.99~14.10+ppa.3

Signed-off-by: dann frazier <[hidden email]>
Signed-off-by: Tim Gardner <[hidden email]>

[[hidden email]: drop getabis changes as that has separately been
 backported wholesale.]
BugLink: http://bugs.launchpad.net/bugs/1838610
Signed-off-by: Andy Whitcroft <[hidden email]>
---
 debian/rules.d/0-common-vars.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/debian/rules.d/0-common-vars.mk b/debian/rules.d/0-common-vars.mk
index 1fd6daffcb02..701639f58e01 100644
--- a/debian/rules.d/0-common-vars.mk
+++ b/debian/rules.d/0-common-vars.mk
@@ -70,11 +70,11 @@ ifeq ($(full_build),false)
 skipdbg=true
 endif
 
-abinum := $(shell echo $(revision) | sed -r -e 's/([^\+]*)\.[^\.]+(\+.*)?$$/\1/')$(abi_suffix)
-prev_abinum := $(shell echo $(prev_revision) | sed -r -e 's/([^\+]*)\.[^\.]+(\+.*)?$$/\1/')$(abi_suffix)
+abinum := $(shell echo $(revision) | sed -r -e 's/([^\+~]*)\.[^\.]+(~.*)?(\+.*)?$$/\1/')$(abi_suffix)
+prev_abinum := $(shell echo $(prev_revision) | sed -r -e 's/([^\+~]*)\.[^\.]+(~.*)?(\+.*)?$$/\1/')$(abi_suffix)
 abi_release := $(release)-$(abinum)
 
-uploadnum := $(shell echo $(revision) | sed -r -e 's/[^\+]*\.([^\.]+(\+.*)?$$)/\1/')
+uploadnum := $(shell echo $(revision) | sed -r -e 's/[^\+~]*\.([^\.~]+)(~.*)?(\+.*)?$$/\1/')
 ifneq ($(full_build),false)
   uploadnum := $(uploadnum)-Ubuntu
 endif
--
2.20.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[precise/master-next 3/3] UBUNTU: [Packaging] uploadnum should be the remainder of the version

Andy Whitcroft-3
In reply to this post by Andy Whitcroft-3
The uploadnum variable in debian/rules is somewhat confusingly named,
it should be the "remainder of the version after <version>-<abinum>", not
just the uploadnum itself.  This version is only used for identification
in uname -v and there it is completely appropriate for this to be complete
with backport versions etc.

BugLink: http://bugs.launchpad.net/bugs/1407755
Signed-off-by: Andy Whitcroft <[hidden email]>
Acked-by: Chris J Arges <[hidden email]>
Acked-by: Brad Figg <[hidden email]>
Signed-off-by: Brad Figg <[hidden email]>

BugLink: http://bugs.launchpad.net/bugs/1838610
Signed-off-by: Andy Whitcroft <[hidden email]>
---
 debian/rules.d/0-common-vars.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/rules.d/0-common-vars.mk b/debian/rules.d/0-common-vars.mk
index 701639f58e01..630806f767aa 100644
--- a/debian/rules.d/0-common-vars.mk
+++ b/debian/rules.d/0-common-vars.mk
@@ -74,7 +74,7 @@ abinum := $(shell echo $(revision) | sed -r -e 's/([^\+~]*)\.[^\.]+(~.*)?(\+.*)
 prev_abinum := $(shell echo $(prev_revision) | sed -r -e 's/([^\+~]*)\.[^\.]+(~.*)?(\+.*)?$$/\1/')$(abi_suffix)
 abi_release := $(release)-$(abinum)
 
-uploadnum := $(shell echo $(revision) | sed -r -e 's/[^\+~]*\.([^\.~]+)(~.*)?(\+.*)?$$/\1/')
+uploadnum := $(shell echo $(revision) | sed -r -e 's/[^\+~]*\.([^\.~]+(~.*)?(\+.*)?$$)/\1/')
 ifneq ($(full_build),false)
   uploadnum := $(uploadnum)-Ubuntu
 endif
--
2.20.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

APPLIED: [SRU precise/trusty] LP:#1838610 -- fix upload numbers in precise/trusty builds

Stefan Bader-2
In reply to this post by Andy Whitcroft-3
On 05.08.19 10:37, Andy Whitcroft wrote:

> When we backport a version we now universally use ~<series version>.N
> (eg ~12.04.1) rather than the previous ~preciseN.  This has exposed a
> small parsing issue with the upload number.  This has little to no
> effect other than not fully exposing the version in uname -a.  This is
> not the canonical version source (/proc/version_signature is preferred)
> but it is a change and should be fixed.
>
> Following this email are three patches.  The first is only needed in
> precise, the second and third are also needed in trusty.
>
> Proposing for SRU in the next (if any) SRU cycle for precise/linux and
> trusty/linux.
>
> -apw
>
Applied to P/P-LTS-T/T. Thanks.

-Stefan


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (849 bytes) Download Attachment