Follow-up to 7d95564f7 (review, and a Pocket FIT test of its pack):
- 7d95564f7 kept every start of a file in the app's data here. Wine's preloader is one (a static ELF,
so execshim.c cannot make it a linker64 start), and where SELinux is permissive, as on AYANEO's
firmware, it runs: Wine then never reached its loader, and its programs ran here, counted again
(Pocket FIT: Brawlhalla 26-28 counted vs 16-17 before). Where SELinux enforces, Android refuses the
exec, here and in a worker alike, and Wine falls back to its loader, which goes as a linker64 start.
Such a start is now handed off when /sys/fs/selinux/enforce reads 0, and stays here otherwise
(also when the setting cannot be read).
- The program a start would run is checked with the hook's own ddh_startable() (an ELF the kernel
loads with its interpreter there, or a script with its interpreter): for a linker64 start, the
program it loads.
- A file name without '/' stays here: env would look it up in PATH, the exec here in the caller's
working directory.
- execvpe() skips a PATH entry whose candidate exceeds PATH_MAX (ENAMETOOLONG) instead of copying
it onto the stack.
Review follow-ups on the bionic runtime's handoff (tools/bionic-runtime/handoff.c):
- A start is handed to a worker only when it would get past execve() in this process: the file is a
regular executable outside the app's data (Android refuses execve() there), and for a linker64 start
the program it loads is a readable regular file. A start that failed in the worker failed where the
caller could not see it, so Wine never tried its next candidate. The hook's own check looked at
/system/bin/env, not the program.
- A start whose argv[0] is not its file stays here: env starts FILE with FILE as argv[0]. linker64 and
interpreter starts are unaffected (their argv[0] is the file). An empty argv stays here too.
- Nothing is built for the handoff without DD_SPAWN and DD_HANDOFF.
- execvp()/execvpe()/execlp() follow bionic's: an unset PATH is libc's default, an empty PATH or entry
is the current directory, and a file the kernel cannot start (ENOEXEC) runs under /system/bin/sh.
- close_range() refuses first > last and unknown flags before it splits the range or unshares the table.
- The debug line reads the table's owner only once the table is seen published.
Brings the PR up to main fcd197934 (124 commits), without conflicts: the bionic
runtime pack now builds against the 11-14.1 layer (build.sh LAYER_URL v18) and
launch.sh carries main's changes since (WINE_NEW_NDIS, steam_pid) with the
handoff's.
The glibc session's hook never sees DroidDeck-Bionic's processes (Wine on
Android's libc), so a bionic game's Wine programs all stayed counted under the
worker running the tool's launch.sh. The handoff is now built into the
runtime's exec shim (tools/bionic-runtime/handoff.c, part of libexecshim.so):
- hook/handoff.c and hook/kept.c with what the native hook's other parts do
around them: fork(), close(), close_range(), dup2(), dup3(), and exit() for
the on_exit() bionic lacks
- bionic's execv(), execvp(), execl*() reach the execve system call inside
libc, past execshim's execve(); Wine starts its preloader with execv(), so
the shim defines them on top of its execve()
- a linker64 start is listed by its program
- the app starts a handed-off program from the glibc root's bash, which cannot
load the runtime's LD_PRELOAD/LD_LIBRARY_PATH: they go as arguments of
/system/bin/env, which puts them back for the program
- launch.sh keeps DD_SPAWN, DD_SPAWN_SESSION, DD_HANDOFF*, DDH_* and
DDNATV_ROOT, and its /proc/N/environ reads no longer print "Permission
denied" for idle workers (2>/dev/null before the redirect)
Pocket FIT, DroidDeck-Bionic 14.1-r67 with this shim and launcher, handoff on:
counted during Brawlhalla 25 -> 17, DiRT Showdown 24-27 -> 16, whole run
28 -> 19-20; with Android's limit on no DroidDeck process and no other app's
process was killed (before: Discord, BatteryLog helpers); DiRT 75 fps either
way. docs/phantom-processes.md: "The bionic runtime".
winegstreamer puts a capssetter, from the debug plugin, at the front of
every video stream's conversion chain. Wine creates it by name at run
time, so check-needed.py, which follows linked libraries, could not
catch the missing plugin, and those videos played nothing on Bionic.
The tool still packed the 12.8 layer (v16-unwind). The v18 layer is the build
of DroidDeck-Proton 11-14.1 Bannerlator ships: Valve Wine a47c73f52fd7, the
GE-Proton11-14 picks, and the ARM64EC code-map and unwind fixes 12.8 carried.
Same layout as 12.8 (three more files), so only the pin changes. Tools are
named DroidDeck-Bionic-14.1-rN; the app's version compare offers 14.1 over 12.8.
* fix(bionic): run games from a DroidDeck-Proton prefix that start through a launcher
Europa Universalis IV, moved from DroidDeck-Proton to DroidDeck-Bionic, never got past its launcher:
- The network adapter list (GetAdaptersAddresses) never answered with the layer's default if_nameindex code, so the
Paradox Launcher waited forever. launch.sh sets WINE_NEW_NDIS=1 (the layer's getifaddrs code); a game's
environment can still set 0.
- The game reported "Steam not detected": the prefix still named Proton's steam.exe (PID 0x20) as Steam's running
client, and here that PID is the program Steam started, which quits after starting the game. launch.sh writes
the PID this tool's own prefixes carry (0xfffe) before Wine starts.
- Its Workshop mod was missing: DroidDeck-Proton's s: drive names the guest path of the Steam library, which this
Wine cannot follow. proton gives the prefix's guest drive links their Android paths for the launch; a session's
start gives them their guest paths back.
* fix(bionic): give each launch its own temporary file for the registry and drive rewrites
DroidDeck-Bionic: a Steam compatibility tool that runs the game itself on Android's libc (bionic) instead of glibc inside proot. Steam, the stores and the session stay on DroidDeck's Linux side; only the game process leaves proot.
- Listed in the Proton list only when Run without proot is on, in its own row. Its builds are pre-releases on Droid-Deck/DroidDeck-Proton (DroidDeck-Bionic-12.8-rNN, runtime built by .github/workflows/build-bionic-runtime.yml from tools/bionic-runtime); the app installs and updates them like the other extra tools and never makes one the default unless the user picks it.
- With proot on, a launch sent to a bionic tool goes to the newest DroidDeck-Proton (picks stay as set).
- ProtonExtras / ProtonMenu / ExperimentalProtons / droiddeck-proton-extra: bionic pre-releases checked and listed only without proot; updates carry the default and per-game picks over; deleting a tool never follows links out of it. ProtonDefault: picks left on an older bionic build move to the installed one.
- Components: FEX builds for bionic (bionic-stable on DroidDeck-Components); each tool is offered only the FEX builds that fit it.
- Session logs: the bionic game log and its graphics logs are part of Share logs.
Synced with main twice before the merge (latest sync fbed69ce on main 67b82ad9; Build APK and validation green); a local trial merge on main 3e1fc3e6 had no conflicts and the game-environment, Proton-extra and store-launch tests pass.