xref: /openbmc/phosphor-ipmi-flash/bmc/README.md (revision 166b4f19)
1# Format of Config file
2
3This document gives details about the format of the config file used by log,
4version and firmware handler. The config file is a .json file.
5
6### Parameters
7
8There are 3 important parameters in this config file
9
101. blob
112. handler
123. actions
13
14An example config file -
15
16```
17{
18    "blob": "/flash/adm1266_sink0",
19    "handler": {
20        "type": "file",
21        "path": "/var/run/adm1266/adm1266_sink0.hex"
22    },
23    "actions": {
24        "preparation": {
25            "type": "skip"
26        },
27        "verification": {
28            "type": "systemd",
29            "unit": "adm1266-verify@sink0.service"
30        },
31        "update": {
32            "type": "systemd",
33            "unit": "adm1266-update@sink0.service"
34        }
35    }
36}
37```
38
39#### blob
40
41This parameter defines the unique name of the blob. This parameter must be
42defined for each blob.
43
44#### handler
45
46A blob must have a handler with a type. Currently only "file" type is supported.
47With file type, a path of the handler file must be provided.
48
49#### actions
50
51"actions" define various steps to be performed and are required for each blob.
52These actions can be triggered from ipmi-blob commands. Currently there are 2
53types of actions supported: `systemd` to invoke a systemd service, or `skip` to
54not perform any action.
55
56### Workflow of log handler
57
58```
59{
60    "blob": "/log/blackbox_adm1266_sink0",
61    "handler": {
62        "type": "file",
63        "path": "/var/run/adm1266/adm1266_sink0.log"
64    },
65    "actions":{
66        "open": {
67            "type": "systemd",
68            "unit": "adm1266-read-blackbox-log@sink0.service"
69        },
70        "delete": {
71            "type": "systemd",
72            "unit": "adm1266-clear-blackbox-data@sink0.service"
73        }
74    }
75}
76```
77
78In this example the blob handler is the log file that will store the blackbox
79data from adm1266 and will be returned on BmcBlobRead.
80
81Here log_blob supports 2 actions. These actions are performed on the handler
82file.
83
841. `open` : adm1266-read-blackbox-log@sink0.service gets launched on BmcBlobOpen
85   command. This service should read the blackbox data from adm1266 and place
86   the into blob handler file. This also enables BmcBlobSessionStat command to
87   indicate that the blob is ready to read.
88
892. `delete` : adm1266-clear-blackbox-data@sink0.service gets launched on
90   BmcBlobDelete command. This service should delete the cached blackbox data in
91   the handler file and erase the blackbox data from adm1266.
92