mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-05 20:45:43 +00:00
The CI build now also assembles DroidDeck-Bionic-<layer>-r<run>, a Steam compatibility tool in Proton's layout: the bionic layer (bin, lib, share), its prefix template (drives C: and Z: only), FEX 2611.1 with Android-built unix libraries, DXVK 2.4.1 gplasync and VKD3D-Proton 3.1 (DroidDeck components can swap these), and the runtime pack, as a .tar.xz with a sha512sum. All inputs are sha256-pinned. - execshim.c (runtime pack preload): from targetSdk 29 Android refuses execve() of app data files but the system linker still runs them, so execve()/posix_spawn() of a dynamic /data ELF with interpreter linker64 becomes "linker64 <file> args" and "#!" scripts start their interpreter; static ELFs pass through (Wine then falls back from wine-preloader to its loader). realpath/readlink of /proc/self/exe answer with the program linker64 runs, because wineserver finds its NLS files next to its executable. - tool/proton (guest): run/waitforexitandrun/runinprefix/getcompatpath/getnativepath; no-proot only; guest paths to Android paths via DDNATV_BINDS; hands over to bionic/launch.sh. - tool/launch.sh (Android sh): Steam/input variables kept, DroidDeck's chosen Turnip (Android half), Wayland adapter + gamescope WSI layer, ntsync, FEX, DXVK/VKD3D overrides, runtime-pack paths (no fontconfig), Steam pad as an Xbox 360 pad; prefix setup in compatdata/pfx (template for new prefixes, builtin links for this layer replacing other Protons' links and Wine builtin copies but keeping native DLLs, users/xuser linked to steamuser, black desktop); every start through linker64 + execshim; STEAM_GAME window tag; leftover cleanup. Tested by hand on a Pocket FIT (DroidDeck 0.7.1, no-proot) with a locally assembled copy of this layout: DroidDeck adopted the tool, Steam started DiRT Showdown on it, prefix set up in 38 s, benchmark completed, clean exit. Known: DiRT Showdown picks 1024x768 instead of its configured 1280x720 under this Wine (open).
47 lines
1.8 KiB
Bash
47 lines
1.8 KiB
Bash
#!/bin/bash
|
|
# DroidDeck-Bionic: a Steam compatibility tool that runs Windows games on the bionic (Android libc) Proton layer
|
|
# under files/, outside the Linux userland. Steam calls it inside DroidDeck's no-proot guest; it turns guest paths
|
|
# into Android paths and hands over to bionic/launch.sh, an Android /system/bin/sh script.
|
|
# Verbs: run/waitforexitandrun (start the game), runinprefix (run a program in the prefix), getcompatpath/
|
|
# getnativepath (path conversion); the rest are accepted and ignored.
|
|
set -u
|
|
verb=${1:-}
|
|
[ $# -gt 0 ] && shift
|
|
|
|
if [ -z "${DDNATV_ROOT:-}" ]; then
|
|
echo "DroidDeck-Bionic needs Settings > Run without proot" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# guest path -> Android path: the longest no-proot bind whose guest side starts the path, else inside the rootfs
|
|
real() {
|
|
local p="$1" best="" host="" b g h
|
|
local -a binds
|
|
IFS='|' read -r -a binds <<< "${DDNATV_BINDS:-}"
|
|
for b in "${binds[@]}"; do
|
|
h="${b%%:*}"; g="${b#*:}"
|
|
case "$p" in "$g"|"$g"/*) [ ${#g} -gt ${#best} ] && { best="$g"; host="$h"; } ;; esac
|
|
done
|
|
if [ -n "$best" ]; then echo "$host${p#"$best"}"; return; fi
|
|
case "$p" in /data/*|/storage/*|/sdcard/*|/system/*|/apex/*|/vendor/*) echo "$p" ;; *) echo "$DDNATV_ROOT$p" ;; esac
|
|
}
|
|
|
|
here=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
tool=$(real "$here")
|
|
compat=$(real "${STEAM_COMPAT_DATA_PATH:-$HOME/.local/share/Steam/steamapps/compatdata/0}")
|
|
|
|
case "$verb" in
|
|
run|waitforexitandrun|runinprefix)
|
|
[ $# -gt 0 ] || exit 0
|
|
exe=$(real "$1"); shift
|
|
export DROIDDECK_BIONIC_ROOT="$DDNATV_ROOT"
|
|
exec /system/bin/sh "$tool/bionic/launch.sh" "$verb" "$compat" "$exe" "$@" ;;
|
|
getcompatpath)
|
|
p=$(real "${1:-}")
|
|
printf 'Z:%s\n' "${p//\//\\}" ;;
|
|
getnativepath)
|
|
p=${1:-}; p=${p#[Zz]:}; p=${p//\\//}
|
|
echo "$p" ;;
|
|
*) exit 0 ;;
|
|
esac
|