From 7457cd3b1a5f3ed4a566bbf23e36c939af06967c Mon Sep 17 00:00:00 2001 From: Georgy Yakovlev Date: Thu, 4 Nov 2021 19:14:00 -0700 Subject: catalyst: generate .sha256 file if any digest is enabled checksum format is simple one, identical to one sha256sum from coreutils produces, lines starting with # are ignored. example:[1] # SHA256 HASH xxxx..... stage3-....tar.xz systemd upstream calls it suse-style .sha256 files.[0] infra already supports inline signing of files. Bug: https://bugs.gentoo.org/821568 [0] https://github.com/systemd/systemd/blob/aedec452b9e5dd197881f2164fb205dfe8bfdcec/src/import/pull-common.c#L236 [1] https://mirrors.edge.kernel.org/opensuse/distribution/leap/15.0/iso/openSUSE-Leap-15.0-DVD-x86_64.iso.sha256 Signed-off-by: Georgy Yakovlev --- catalyst/base/genbase.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'catalyst') diff --git a/catalyst/base/genbase.py b/catalyst/base/genbase.py index 6d039a8f..1643b1dc 100644 --- a/catalyst/base/genbase.py +++ b/catalyst/base/genbase.py @@ -43,3 +43,6 @@ class GenBase(): for f in [path, path + '.CONTENTS.gz']: for i in self.settings['digests']: file.write(self.generate_hash(f, name=i)) + + with io.open(path + '.sha256', 'w', encoding='utf-8') as sha256file: + sha256file.write(self.generate_hash(path, name='sha256')) -- cgit v1.2.3-65-gdbad