Adding Debian, Ubuntu, OpenSUSE, RHEL, CentOS kernels to WireGuard CI: Seeking URLs

Neal Gompa ngompa13 at gmail.com
Sun May 24 02:20:35 CEST 2020


On Sat, May 23, 2020 at 8:01 PM Jason A. Donenfeld <Jason at zx2c4.com> wrote:
>
> On Sat, May 23, 2020 at 5:50 AM Neal Gompa <ngompa13 at gmail.com> wrote:
> >
> > On Sat, May 23, 2020 at 3:21 AM Jason A. Donenfeld <Jason at zx2c4.com> wrote:
> > >
> > > Hi Neal,
> > >
> > > Thanks for these very helpful instructions. In trying to implement
> > > this, one snag I encountered was that the .src.rpm file has inside of
> > > it the linux-{version}.tar.xz file that I actually want. Is there
> > > anywhere on the internet that hosts these .tar.xz files directly?
> > >
> >
> > There *is*, but that starts getting into using the CentOS Git system
> > more directly. Per your original email, you weren't interested in that
> > path, so I didn't go there.
>
> Well, one trick is that most web git viewers (such as cgit) can
> produce a tarball on the fly from a URL. Something like this exist
> here?

So, CentOS uses a Dist-Git[1] system, which means the part that is
actually tracked in git is the packaging files, and there's an
associated binary repo reference stored in the Git repo for fetching
binary artifacts. Dist-Git is the common ancestor to virtually all
current approaches to storing binaries efficiently alongside a Git
repo (Git-Annex and Git LFS came much later).

It seems it's possible to do this without having to use Git itself
(which is better than with git-annex and git-lfs), but it's a bit
cumbersome...

The way that you'd fetch the tarball in this scenario would be to
something like the following:

1. Get the tags via API, but with commits:

$ curl --silent --header "Content-Type: application/json" \
https://git.centos.org/api/0/rpms/kernel/git/tags?with_commits=true \
| jq '.["tags"] '

This gives you now a JSON dictionary with the tags as keys and the
associated commit as values.

2. Get the corresponding commit and fetch the .kernel.metadata file
containing the lookaside references:

$ curl --silent
https://git.centos.org/rpms/kernel/raw/${kernel_tag_commit}/f/.kernel.metadata \
> kernel_sources

3. Fetch the source matching to your kernel source package:

$ wget https://git.centos.org/sources/kernel/${rel}/${kernel_src_checksum} \
--output-document=${kernel_src_filename}

The $kernel_src_checksum and $kernel_src_filename would be populated
from the entries in the kernel_sources files you downloaded earlier.

Note: $rel is either "c7" or "c8" depending on which one you're trying to get.


[1]: https://github.com/release-engineering/dist-git





--
真実はいつも一つ!/ Always, there's only one truth!


More information about the WireGuard mailing list