[oe-commits] [openembedded-core] 01/20: abi_version/sstatesig: Introduce HASHEQUIV_HASH_VERSION

git at git.openembedded.org git at git.openembedded.org
Tue Feb 25 11:03:15 UTC 2020


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 1c2d5aeae2fa2dfc16bc60b6cf0b310f826337fd
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Tue Feb 25 11:01:02 2020 +0000

    abi_version/sstatesig: Introduce HASHEQUIV_HASH_VERSION
    
    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 at 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 4964880..2bdc556 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 4325b66..d24e373 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

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list