Print out some information from the Signed package info extension, the most
important information being is the partition_usage which is used to select
key slot to be used for verification.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Fixes this error:
```
No platform found in name "sof-rpl.ri"; unknown memory layout.
```
... and shows the Memory Layout.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2 small changes required:
- Stop calling sys.exit(1) in case of error not to exit the importer
- Change EraseVars() to return the checksum value instead of printing
it. Move the print() to the main() function
This is required by the new sof-bin tests that compare signed with
unsigned binaries; submitted in
https://github.com/thesofproject/sof-bin/pull/105
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
As reported by Bartosz, Python 3.5.2 fails with the relatively cryptic
TypeError: invalid file: PosixPath('sof-tgl.ri'). Make this failure much
less cryptic.
As of December 2021 Python 3.5 is completely out of support and 3.6 will
be soon https://www.python.org/downloads/
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
sof_ri_info.py --erase_vars reproducible.ri sof.ri
replaces variable fields (signature and date right now) by constants.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Signature and date are (for now) the only variable fields when
re-signing with the same tool so their locations matter.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
stderr is often highlighted with a different color.
This also makes the usual >/dev/null redirection possible.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
File offsets were critical in finding the serious begin_off bug fixed in
the same series. The information is already there so just show it.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Fixes the adsp_mft_cse_entry Component added by
commit 8885b465df ("tools: sof-ri-info: move parsing adsp mft outside
cse mft").
`adsp_mft_cse_entry.entry_file_offset` did not account for the extended
manifest.
Also fix the large `reader.ext_mft_length + entry_offset`
copy/paste/diverge
That variable did not seem to be used anywhere yet but it's wrong value
was confusing and time-consuming when debugging.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
For sof-tgl.ri and sof-tgl-h.ri the old match function will
always return tgl layout. Add suffix in match to make sure
we always match the right name.
Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
It is a special --no_cse mode useful in case the cse part is
unparsable for any reason. Cse manifest parsing is skipped and
Adsp part is parsed only.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Running with -v option now gives more information about
the parsing progress which makes debug easier.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
CSS Manifest header must be created with file offset adjusted
by extended manifest size to loop through extensions correctly.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Strings are padded with zeroes in the binary input file,
so rstrip used after decode removes them, otherwise such
a string cuts the output if inserted as argument in the
middle.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Information about modules memory occupation is displayed
when memory layout of the target platform is known
(determined by the fw binary name).
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Additional parameters added:
no_modules - works like previous 'headers' option where
modules are excluded from output
no_headers - excludes cse manifest headers from output
and dumps info about the adsp modules only
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
There might be binaries where cse mft is not included.
And adsp mft begins at std offset 0x2000 from the optional
extended manifest.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
This tool must be able to read extended manifest content
and move to next manifest in proper way.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Script is meant to be used as standalone tool,
so it should have executable file attribute.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
A public key signature of community key used to sign FW
binaries is added. The script can provide on output info if
evaluated FW image was signed with the key.
Signed-off-by: Lech Betlej <lech.betlej@linux.intel.com>
Detailed information from Platform Fx Extension, part
of the manifest may be useful for a deeper signed image
analysis.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
A public key signature of Intel production key used to sign APL
binaries is added. The script can provide on output info if
evaluated FW image was signed with the key.
Signed-off-by: Lech Betlej <lech.betlej@linux.intel.com>
This script parses manifests included in sof binary and prints
extracted metadata in readable form.
It is particularly useful to get information about image signature
parameters.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>