From 76bc0c236a6d1e2f1e27c56ac7a316fbe928f843 Mon Sep 17 00:00:00 2001 From: The412Banner <205237651+The412Banner@users.noreply.github.com> Date: Thu, 19 Nov 2026 20:11:58 -0500 Subject: [PATCH] fix(bionic): start bionic picks on DroidDeck-Proton when Run without proot is off DroidDeck-Bionic runs only without proot. With proot on, the wrapper every adopted tool gets now hands a launch sent to a DroidDeck-Bionic tool to the newest installed DroidDeck-Proton's own wrapper before any setup step runs, so the game starts as if that Proton had been picked: its components, DirectAudio and store steps apply to DroidDeck-Proton. Per-game picks and the default are left as set, so the games return to DroidDeck-Bionic once Run without proot is on again. Without an installed DroidDeck-Proton the tool still stops with its message. --- .../overlay/usr/local/bin/steam-compatibility | 17 +++++++- tools/tests/test_game_environment.py | 40 +++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/tools/linuxfs/overlay/usr/local/bin/steam-compatibility b/tools/linuxfs/overlay/usr/local/bin/steam-compatibility index 1e2ed26b19..210e8f7927 100755 --- a/tools/linuxfs/overlay/usr/local/bin/steam-compatibility +++ b/tools/linuxfs/overlay/usr/local/bin/steam-compatibility @@ -293,6 +293,21 @@ dd_vacdiag() { } """ +# DroidDeck-Bionic runs only without proot. With proot on, a launch Steam sends to a DroidDeck-Bionic tool goes to the +# newest DroidDeck-Proton's wrapper before anything else runs, as if that Proton had been picked; the picks stay as set. +DD_BIONIC_PROOT_FALLBACK = """ +if [ -f "$here/bionic/launch.sh" ] && [ -z "${DDNATV_ROOT:-}" ]; then + dd_fallback=$(cd "$here/.." 2>/dev/null && for d in DroidDeck-Proton*; do + [ -x "$d/droiddeck-proton-wrap" ] && [ ! -e "$d/bionic/launch.sh" ] || continue + v=${d#DroidDeck-Proton}; printf '%s\\t%s/%s\\n' "${v#[ -]}" "$PWD" "$d" + done | sort -V | tail -n 1 | cut -f 2-) + if [ -n "$dd_fallback" ]; then + echo "droiddeck-proton: DroidDeck-Bionic needs Run without proot; this launch uses ${dd_fallback##*/}" >&2 + exec "$dd_fallback/droiddeck-proton-wrap" "$verb" "$@" + fi +fi +""" + DD_DRIVER_QUERY_SKIP = """ case "$verb:${1##*/}:${STEAM_COMPAT_DATA_PATH%/}" in run:d3ddriverquery64.exe:*/compatdata/0 | run:d3ddriverquery.exe:*/compatdata/0) @@ -490,7 +505,7 @@ dd_run ${DD_TASKSET:-} /usr/local/bin/droiddeck-game-env "$DD_STORE_PROTON" "$ve def extra_wrapper_sh(entry_point): return (EXTRA_WRAPPER_SH % entry_point).replace( 'here=$(dirname "$0")', - 'here=$(dirname "$0")\n' + DD_DRIVER_QUERY_SKIP + DD_DESKTOP_GPU_SETUP + DD_DIRECTAUDIO_SETUP + DD_GAME_CPUS_SETUP + 'here=$(dirname "$0")\n' + DD_BIONIC_PROOT_FALLBACK + DD_DRIVER_QUERY_SKIP + DD_DESKTOP_GPU_SETUP + DD_DIRECTAUDIO_SETUP + DD_GAME_CPUS_SETUP + DD_IDTECH3_SETUP + DD_VACDIAG_SETUP + DD_COMPONENTS_SETUP + DD_LIBPATH_SETUP + DD_STORE_SETUP, 1) diff --git a/tools/tests/test_game_environment.py b/tools/tests/test_game_environment.py index 39cfc0becb..0b16d6df6d 100644 --- a/tools/tests/test_game_environment.py +++ b/tools/tests/test_game_environment.py @@ -2299,6 +2299,46 @@ class GameEnvironmentTest(unittest.TestCase): env=env, capture_output=True, text=True, check=True).stdout self.assertEqual(out, "continued\n", (verb, args, prefix)) + def test_bionic_tool_starts_droiddeck_proton_when_proot_is_on(self): + script = COMPAT["extra_wrapper_sh"]("proton") + with tempfile.TemporaryDirectory() as tmp: + tools = Path(tmp) / "compatibilitytools.d" + + def tool(name, bionic=False): + d = tools / name + (d / "bionic").mkdir(parents=True) + if bionic: + (d / "bionic" / "launch.sh").write_text("") + wrapper = d / "droiddeck-proton-wrap" + wrapper.write_text(script if bionic else '#!/bin/sh\necho "ran ${0%/*}" "$@"\n') + wrapper.chmod(0o755) + return wrapper + + bionic = tool("DroidDeck-Bionic-12.8-r37", bionic=True) + tool("DroidDeck-Proton 11-12.8") + tool("DroidDeck-Proton-11-12.10") + tool("DroidDeck-Proton-12.8-bionic-test", bionic=True) + tool("GE-Proton10-25") + base = {"PATH": os.defpath, "HOME": "/nonexistent"} + + def launch(extra=()): + env = dict(base, **dict(extra)) + return subprocess.run([str(bionic), "waitforexitandrun", "/games/A B/game.exe", "-x"], env=env, + capture_output=True, text=True, timeout=10) + + result = launch() + self.assertEqual(result.returncode, 0, result.stderr) + self.assertEqual(result.stdout, "ran %s waitforexitandrun /games/A B/game.exe -x\n" + % os.path.realpath(tools / "DroidDeck-Proton-11-12.10")) + self.assertIn("this launch uses DroidDeck-Proton-11-12.10", result.stderr) + + shutil.rmtree(tools / "DroidDeck-Proton-11-12.10") + self.assertIn("ran %s " % os.path.realpath(tools / "DroidDeck-Proton 11-12.8"), launch().stdout) + + self.assertNotIn("ran ", launch({"DDNATV_ROOT": "/data/rootfs"}).stdout) + shutil.rmtree(tools / "DroidDeck-Proton 11-12.8") + self.assertNotIn("this launch uses", launch().stderr) + def test_wrappers_preload_the_session_library_before_the_input_shim(self): overlay = "/root/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so" with tempfile.TemporaryDirectory() as tmp: