# openbmc/phosphor-settingsd architecture

> Architecture diagram of the GitHub repository openbmc/phosphor-settingsd, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/openbmc/phosphor-settingsd
- Repository: https://github.com/openbmc/phosphor-settingsd

## Overview

This is an OpenBMC settings-manager service with a YAML-driven generation step and a long-running D-Bus daemon. The principal workflow is to parse a settings YAML file, render the manager header from a Mako template, then run the C++ service, which registers an ObjectManager, creates the settings Manager, and owns its bus name. The README describes query configuration for discovering and matching inventory objects. The template and runtime implementation are not excerpted, so their internal behavior and links to inventory are not detailed here.

Main entry points: [`settings.py`](https://github.com/openbmc/phosphor-settingsd/blob/master/settings.py) (YAML parser), [`settings_manager.hpp.mako`](https://github.com/openbmc/phosphor-settingsd/blob/master/settings_manager.hpp.mako) (Generated manager), [`settings_main.cpp`](https://github.com/openbmc/phosphor-settingsd/blob/master/settings_main.cpp) (Settings daemon), [`settings.yaml`](https://github.com/openbmc/phosphor-settingsd/blob/master/settings.yaml) (Settings YAML)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_configuration["Settings configuration"]
  node_settings_yaml["Settings YAML<br/>[settings.yaml]"]
  node_example_yaml["Example settings"]
end

subgraph group_generation["Header generation"]
  node_generator["YAML parser<br/>[settings.py]"]
  node_template["Manager template"]
  node_manager_header["Generated manager"]
end

subgraph group_runtime["D-Bus runtime"]
  node_daemon["Settings daemon<br/>[settings_main.cpp]"]
end

node_operator(("Service operator"))
node_dbus(("System D-Bus"))
node_inventory[("Inventory objects")]

node_operator -->|"runs"| node_generator
node_generator -->|"reads by default"| node_example_yaml
node_generator -->|"reads selected"| node_settings_yaml
node_generator -->|"renders"| node_template
node_generator -->|"writes"| node_manager_header
node_daemon -->|"includes"| node_manager_header
node_daemon -->|"registers objects; requests name"| node_dbus
node_inventory -.->|"query matches"| node_manager_header

click node_settings_yaml "https://github.com/openbmc/phosphor-settingsd/blob/master/settings.yaml"
click node_example_yaml "https://github.com/openbmc/phosphor-settingsd/blob/master/settings_example.yaml"
click node_generator "https://github.com/openbmc/phosphor-settingsd/blob/master/settings.py"
click node_template "https://github.com/openbmc/phosphor-settingsd/blob/master/settings_manager.hpp.mako"
click node_manager_header "https://github.com/openbmc/phosphor-settingsd/blob/master/settings_manager.hpp.mako"
click node_daemon "https://github.com/openbmc/phosphor-settingsd/blob/master/settings_main.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_settings_yaml,node_example_yaml toneBlue
class node_generator,node_template,node_manager_header,node_inventory toneAmber
class node_daemon toneMint
class node_operator,node_dbus toneIndigo
```

## Components

### Settings configuration

- [Settings YAML](https://github.com/openbmc/phosphor-settingsd/blob/master/settings.yaml): `settings.yaml`
- [Example settings](https://github.com/openbmc/phosphor-settingsd/blob/master/settings_example.yaml): `settings_example.yaml`

### Header generation

- [YAML parser](https://github.com/openbmc/phosphor-settingsd/blob/master/settings.py): `settings.py`
- [Manager template](https://github.com/openbmc/phosphor-settingsd/blob/master/settings_manager.hpp.mako): `settings_manager.hpp.mako`
- [Generated manager](https://github.com/openbmc/phosphor-settingsd/blob/master/settings_manager.hpp.mako): `settings_manager.hpp.mako`

### D-Bus runtime

- [Settings daemon](https://github.com/openbmc/phosphor-settingsd/blob/master/settings_main.cpp): `settings_main.cpp`

### Other components

- **Service operator**
- **System D-Bus**
- **Inventory objects**

## Connections

- Service operator → YAML parser: runs (evidence: `settings.py`)
- YAML parser → Example settings: reads by default (evidence: `settings.py`)
- YAML parser → Settings YAML: reads selected (evidence: `settings.py`)
- YAML parser → Manager template: renders (evidence: `settings.py`)
- YAML parser → Generated manager: writes (evidence: `settings.py`)
- Settings daemon → Generated manager: includes (evidence: `settings_main.cpp`)
- Settings daemon → System D-Bus: registers objects; requests name (evidence: `settings_main.cpp`)
- Inventory objects → Generated manager: query matches (evidence: `README.txt`)
