If there's files in /usr in the package manager tree, we need to
be running as root to mount an overlayfs on top of /usr so make
sure we are always root in the Context sandbox.
devices=devices,
scripts=scripts,
options=[
+ "--uid", "0",
+ "--gid", "0",
+ "--cap-add", "ALL",
# These mounts are writable so bubblewrap can create extra directories or symlinks inside of it as
# needed. This isn't a problem as the package manager directory is created by mkosi and thrown away
# when the build finishes.
*cls.mounts(context),
*sources,
"--chdir", "/work/src",
- # pacman will fail unless invoked as root so make sure we're uid/gid 0 in the sandbox.
- "--uid", "0",
- "--gid", "0",
],
) + (apivfs_cmd(context.root) if apivfs else [])
),