Boot Linux games under the FEX compatibility tool again (#1100)

Valve's FEX opens rootfs paths with openat2(RESOLVE_IN_ROOT), which the
preload emulates under proot. droiddeck-fex's rootfs links to the Steam
runtimes with absolute paths outside the rootfs, so every lookup missed
and FEX fell back to the arm64 host files: x86 bash, and with it Stardew
Valley's launcher, failed on libdl.so.2. An absolute link whose target
is missing in the root but present on the host now finishes there.
This commit is contained in:
MaxsTechReview authored and GitHub committed 2026-10-18 20:38:08 -04:00
1 parent 7800d3d810
commit 48a70c8229
2 files changed
+47 -10

No files matched your search

+13
View File
@@ -208,6 +208,19 @@ static long openat_in_root(int dirfd, const char *path, int flags, long mode) {
}
memmove(pending + target_len, tail, rest_len + 1);
if (pending[0] == '/') {
char saved = pending[target_len];
pending[target_len] = 0;
const char *inside = pending;
while (*inside == '/') {
inside++;
}
bl_stat probe;
int host = *inside && real_syscall(BL_SYS_FSTATAT, (long)dirfd, (long)inside, (long)&probe, (long)AT_SYMLINK_NOFOLLOW) != 0 &&
errno == ENOENT && real_syscall(BL_SYS_FSTATAT, (long)AT_FDCWD, (long)pending, (long)&probe, 0L) == 0;
pending[target_len] = saved;
if (host) {
return real_syscall(SYS_openat, (long)AT_FDCWD, (long)pending, (long)flags, mode);
}
resolved_len = 0;
}
rest = pending;