Module repo

Module repo 

Source
Expand description

Repo-metadata resolution: from a distro spec to concrete kernel package URLs + sha256 checksums, pulled from each distro’s official repository metadata.

This module resolves metadata ONLY — it never downloads the kernel packages themselves. Extraction of the resolved packages and the download/cache integration are handled elsewhere; the seam between them is the ResolvedDistroKernel this module returns.

§Endpoint choices

  • Fedora — latest stable release number from https://fedoraproject.org/releases.json (official, stable JSON, served by fedoraproject.org). It lists only shipped GA releases with numeric version fields, so filtering to all-digit versions and taking the max yields the current stable release without the Rawhide/Branched noise a mirror directory listing would carry. Kernel packages come from the updates repo (falling back to the GA releases/.../os repo), debuginfo from the matching debug repo. Package selection is by RPM EVR (rpmvercmp).
  • Ubuntu — latest LTS from https://changelogs.ubuntu.com/meta-release-lts (official, plain text, carries the codename). Kernel = the HWE stack: the linux-image-generic-hwe-{YY.MM} meta package’s Depends pins the concrete linux-image-{kver}-generic, whose modules live in linux-modules{,-extra}-{kver}-generic. debuginfo is the -dbgsym ddeb from ddebs.ubuntu.com, with Launchpad’s primary archive API and file store as an independent resolution/download provider when the DDEB archive is unavailable.
  • Amazon Linux 2023 — repo base from https://cdn.amazonlinux.com/al2023/core/mirrors/latest/{arch}/mirror.list. AL2023 carries parallel kernel STREAMS as differently-named packages — the default kernel (6.1) plus versioned kernel6.12 / kernel6.18 — with no Fedora-style kernel-core/modules split; each stream splits a handful of extra drivers, virtio_console among them, into a <stream>-modules-extra subpackage (verified against the live filelists metadata). The resolver picks the stream with the newest kernel by RPM EVR and pairs it with its modules-extra at the same EVR; debuginfo (<stream>-debuginfo, which carries the full vmlinux on its own) comes from the sibling debuginfo mirror.
  • SteamOS — Valve’s official package mirror https://steamdeck-packages.steamos.cloud/archlinux-mirror/. The kernel lives in the jupiter-<MAJOR.MINOR> channels (Valve’s per-release trains; verified live: jupiter-3.7, jupiter-3.8). A bare steamos picks the highest version-numbered jupiter channel — the newest release train Valve publishes — because the mirror exposes no machine-readable stable pointer: jupiter-rel is the legacy 3.0-era channel (its newest kernel is 5.13) and -main/-staging/-ci-test are development churn, so the numbered trains are the only sane axis; pin steamos-3.7 to hold an older train. The channel’s pacman database (jupiter-<v>.db, a compressed tar of per-package desc files) declares name/version/sha256/filename; the kernel package is linux-neptune[-<series>] (linux-neptune-618 today) and the newest series wins by kernel version (compared with rpmvercmp, whose plain alnum-segment ordering matches pacman’s vercmp for these dotted versions). x86_64 only — Valve publishes no other architecture. No debug packages exist for linux-neptune anywhere on the mirror (the *-debug-* repos only mirror Arch’s own core/extra split), so SteamOS resolves with NO debuginfo — the one distro exempt from the mandatory-vmlinux policy; acquisition warns about what that degrades.

All metadata fetches ride the shared HTTP client and transient-retry seam via crate::fetch::fetch_metadata_bytes / crate::fetch::fetch_metadata_text. Parsing/selection is factored into pure functions over &[u8] / &str so the unit tests exercise them on small fixtures without touching the network.

Re-exports§

pub use crate::kernel_path::DistroKind;

Structs§

PackageRef
A single resolved package: name, version, ordered official download URLs, and the sha256 the repository metadata declares for it.
ResolvedDistroKernel
The resolved kernel for a distro spec: the packages that carry the kernel image + modules, plus the vmlinux-bearing debuginfo packages.

Functions§

resolve_distro_kernel
Resolve a distro spec to concrete kernel package URLs + checksums for the host architecture.