stages/dnf: Remove random seed after dnf run
Some dnf packages introduce random seed file. If we leave in the tree it would mean all systems running from the created image would use the same random seed. This can be potentially dangerous, therefore we just remove the generated random seed from our images.
This commit is contained in:
parent
cc73fa5d10
commit
fd8eb9492f
1 changed files with 5 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import contextlib
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
|
|
@ -129,6 +129,10 @@ def main(tree, options):
|
|||
machine_id_file.unlink()
|
||||
machine_id_file.touch()
|
||||
|
||||
# remove random seed from the tree if exists
|
||||
with contextlib.suppress(FileNotFoundError):
|
||||
os.unlink(f"{tree}/var/lib/systemd/random-seed")
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue