- Jun 17, 2020
-
-
Simon McVittie authored
This is good for two reasons. In a Flatpak runtime, we will not be able to do tricks with arbitrary bind-mounts; if we want the host library stack, we will have to rewrite the mutable copy of the runtime to replace container libraries with symlinks into /run/host. Also, when not in a Flatpak runtime, having a mutable copy of the immutable runtime gives developers a chance to edit the runtime to inject workarounds or things they're testing. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Jun 16, 2020
-
-
Simon McVittie authored
If we're running locale-gen on the host system, we might as well just run it, without wrapping bwrap around it. This requires the new --output-dir option in p-v-locale-gen. To stay consistent, also move from bwrap --chdir DIR to p-v-locale-gen --output-dir DIR in the case where we still need to use bwrap. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
If the runtime is already "the right shape", then we don't need to use bwrap to mount it on /usr and populate a suitable tmpfs root filesystem. We need to do this if we want to support being run from inside a Flatpak, because we can't run bwrap inside Flatpak. It might also speed up accesses to suitable runtimes, because we won't waste time invoking extra bwrap processes. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
flatpak_canonicalize_filename() only does a syntactic normalization, eliminating ./ and similar constructs; it does not resolve symbolic links. We need to use the realpath() of the 64-bit dynamic linker, because otherwise, when we start replacing the dynamic linker in the container with a symlink into /run/host, the host system might have a symlink /lib64/ld-linux-x86-64.so.2 pointing outside /lib64, for example to /lib/ld-linux-x86-64-2.30.so. Then we'd get: runtime's ld-linux-x86-64.so.2 -> /run/host/lib64/ld-linux-x86-64.so.2 -> /lib/ld-linux-x86-64-2.30.so -> does not necessarily exist inside container Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
As noted in the comment, the order matters. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
This was using bwrap to make ${libdir}/dri available on /run/host/${libdir}/dri, in order to run the equivalent of: ln -fns /run/host/${libdir}/dri/* /overrides/lib/${tuple}/dri/ Instead of using the shell wildcard '*' to implement readdir(), let's just call readdir(${libdir}/dri) ourselves, and fix up the symlink targets to point into /run/host/${libdir}/dri. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
The PATH from outside the container doesn't really make sense inside the container, because the directory hierarchy could be totally different (particularly on unusual host systems like GoboLinux and Exherbo). Resetting it also makes sure we don't pick up local installations in ~/bin or ~/.local/bin, which could have dependencies that are unsatisfied in the container. Conversely, the PATH from the host might not include everything we need in the container. If the host system is an OS that only supports merged-/usr use, like Arch Linux, then it might not have both /usr/bin and /bin in the PATH - but if the container is not merged /usr, like a scout SDK sysroot, then we'll need both. This approximately matches Flatpak's behaviour: by default it resets PATH to /app/bin:/usr/bin (because it puts app-specific content in /app and can assume that its runtimes are always merged-/usr). Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Jun 12, 2020
-
-
Simon McVittie authored
This lets us hold a fd to the parent directory open and resolve paths relative to it (see openat(2)). Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
This is one of the slower parts of the whole process, and not all games (or automated tests) even need it. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- May 21, 2020
-
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Using only the 0th slot doesn't actually save us any memory, and being consistent about what the slots mean will make it easier to factor out common code. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
If we failed to bind the driver into the container, then we don't want to try to use it later. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
The entire setup for this call to `readlink -f` should have been removed when it was hoisted further up in bind_runtime() (and replaced with `readlink -e`) during commit 26b3be64, but in fact only the part that actually *ran* the wrapped readlink command was deleted. This also always leaked some memory. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- May 20, 2020
-
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- May 18, 2020
-
-
Simon McVittie authored
If we are on an OS where /sbin is not normally in unprivileged users' PATHs (for example Debian), we won't find ldconfig in PATH and will need to try harder. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Apr 15, 2020
-
-
Simon McVittie authored
We use the same GPtrArray to accumulate both i386 and x86_64 drivers, so ideally we allocate enough space for both and never have to reallocate it again. (But if we guess wrong, no harm done.) Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Even better than an assertion that crashes at runtime if we were wrong - an assertion that makes the build fail if we were wrong, so we can't release code where this assertion would fail. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Unlike EGL and Vulkan, we assign to these variables once per multiarch tuple, separately; so we need to free them once per multiarch tuple, too. Move their scope inwards so we can do that. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
If available, and newer, we bind VA-API drivers and loaders from the host system. Signed-off-by:
Ludovico de Nittis <ludovico.denittis@collabora.com>
-
- Apr 09, 2020
-
-
Ludovico de Nittis authored
If available, and newer, we bind VDPAU drivers from the host system. Signed-off-by:
Ludovico de Nittis <ludovico.denittis@collabora.com>
-
- Mar 24, 2020
-
-
Ludovico de Nittis authored
If we are using the host's libc, we also bind its `locale` otherwise it might happen that the container's `locale` will not be able to run. Signed-off-by:
Ludovico de Nittis <ludovico.denittis@collabora.com>
-
- Mar 23, 2020
-
-
Ludovico de Nittis authored
The container didn't have the host system's gconv modules, and the host system's glibc didn't use the Steam Runtime's older gconv modules because they weren't in the directory where it expected to find them. Now if we are using the host's glibc we also bind its gconv modules. Signed-off-by:
Ludovico de Nittis <ludovico.denittis@collabora.com>
-
- Mar 18, 2020
-
-
Ludovico de Nittis authored
If we are using the host's libc, we also bind its ldconfig otherwise it's likely that the container's ldconfig will not be able to run. Signed-off-by:
Ludovico de Nittis <ludovico.denittis@collabora.com>
-
- Mar 04, 2020
-
-
Simon McVittie authored
Now that we have this working, there's no real reason why we need a separate run per filename/SONAME pattern; we can just do them all at once, leaving only ICDs with more complicated requirements to be done separately. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
This makes it a bit clearer what's going on. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
In practice we always want the host graphics stack, but maybe this will be useful when debugging. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
This sketches out roughly how we'd do this if we were in a container such as a Flatpak environment, rather than on the host system. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
There's very little refactoring so far: bind_runtime() is still basically monolithic, and takes individual bits of PvRuntime's state rather than a PvRuntime object. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
wrap.c is getting rather large, so the idea is that this will encapsulate everything related to swapping in a different /usr. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-