From f493010eae020620da81fbe553af3e76565e8e9f Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Wed, 18 Jan 2023 22:17:26 +0000 Subject: [PATCH 1/2] scripts/xtensa-build-zephyr.py: checksum [sof_]version.h files `git describe` differences happen, especially when trying to optimize cloning and this is for instance what happened in https://github.com/thesofproject/sof/pull/6950#issuecomment-1396150533 where zephyr tags were fetched on Linux but not on Windows This also makes plain git version differences more obvious; no need to scroll all the way up and scan the build logs. Signed-off-by: Marc Herbert --- scripts/xtensa-build-zephyr.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/xtensa-build-zephyr.py b/scripts/xtensa-build-zephyr.py index 529c1e85045e..c69b1366ad35 100755 --- a/scripts/xtensa-build-zephyr.py +++ b/scripts/xtensa-build-zephyr.py @@ -761,6 +761,10 @@ class InstFile: # Fail if one of these is missing InstFile(".config", "config", txt=True), InstFile("misc/generated/configs.c", "generated_configs.c", txt=True), + InstFile("include/generated/version.h", "zephyr_version.h", + gzip=False, txt=True), + InstFile("include/generated/sof_versions.h", "sof_versions.h", + gzip=False, txt=True), InstFile(BIN_NAME + ".elf"), InstFile(BIN_NAME + ".lst", txt=True), InstFile(BIN_NAME + ".map", txt=True), @@ -822,6 +826,7 @@ class InstFile: CHECKSUM_WANTED = [ '*.ri', # Some .ri files have a non-deterministic signature, others not + '*version*.h', '*configs.c', # deterministic unlike .config '*.strip', '*stripped*', # stripped ELF files are reproducible 'boot.mod', # no debug section -> no need to strip this ELF From 7014a0ef4cb88dd357cac09ef2de5d988fa1e21f Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Wed, 25 Jan 2023 01:35:21 +0000 Subject: [PATCH 2/2] xtensa-build-zephyr.py: checksum dsp_basefw.bin When using --fw-naming AVS the .ri file is renamed to `dsp_basefw.bin`. Also explain why it's still useful to identify non-deterministic images. Signed-off-by: Marc Herbert --- scripts/xtensa-build-zephyr.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/xtensa-build-zephyr.py b/scripts/xtensa-build-zephyr.py index c69b1366ad35..77a43b73fdb3 100755 --- a/scripts/xtensa-build-zephyr.py +++ b/scripts/xtensa-build-zephyr.py @@ -825,7 +825,12 @@ class InstFile: BIN_NAME = 'zephyr' CHECKSUM_WANTED = [ - '*.ri', # Some .ri files have a non-deterministic signature, others not + # Some .ri files have a deterministic signature, others use + # a cryptographic salt. Even for the latter a checksum is still + # useful to match an artefact with a specific build log. + '*.ri', + 'dsp_basefw.bin', + '*version*.h', '*configs.c', # deterministic unlike .config '*.strip', '*stripped*', # stripped ELF files are reproducible