Hardware Scripting and Device Drivers - sgml/signature GitHub Wiki

Lifecycle

-- Canonical Lifecycle States
CREATE TABLE lifecycle_state (
    state_code TEXT PRIMARY KEY,             -- e.g., 'active', 'qualified', 'retired'
    description TEXT NOT NULL,               -- Human-readable explanation
    is_terminal BOOLEAN DEFAULT 0            -- Marks if this is a terminal state
);

-- Software Artifact Registry
CREATE TABLE software_artifact (
    artifact_id TEXT PRIMARY KEY,            -- Unique identifier (e.g., hash, UUID)
    name TEXT NOT NULL,                      -- Human-readable name
    version TEXT NOT NULL,                   -- Semantic version or release tag
    current_state TEXT NOT NULL,             -- FK to lifecycle_state.state_code
    last_updated INTEGER DEFAULT (strftime('%s','now')), -- Unix epoch timestamp
    FOREIGN KEY (current_state) REFERENCES lifecycle_state(state_code)
);

-- Hardware Compatibility Mapping
CREATE TABLE hardware_binding (
    artifact_id TEXT NOT NULL,               -- FK to software_artifact
    hardware_model TEXT NOT NULL,            -- e.g., 'RouterModelX', 'AvionicsUnitY'
    compatibility_notes TEXT,                -- Optional constraints or caveats
    PRIMARY KEY (artifact_id, hardware_model),
    FOREIGN KEY (artifact_id) REFERENCES software_artifact(artifact_id)
);

-- State Transition Ledger
CREATE TABLE lifecycle_transition (
    transition_time INTEGER PRIMARY KEY,     -- Unix epoch timestamp
    artifact_id TEXT NOT NULL,               -- FK to software_artifact
    from_state TEXT,                         -- Nullable for initial state
    to_state TEXT NOT NULL,                  -- Must exist in lifecycle_state
    actor TEXT,                              -- Who/what initiated the transition
    FOREIGN KEY (to_state) REFERENCES lifecycle_state(state_code)
);

References

Telephony

MVNO

EMM386

Debian

Browsers

X11

Desktops

(replace-cinnamon
  (step-1-install-new-desktop
    (lxde
      (description "Ultra Lightweight")
      (commands
        "sudo apt update"
        "sudo apt install lxde"))
    (lxqt
      (description "Modern & Light")
      (commands
        "sudo apt update"
        "sudo apt install lxqt"))
    (xfce
      (description "Polished Yet Lightweight")
      (commands
        "sudo apt update"
        "sudo apt install xfce4 xfce4-goodies")))
  (step-2-switch-desktop
    (instructions
      "Log out of current session"
      "At login screen, select session (gear icon)"
      "Choose installed desktop environment"
      "Log back in"))
  (step-3-remove-cinnamon
    (uninstall
      (commands
        "sudo apt remove cinnamon-desktop-environment"
        "sudo apt autoremove --purge"))
    (remove-ppa
      (condition "If Cinnamon was installed via Linux Mint PPA")
      (command "sudo add-apt-repository --remove ppa:linuxmint-daily-build-team/daily-builds")))
  (optional-cleanup
    (restore-ubuntu-desktop
      (command "sudo apt install ubuntu-desktop"))
    (remove-session-entries
      (command "sudo rm /usr/share/xsessions/cinnamon*.desktop"))
    (fix-lock-screen-conflicts
      (command "gsettings set org.gnome.desktop.screensaver lock-enabled false")))
  (optional-benchmark-ram
    (tools ps_mem htop free-h)
    (note "Can assist with scripting session-based RAM audit")))