Files
qdl/read.h
T
Igor Opaniuk 05e4bb9904 qdl: add sha256 subcommand
Expose the FIREHOSE_OP_GET_SHA256_DIGEST primitive as a user-facing
verb. The syntax mirrors the existing read / write / erase verbs and
reuses parse_storage_address(), so addresses can be expressed as
<P>/<S>+<L>, by GPT partition name, or any of the other supported
forms.

Each invocation prints one lowercase 64-character hex digest per region
to stdout, so the output can be diffed against a sha256sum(1) line or
piped into other tooling without further parsing.

Typical use is verifying that what is on the device matches a known
local image - useful on shared bench machines where multiple people
flash the same board:

$ qdl prog_firehose_ddr.elf sha256 xbl_a
...
c288e50a94687a130a64db608c83678777ce5e7f9229248696c6f0dc41406cc9

$ qdl prog_firehose_ddr.elf read xbl_a xbl_a.bin
...
$ sha256sum xbl_a.bin
c288e50a94687a130a64db608c83678777ce5e7f9229248696c6f0dc41406cc9

Multiple sha256 verbs can be chained in a single invocation, with one
digest line emitted per region in order.

[1] https://github.com/linux-msm/qdl/issues/237

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
2026-05-14 21:41:45 -05:00

17 lines
407 B
C

/* SPDX-License-Identifier: BSD-3-Clause */
#ifndef __READ_H__
#define __READ_H__
#include <stdbool.h>
#include "list.h"
struct qdl_device;
struct firehose_op;
int read_op_load(struct list_head *ops, const char *read_op_file, const char *incdir);
int read_cmd_add(struct list_head *ops, const char *address, const char *filename);
int sha256_cmd_add(struct list_head *ops, const char *address);
#endif