mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-07 21:16:57 +02:00
We need to ship some PCR measurements alongside images in order to make it easier for admins to provide an appropriate policy. Add some tooling to generate the appropriate hashes during build, pack those into a zip file and upload it.
14 lines
325 B
Bash
Executable File
14 lines
325 B
Bash
Executable File
#!/usr/bin/python
|
|
|
|
import hashlib
|
|
import json
|
|
import os
|
|
import sys
|
|
|
|
path=sys.argv[1]
|
|
version=sys.argv[2]
|
|
|
|
with open(path, "rb") as f:
|
|
kernel = f.read()
|
|
print json.dumps({"9": {"binaryvalues": [{"prefix": "grub_linux", "values": [{"value": hashlib.sha1(kernel).hexdigest(), "description": "coreos-%s" % version}]}]}})
|