Adding Debian, Ubuntu, OpenSUSE, RHEL, CentOS kernels to WireGuard CI: Seeking URLs
Jason A. Donenfeld
Jason at zx2c4.com
Fri May 22 08:44:17 UTC 2020
On Fri, May 22, 2020 at 02:04:58AM -0600, Jason A. Donenfeld wrote:
> I'd like to put these on build.wireguard.com to mitigate breakage. In
> order to make this happen, I'll need two things:
> - A URL I can scape that will give me the latest kernel versions for
> relevant distros.
> - A URL I can construct using a selected version to download a boring
> kernel source tarball.
> I would prefer to not involve git, if possible, and for these URLs to
> point to the sources for actual kernels that are shipping as the
> standard latest-kernel for each of the above releases.
Here's a bash example that achieves part 1, to give a more concrete
idea of what I'm after:
declare -A UBUNTU_SERIES_KERNELS
while read -r line; do
[[ $line =~ ^\ *linux\ +\|\ ([0-9.-]+)\ +\|\ ([a-z]+)(-[a-z]+)?\ +\|\ source$ ]] || continue
version="${BASH_REMATCH[1]}" series="${BASH_REMATCH[2]}" repo="${BASH_REMATCH[3]}"
[[ $repo != -proposed ]] || continue
read -r smaller < <(printf '%s\n3.10\n' "$version" | sort -V)
[[ $smaller == 3.10 ]] || continue
UBUNTU_SERIES_KERNELS[$series]+="$version "
done < <(curl -Ls https://people.canonical.com/~ubuntu-archive/madison.cgi?package=linux&a=&c=&s=)
UBUNTU_KERNELS=( )
for series in "${!UBUNTU_SERIES_KERNELS[@]}"; do
read -r kernel < <(sort -Vur <<<"${UBUNTU_SERIES_KERNELS[$series]// /$'\n'}")
[[ -n $kernel ]] && UBUNTU_KERNELS+=( "$kernel" )
done
printf -- '- %s\n' "${UBUNTU_KERNELS[@]}"
The output of this script is something like:
- 4.15.0-101.102
- 5.4.0-26.30
- 5.4.0-31.35
- 4.4.0-179.209
- 3.13.0-170.220
- 5.3.0-53.47
- 5.0.0-38.41
The next step would be turning these version numbers into URLs to the
tarballs. Hopefully the team at Canonical can assist with providing
that.
Jason
More information about the kernel-team
mailing list