Skip to main content

Module distro

Module distro 

Source
Expand description

Runtime distro detection.

Reads /etc/os-release once at startup and caches the result. All parts of the daemon that need to make distro-specific decisions (primarily the executor’s package management dispatch) call current().

§Design

Action names are universal — AddLayeredPackage means “install a package” regardless of distro. The commands that implement those actions differ: rpm-ostree on Fedora Atomic, apt on Ubuntu. The executor’s build_action_spec checks the distro and delegates to the appropriate action module.

Adding support for a new distro means:

  1. Add a variant here (e.g. ArchLinux).
  2. Update detect() to recognise it via ID= in /etc/os-release.
  3. Create crates/sysknife-daemon/src/actions/<distro>.rs with the distro-specific ActionSpec builders.
  4. Add match arms in executor::build_action_spec for the new variant.

See HACKING.md §18 for the full checklist.

Enums§

Distro
Detected Linux distribution family.

Functions§

current
Return the detected distro, cached after the first call.