pub enum DistroId {
Fedora {
version: u32,
},
FedoraSilverblue {
version: u32,
},
Ubuntu {
major: u32,
minor: u32,
},
UbuntuCore {
major: u32,
minor: u32,
},
Debian {
version: Option<u32>,
},
Other {
id: String,
version_id: Option<String>,
id_like: Vec<String>,
},
}Expand description
Typed distro identity derived from OsRelease.
Variants§
Fedora
Plain Fedora (Workstation, Server, …).
FedoraSilverblue
Fedora Silverblue, Kinoite, or Sericea (immutable desktops).
Ubuntu
Ubuntu LTS or interim.
UbuntuCore
Ubuntu Core (IoT).
Debian
Debian.
Other
Any other distro — fields forwarded from OsRelease.
Implementations§
Source§impl DistroId
impl DistroId
Sourcepub fn family(&self) -> DistroFamily
pub fn family(&self) -> DistroFamily
Returns the broad family this distro belongs to.
§ID_LIKE fallback for unrecognised derivatives
When self is Other (the running distro’s ID did not match any
distro this crate detects directly — e.g. Linux Mint ID=linuxmint,
Pop!_OS ID=pop), this consults ID_LIKE before giving up: if it
contains "debian" or "ubuntu" the distro routes as
DistroFamily::Debian; if it contains "fedora" or "rhel" it
routes as DistroFamily::Fedora. This is best-effort derivative
support, not full compatibility validation — ID_LIKE is a hint
the distro maintainer supplies in /etc/os-release (see
os-release(5)), not a guarantee the derivative’s package manager,
repositories, or service names are wire-compatible with the parent.
Actions may still fail at execution time on a derivative that
diverges from its stated parent.
Sourcepub fn is_supported(&self) -> bool
pub fn is_supported(&self) -> bool
Returns true for distros and versions with a shipped action backend.
Support policy:
- Ubuntu 20.04 and later, every release: LTS and interim alike. Ubuntu is the supported platform, so eligibility must not depend on the LTS cadence — the apt, snap, ufw and netplan tooling every action drives is present across those releases.
- Fedora Atomic variants 41+ (Silverblue, Kinoite, and siblings) are
eligible too. The rpm-ostree action families work; the difference from
Ubuntu is validation effort, not support, because Ubuntu has far more
users. See
docs/distro-support.md.
§Eligibility is not validation coverage
This predicate answers “may SysKnife act on this host at all” — the
daemon refuses every mutating action when it is false. It is not a
claim that a release has been VM-validated; docs/distro-support.md
tracks validation tiers separately, and a release can be supported here
while listed as smoke-tested there.
Releases below 20.04 are excluded because they no longer receive Ubuntu
security updates. UbuntuCore is excluded for a structural reason
rather than an age one: it has no apt and a read-only root, so the
Debian-family action set cannot apply. Plain Fedora stays detectable so
the planner can explain the gap rather than fail opaquely.