]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Start virtiofsd with --security-label 2250/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 8 Jan 2024 10:32:27 +0000 (11:32 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 8 Jan 2024 10:34:03 +0000 (11:34 +0100)
This makes sure selinux relabeling works as expected when booting
off virtiofs

mkosi/qemu.py

index 68ed168bece56008c08853df8b4d3b845e6be73b..fbf403b67de711a2bd7d07d7c469922d9e78993f 100644 (file)
@@ -322,6 +322,9 @@ def start_virtiofsd(config: Config, directory: Path, *, uidmap: bool) -> Iterato
         "--sandbox=chroot",
     ]
 
+    if not uidmap:
+        cmdline += ["--security-label"]
+
     # We create the socket ourselves and pass the fd to virtiofsd to avoid race conditions where we start qemu
     # before virtiofsd has had the chance to create the socket (or where we try to chown it first).
     with (