]> code.ossystems Code Review - openembedded-core.git/commitdiff
abi_version/sstatesig: Introduce HASHEQUIV_HASH_VERSION
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 25 Feb 2020 11:01:02 +0000 (11:01 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 25 Feb 2020 11:01:09 +0000 (11:01 +0000)
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
meta/lib/oe/sstatesig.py

index 49648801089e93c97da59a942ab3a549496f1afe..2bdc55695bd988fae15f34abc744a24a4f6bc187 100644 (file)
@@ -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"
index 4325b66a9ee03781b9156b1463c62d11d0c2ac0c..d24e3738aeb54debab3305df6a8ff5ee8da368ac 100644 (file)
@@ -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