[2/3] doc: handlers: add readback handler documentation
diff mbox series

Message ID 20200116161205.12973-3-mark.jonas@de.bosch.com
State Changes Requested
Headers show
Series
  • Add readback handler for partition verify
Related show

Commit Message

'Pierre-Jean Texier' via swupdate Jan. 16, 2020, 4:12 p.m. UTC
From: Kevin Zhang <Kevin.Zhang3@cn.bosch.com>

Signed-off-by: Kevin Zhang <kevin.zhang3@cn.bosch.com>
Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com>
---
 doc/source/handlers.rst | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

Patch
diff mbox series

diff --git a/doc/source/handlers.rst b/doc/source/handlers.rst
index 6b694af..e7182ba 100644
--- a/doc/source/handlers.rst
+++ b/doc/source/handlers.rst
@@ -642,4 +642,42 @@  of the two SSBL administration.
    |             |          | when this SSBL is set.                             |
    +-------------+----------+----------------------------------------------------+
 
+Readback Handler
+----------------
 
+To verify that an image was written properly, this readback handler calculates
+the sha256 hash of a partition (or part of it) and compares it against a given
+hash value.
+
+The following example explains how to use this handler:
+
+::
+    scripts: (
+    {
+        device = "/dev/mmcblk2p1";
+        type = "readback";
+        properties: {
+            sha256 = "e7afc9bd98afd4eb7d8325196d21f1ecc0c8864d6342bfc6b6b6c84eac86eb42";
+            size = "184728576";
+            offset = "0";
+        };
+    }
+    );
+
+All properties are mandatory.
+
+.. table:: Properties for readback handler
+
+    +-------------+----------+----------------------------------------------------+
+    |  Name       |  Type    |  Description                                       |
+    +=============+==========+====================================================+
+    | device      | string   | The partition which shall be verified.             |
+    +-------------+----------+----------------------------------------------------+
+    | type        | string   | Identifier for the handler.                        |
+    +-------------+----------+----------------------------------------------------+
+    | sha256      | string   | Expected sha256 hash of the partition.             |
+    +-------------+----------+----------------------------------------------------+
+    | size        | string   | Data size (in bytes) to be verified.               |
+    +-------------+----------+----------------------------------------------------+
+    | offset      | string   | Offset (in bytes) to the start of the partition.   |
+    +-------------+----------+----------------------------------------------------+