IF Commons GitHub

governance/platform

Written to: 2 requirements: 2 proved, 0 partly, 0 failing, 0 with no test recorded. 0004-linux-observe-platform FR-001, 0004-linux-observe-platform FR-002

What kind of machine a Linux machine is: its family (the way its packages are managed), its distribution, its release and its architecture. The family is the fact the rest depends on: a dialect carries a package by the program of the family, and an observation reads it by the program of the family.

import { familyOf } from "./platform.ts";
familyOf("rocky", "rhel centos fedora"); // "rhel"

Source: commons/linux-observe/src/governance/platform.ts

1 of 16 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

governance.ARCHITECTURESconstno test imports it
const ARCHITECTURES: readonly ["x86_64", "aarch64"]

The architectures of a machine, as uname -m names them for the ones in use.

governance.FAMILIESconstno test imports it
const FAMILIES: readonly ["debian", "rhel", "suse", "arch"]

The families of Linux that Archon tells apart, by how packages are managed: debian (dpkg and apt), rhel (rpm and dnf), suse (rpm and zypper), arch (pacman).

governance.FAMILY_OF_IDconstno test imports it
const FAMILY_OF_ID: Readonly<Record<string, "arch" | "debian" | "rhel" | "suse">>

The families by the ID of a distribution. The ones a distribution derives from are found by ID_LIKE where the ID is not here.

governance.familyOffunctionno test imports it
function familyOf(id: string, idLike?: string): "arch" | "debian" | "rhel" | "suse" | undefined

The family of a distribution from the ID and the ID_LIKE of its os-release, or nothing where neither is one Archon knows (it is then said, never guessed).

governance.Architecturetypeno test imports it
type Architecture = (typeof ARCHITECTURES)[number];

An architecture.

governance.Declaredtypeno test imports it
type Declared = { readonly family: Family; readonly distro: string; readonly release: string; readonly arch: Architecture };

What the model declares of a machine: the same, with the architecture always said. Whether it is a server or a workstation is the kind of its asset, said once there.

governance.Familytypeno test imports it
type Family = (typeof FAMILIES)[number];

A family.

governance.Observedtypeno test imports it
type Observed = { readonly family: Family; readonly distro: string; readonly release: string; readonly arch?: Architecture };

What is read of a machine: its family, the ID and VERSION_ID of /etc/os-release, and the architecture where it was asked.

ARCHITECTURESconstno test imports it
const ARCHITECTURES: readonly ["x86_64", "aarch64"]

The architectures of a machine, as uname -m names them for the ones in use.

FAMILIESconstno test imports it
const FAMILIES: readonly ["debian", "rhel", "suse", "arch"]

The families of Linux that Archon tells apart, by how packages are managed: debian (dpkg and apt), rhel (rpm and dnf), suse (rpm and zypper), arch (pacman).

FAMILY_OF_IDconstno test imports it
const FAMILY_OF_ID: Readonly<Record<string, "arch" | "debian" | "rhel" | "suse">>

The families by the ID of a distribution. The ones a distribution derives from are found by ID_LIKE where the ID is not here.

familyOffunction
function familyOf(id: string, idLike?: string): "arch" | "debian" | "rhel" | "suse" | undefined

The family of a distribution from the ID and the ID_LIKE of its os-release, or nothing where neither is one Archon knows (it is then said, never guessed).

Imported by 3 tests of the run (3 passed, 0 failed): the library's results

Architecturetypeno test imports it
type Architecture = (typeof ARCHITECTURES)[number];

An architecture.

Declaredtypeno test imports it
type Declared = { readonly family: Family; readonly distro: string; readonly release: string; readonly arch: Architecture };

What the model declares of a machine: the same, with the architecture always said. Whether it is a server or a workstation is the kind of its asset, said once there.

Familytypeno test imports it
type Family = (typeof FAMILIES)[number];

A family.

Observedtypeno test imports it
type Observed = { readonly family: Family; readonly distro: string; readonly release: string; readonly arch?: Architecture };

What is read of a machine: its family, the ID and VERSION_ID of /etc/os-release, and the architecture where it was asked.

Titles, headings, exports, tables, columns and requirements. Esc closes.