* [PATCH] abi_version/sstatesig: Introduce HASHEQUIV_HASH_VERSION
@ 2020-02-26 4:57 Richard Purdie
0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2020-02-26 4:57 UTC (permalink / raw)
To: openembedded-core
We've found we need a way to cause a change in signatures and move
to a new hash 'namespace' with hashequiv. This introduces a variable
which allows us to do this.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
meta/conf/abi_version.conf | 8 ++++++++
meta/lib/oe/sstatesig.py | 3 +++
2 files changed, 11 insertions(+)
diff --git a/meta/conf/abi_version.conf b/meta/conf/abi_version.conf
index 49648801089..2bdc55695bd 100644
--- a/meta/conf/abi_version.conf
+++ b/meta/conf/abi_version.conf
@@ -5,3 +5,11 @@
# with general agreement from the core team.
#
OELAYOUT_ABI = "12"
+
+#
+# HASHEQUIV_HASH_VERSION is injected into the output hash calculation used by
+# hashequiv. Changing this means previous hashes will no longer match, allowing
+# a reset of the equivalence, for example when reproducibility issues break the
+# existing match data. Distros can also append to this value for the same effect.
+#
+HASHEQUIV_HASH_VERSION = "1"
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index 4325b66a9ee..d24e3738aeb 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -477,11 +477,14 @@ def OEOuthashBasic(path, sigfile, task, d):
h = hashlib.sha256()
prev_dir = os.getcwd()
include_owners = os.environ.get('PSEUDO_DISABLED') == '0'
+ extra_content = d.getVar('HASHEQUIV_HASH_VERSION')
try:
os.chdir(path)
update_hash("OEOuthashBasic\n")
+ if extra_content:
+ update_hash(extra_content + "\n")
# It is only currently useful to get equivalent hashes for things that
# can be restored from sstate. Since the sstate object is named using
--
2.25.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-02-26 4:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-26 4:57 [PATCH] abi_version/sstatesig: Introduce HASHEQUIV_HASH_VERSION Richard Purdie
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.