/**
- * Copyright (C) 2016-2018 - Michael Jeanson <mjeanson@efficios.com>
+ * Copyright (C) 2016-2020 Michael Jeanson <mjeanson@efficios.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
throw new EmptyKVersionException("Empty kernel version")
}
+ //'Ubuntu-hwe-5.8-5.8.0-19.20_20.04.3',
//'Ubuntu-lts-4.8.0-27.29_16.04.1',
//'Ubuntu-4.4.0-70.91',
- def match = version =~ /^Ubuntu-(lts-|hwe-)??(\d+)\.(\d+)\.(\d+)-(\d+)\.(\d+)(.*)??$/
+ def match = version =~ /^Ubuntu-(lts-|hwe-)??(?:\d+\.\d+-)??(\d+)\.(\d+)\.(\d+)-(\d+)\.(\d+)(.*)??$/
if (!match) {
throw new InvalidKVersionException("Invalid kernel version: ${version}")
}
vString = vString.concat("${this.strLTS}")
}
- vString = vString.concat("${this.major}.${this.minor}.${this.patch}-${this.umajor}.${this.uminor}${this.suffix}")
+ // The tag pattern changed for HWE kernels >= 5.0
+ if (this.isLTS && this.major >= 5) {
+ vString = vString.concat("${this.major}.${this.minor}-${this.major}.${this.minor}.${this.patch}-${this.umajor}.${this.uminor}${this.suffix}")
+ } else {
+ vString = vString.concat("${this.major}.${this.minor}.${this.patch}-${this.umajor}.${this.uminor}${this.suffix}")
+ }
return vString
}
if (uversion != null) {
kversionFactory = new UbuntuKVersion()
switch (uversion) {
- case 'focal':
+ case 'jammy':
matchStrs = [
- ~/^refs\/tags\/(Ubuntu-5\.4\.0-\d{1,3}?\.[\d]+)$/,
+ ~/^refs\/tags\/(Ubuntu-5\.15\.0-\d{1,3}?\.[\d]+)$/,
+ ~/^refs\/tags\/(Ubuntu-hwe-6\.2-6\.2\.0-.*_22\.04\.\d+)$/,
+ ~/^refs\/tags\/(Ubuntu-hwe-6\.5-6\.5\.0-.*_22\.04\.\d+)$/,
]
break
- case 'bionic':
- matchStrs = [
- ~/^refs\/tags\/(Ubuntu-4\.15\.0-\d{1,3}?\.[\d]+)$/,
- ~/^refs\/tags\/(Ubuntu-hwe-5\.0\.0-.*_18\.04\.\d+)$/,
- ~/^refs\/tags\/(Ubuntu-hwe-5\.3\.0-.*_18\.04\.\d+)$/,
- ]
- break
-
- case 'xenial':
+ case 'focal':
matchStrs = [
- ~/^refs\/tags\/(Ubuntu-4\.4\.0-\d{1,3}?\.[\d]+)$/,
- ~/^refs\/tags\/(Ubuntu-hwe-4\.15\.0-.*_16\.04\.\d+)$/,
- ]
-
- blacklist = [
- 'Ubuntu-lts-4.10.0-7.9_16.04.1',
+ ~/^refs\/tags\/(Ubuntu-5\.4\.0-\d{1,3}?\.[\d]+)$/,
+ ~/^refs\/tags\/(Ubuntu-hwe-5\.13-5\.13\.0-.*_20\.04\.\d+)$/,
+ ~/^refs\/tags\/(Ubuntu-hwe-5\.15-5\.15\.0-.*_20\.04\.\d+)$/,
]
break
- case 'trusty':
+ case 'noble':
matchStrs = [
- ~/^refs\/tags\/(Ubuntu-3\.13\.0-[\d\.]+)$/,
- ~/^refs\/tags\/(Ubuntu-lts-.*_14\.04\.\d+)$/,
+ ~/^refs\/tags\/(Ubuntu-6\.8\.0-\d{1,3}?\.[\d]+)$/,
]
break
}
}
+// The filtering step assumes the version lists are sorted
kversions.sort()
kversionsRC.sort()
}
break
+ case 'lts-head':
+ // Keep only the head of each LTS branch and the latest non-RC tag
+ println('Filter kernel versions to keep only the latest point release of each lts branch and the current stable.')
+
+ def lts_kversions = []
+ // Old LTS entries are kept so that "lts-head" is still meaningful in kernel
+ // version ranges that are supported by lttng-modules but no longer supported
+ // upstream, eg. lttng-modules stable-2.13 supports >= 3.0
+ lts_kversions.add(kversionFactory.factory("v3.0")) // LTS until October 2013
+ lts_kversions.add(kversionFactory.factory("v3.2")) // LTS until May 2018
+ lts_kversions.add(kversionFactory.factory("v3.4")) // LTS until October 2016
+ lts_kversions.add(kversionFactory.factory("v3.10")) // LTS until November 2017
+ lts_kversions.add(kversionFactory.factory("v3.12")) // LTS until May 2017
+ lts_kversions.add(kversionFactory.factory("v3.14")) // LTS until August 2016
+ lts_kversions.add(kversionFactory.factory("v3.16")) // LTS until October 2014
+ lts_kversions.add(kversionFactory.factory("v3.18")) // LTS until January 2017
+ lts_kversions.add(kversionFactory.factory("v4.1")) // LTS until May 2018
+ lts_kversions.add(kversionFactory.factory("v4.4")) // SLTS until 2026
+ lts_kversions.add(kversionFactory.factory("v4.9")) // LTS until January 2023
+ lts_kversions.add(kversionFactory.factory("v4.14")) // LTS until January 2024
+ lts_kversions.add(kversionFactory.factory("v4.19")) // LTS until December 2024
+ lts_kversions.add(kversionFactory.factory("v5.4")) // LTS until December 2025
+ lts_kversions.add(kversionFactory.factory("v5.10")) // LTS until December 2026
+ lts_kversions.add(kversionFactory.factory("v5.15")) // LTS until December 2026
+ lts_kversions.add(kversionFactory.factory("v6.1")) // LTS until December 2026
+ lts_kversions.add(kversionFactory.factory("v6.6")) // LTS until December 2026
+
+ // First filter the head of each branch
+ for (i = 0; i < kversions.size(); i++) {
+ def curr = kversions[i]
+ def next = i < kversions.size() - 1 ? kversions[i + 1] : null
+
+ if (next != null) {
+ if (curr.isSameStable(next)) {
+ kversions.remove(i)
+ i--
+ }
+ }
+ }
+
+ for (i = 0; i < kversions.size(); i++) {
+ def curr = kversions[i]
+
+ // Keep the newest tag
+ if (i == kversions.size() - 1) {
+ break
+ }
+
+ // Prune non-LTS versions
+ def keep = false
+ for (j = 0; j < lts_kversions.size(); j++) {
+ if (curr.isSameStable(lts_kversions[j])) {
+ keep = true
+ break
+ }
+ }
+
+ if (!keep) {
+ kversions.remove(i)
+ i--
+ }
+ }
+ break
+
default:
// No filtering of kernel versions
println('No kernel versions filtering selected.')