diff --git a/stages/org.osbuild.selinux b/stages/org.osbuild.selinux index 5a579521..2ca277e7 100755 --- a/stages/org.osbuild.selinux +++ b/stages/org.osbuild.selinux @@ -21,6 +21,7 @@ may not match the tree's policy. import os +import pathlib import subprocess import sys @@ -41,6 +42,11 @@ SCHEMA = """ "items": { "type": "object" } + }, + "force_autorelabel": { + "type": "boolean", + "description": "Do not use. Forces auto-relabelling on first boot.", + "default": false } } """ @@ -56,6 +62,10 @@ def main(tree, options): fullpath = os.path.join(tree, path.lstrip("/")) subprocess.run(["chcon", "-v", label, fullpath], check=True) + if options.get("force_autorelabel", False): + stamp = pathlib.Path(tree, ".autorelabel") + stamp.touch() + if __name__ == '__main__': args = osbuild.api.arguments()