README-settings-manager.md
1# Settings Manager
2
3## Introduction
4
5The settings manager has the following design goals:
6
7- Each setting should be a distinct D-Bus object.
8
9- The above makes it possible to not even create settings objects that do not
10 apply to a specific system.
11
12- It should be possible, for example, for host0/ and host1/ on a system with two
13 hosts to not only have different values for certain settings, but have
14 different applicable settings as well.
15
16- It should be possible to specify default settings for a system at build-time,
17 based on which the settings manager should at run-time create appropriate
18 D-Bus objects and place them on the bus.
19
20## Settings policy file
21
22Some of the design goals above are achieved via a policy file, which is written
23in YAML. Based on this policy file, the settings manager code is generated to be
24able to create only relevant settings D-Bus objects along with specifying their
25defaults.
26
27Here's an example of how entries in the YAML would look:
28
29```yaml
30/xyz/openbmc_project/control/host0/boot_mode:
31 Interface: xyz.openbmc_project.Control.Boot.Mode
32 Defaults:
33 BootMode: Mode::Modes::Regular
34
35/xyz/openbmc_project/control/host1/boot_mode:
36 Interface: xyz.openbmc_project.Control.Boot.Mode
37 Defaults:
38 BootMode: Mode::Modes::Safe
39```
40
41It is possible to specify this policy file via a bitbake recipe for a system
42specific policy.
43
README.txt
1How to use 'query' in the YAML file
2'query' contains information for settings_manager.py to search for
3and match inventory objects:
4
5query:
6 name: type
7 keyregex: "dimm"
8 subtree: "/org/openbmc/inventory"
9 matchregex: "/(dimm\d*)$"
10
11In the example above setting_manager.py will explore all existing
12objects at /org/openbmc/inventory that relate to the 'dimm' main
13category in the YAML file.
14The 'matchregex' will identify all objects with names that start with 'dimm',
15followed by any number of digits. The name should be at the end of the path.
16settings_manager.py will create a corresponding object with the same name,
17which is a group (dimm\d*).
18