Module fetch

Module fetch 

Source
Expand description

Kernel source acquisition: tarball download, GitHub codeload snapshot, git clone, local tree.

The acquisition entry points each return an AcquiredSource carrying the source directory, cache key, and metadata the caller needs to proceed to configuration and build: download_tarball (kernel.org stable/RC), download_github_archive (a GitHub codeload commit snapshot), git_clone_kinded (a kind-directed shallow clone that dispatches to git_clone_tag / git_clone), and local_source (an on-disk tree).

Structs§

AcquiredSource
Downloaded/cloned kernel source ready for building.
LocalSourceState
Result of inspect_local_source_state — git hash and dirty/git classification of a canonical source-tree path. Pulled out of local_source so the post-build dirty re-check (a second call from crate::cli::kernel_build_pipeline) reuses the exact same gix path.

Functions§

arch_info
Target architecture string and boot image name.
compose_local_cache_key
Compose the cache key for a local source given its arch, optional HEAD short hash, canonical source path, and optional user .config hash.
download_tarball
Download a kernel tarball (stable or RC) and extract it.
fetch_latest_stable_version
Fetch the latest stable kernel version from kernel.org.
fetch_version_for_prefix
Resolve the highest version matching a prefix.
git_clone
Shallow-clone a git repository at a BRANCH ref.
inspect_local_source_state
Inspect a canonical source-tree path for git hash + dirty state.
is_major_minor_prefix
Return true when s is a kernel major.minor prefix like "6.14" (as opposed to a full patch version "6.14.2" or an rc tag "6.15-rc3"). Callers use this to decide whether the input needs prefix resolution via fetch_version_for_prefix.
local_source
Use a local kernel source tree.
shared_client
Return the process-wide shared [reqwest::blocking::Client]. First call constructs it via Client::builder() with SHARED_CLIENT_CONNECT_TIMEOUT applied; every subsequent call returns a reference to the same instance. This helper is for top-level CLI entries that want the default client.