Since we never explicitly close these files, sometimes the stuff
we write to them doesn't seem to get flushed which causes the
files to be empty in the output directory. Add calls to flush()
to make sure the files aren't empty when mkosi finishes.
tempfile.NamedTemporaryFile(mode="w+b", prefix=".mkosi", dir=os.path.dirname(args.output_root_hash_file)),
)
f.write((root_hash + "\n").encode())
+ f.flush()
return f
),
)
f.write(root_hash_p7s)
+ f.flush()
return f
with open(args.nspawn_settings, "rb") as c:
f.write(c.read())
+ f.flush()
return f