From 186d133cbc89a75fffa8eebe6f97ef65fa28f553 Mon Sep 17 00:00:00 2001 From: Job79 Date: Sat, 21 Nov 2026 20:53:45 +0100 Subject: [PATCH] fix: keep the mkosi workspace off overlayfs in the test container mkosi's copy_tree() leaves out all xattrs when it copies a tree with SELinux labels to overlayfs. In the podman test container the workspace was in /var/tmp on the container's overlayfs, and the cached tree has the host's SELinux labels, so newuidmap and newgidmap lost their file capabilities and rootless podman failed in the VM. A volume at /var/tmp avoids that. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01V27snrrx9tfCQvBpqtSPn3 --- AGENTS.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index c336734..c1b044e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -65,7 +65,7 @@ RUN dnf install -y mkosi git-core CMD ["/sbin/init"] END podman run -d --name mkosi --privileged --systemd=always -v :/repo \ - -v mkosi-cache:/root/.cache/mkosi -w /repo mkosi-vm + -v mkosi-cache:/root/.cache/mkosi -v mkosi-work:/var/tmp -w /repo mkosi-vm podman exec mkosi mkosi genkey # Run this once, if there is no mkosi.key. podman exec -d -t mkosi sh -c 'mkosi -f vm > mkosi.output/vm.log 2>&1' podman exec mkosi mkosi ssh -- systemctl --failed @@ -74,6 +74,10 @@ podman exec mkosi mkosi ssh -- systemctl --failed podman resolves paths on the host, so `` is the repository's path there. The volume `mkosi-cache` keeps mkosi's package cache when the container is made again, so builds don't download every package anew. +The volume `mkosi-work` keeps mkosi's workspace in /var/tmp off the +container's overlayfs. mkosi copies a tree with SELinux labels (as files from +the host have) to overlayfs without any xattrs. That drops the file +capabilities of newuidmap and newgidmap, and rootless podman fails in the VM. `mkosi vm` needs a terminal, hence `-d -t`; its console goes to the log. `mkosi ssh` runs a command as root, once the VM has booted. For the user `agent`, run `su - agent -c ''`.