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