buildroot: grant CAP_MAC_ADMIN for labeling

When applying labels inside the container that are unknown to the
host, the process needs to have the CAP_MAC_ADMIN capability in order
to do so, otherwise the kernel will prevent setting those unknown
labels. See the previous commit for more details.
This commit is contained in:
Christian Kellner 2020-06-09 12:18:12 +02:00 committed by Tom Gundersen
parent 7171eb2bf3
commit a419ee9038

View file

@ -112,6 +112,7 @@ class BuildRoot(contextlib.AbstractContextManager):
"--keep-unit",
"--as-pid2",
"--link-journal=no",
"--capability=CAP_MAC_ADMIN", # for SELinux labeling
f"--directory={self.root}",
"--setenv=PYTHONPATH=/run/osbuild/lib",
*[f"--bind-ro={b}" for b in nspawn_ro_binds],