I’m trying to understand how lxd creates directories with the right uid/gid from images when using the directory storage driver.
If I export my ubuntu image, I get a squashfs with uid/gid 0 for files owned by root.
However, when I create a container with the image, the rootfs directory has shifted uid’s/gid’s to match the idmap for the container.
How is that directory being created with the correct uid/gid? What code is responsible for this?