pv-runtime: Under FEX-Emu, bind-mounts x86 rootfs onto /run/host
While looking at #97 (moved) I noticed that /run/host
doesn't seem to be what we would "naturally" expect it to be.
To reproduce
Use pressure-vessel to run an x86 container on an aarch64 machine via FEX-Emu.
Expected result
/run/host
in the container should probably be ... the host, like its name says.
The FEX-Emu rootfs pseudo-overlayfs should be mounted on /run/gfx
and/or /run/pressure-vessel/interpreter-root/run/gfx
instead. (Implementation detail: currently it's mounted in both places.)
/etc/alternatives
should be a symlink to /run/host/etc/alternatives
, etc., which is the real host filesystem's /etc/alternatives
, etc., for the benefit of aarch64 processes inside the container.
Actual result
The FEX-Emu rootfs pseudo-overlayfs is mounted on /run/gfx
and /run/pressure-vessel/interpreter-root/run/gfx
as expected.
However, /run/host
is also the pseudo-overlayfs:
pressure-vessel-wrap D: --ro-bind /tmp/.FEXMount229021-ha4BfU/usr /run/host/usr
pressure-vessel-wrap D: --symlink usr/bin /run/host/bin
pressure-vessel-wrap D: --symlink usr/lib /run/host/lib
pressure-vessel-wrap D: --symlink usr/lib32 /run/host/lib32
pressure-vessel-wrap D: --symlink usr/lib64 /run/host/lib64
pressure-vessel-wrap D: --symlink usr/sbin /run/host/sbin
pressure-vessel-wrap D: --ro-bind /tmp/.FEXMount229021-ha4BfU/etc /run/host/etc
pressure-vessel-wrap D: --ro-bind /tmp/.FEXMount229021-ha4BfU/etc/os-release /run/host/os-release
That means these symlinks end up pointing to the wrong thing, even though the symlinks themselves are correct:
pressure-vessel-wrap D: '--symlink'
pressure-vessel-wrap D: '/run/host/etc/alternatives'
pressure-vessel-wrap D: '/etc/alternatives'
pressure-vessel-wrap D: '--symlink'
pressure-vessel-wrap D: '/run/host/etc/ld.so.cache'
pressure-vessel-wrap D: '/etc/ld.so.cache'
pressure-vessel-wrap D: '--symlink'
pressure-vessel-wrap D: '/run/host/etc/ld.so.conf'
pressure-vessel-wrap D: '/etc/ld.so.conf'
pressure-vessel-wrap D: '--symlink'
pressure-vessel-wrap D: '/run/host/etc/ld.so.conf.d'
pressure-vessel-wrap D: '/etc/ld.so.conf.d'
This might contribute to #97 (moved).