Revision Date Author Comments
# 85e54f1b 05-Nov-2020 Jason Ling <jasonling@google.com>

version-handler: implement json parser

version-handler adds the following capability

- ipmi-flash blobs can add a "version" along with the required
nested properties. This enabl

version-handler: implement json parser

version-handler adds the following capability

- ipmi-flash blobs can add a "version" along with the required
nested properties. This enables versioning support for that
flash blob.
For instance,
{
"blob" : "/flash/sink_seq",
"version":{ //now a /version/sink_seq blob will appear
"handler": {
"type: : "file", //only file type is supported
"path" : "/tmp/version_info" // file contents
// contain textual version.
// Content returned on read
},
"actions":{
"open" : { //on open launch a systemd target
"type" : "systemd",
"unit" : "version.target"
}
}
}
}

In the above example (pretend that the rest of the required
firmware-handler fields are present) firmware handler will create the
normal ipmi-flash blobs needed for updating firmware.
The addition of the "version" section activates the version-handler
which exposes a blob named /version/sink_seq.

Opening /version/sink_seq will kick off the action specified. In this
case the systemd target version.target will be launched. This service
should retrieve the version information and then place the contents in
the file specified by handler - path (/tmp/version_info).

The user at this point can poll (stat) the blob until the meta-data
indicates that read data is ready.

A read can be issued for /version/sink_seq. What is returned will be the
contents of /tmp/version_info.

Signed-off-by: Jason Ling <jasonling@google.com>
Change-Id: I7cc7bec2e08b013c6b77f8dfd2a502272ad2d3bd

show more ...