mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-25 07:46:01 +00:00
feat(bionic): DroidDeck-Bionic compatibility tool (Wine on Android's libc, no proot)
DroidDeck-Bionic is a Steam compatibility tool that runs the game itself with Android's own libc (bionic) instead of glibc inside proot. Steam, the stores and the session stay on DroidDeck's Linux side unchanged; only the game process leaves proot. It is listed in the Proton list only when "Run without proot" is on, and it is shipped as a pre-release runtime pack (DroidDeck-Bionic-12.8-rNN on Droid-Deck/DroidDeck-Proton), never as the default for other users. Runtime pack (tools/bionic-runtime, .github/workflows/build-bionic-runtime.yml) - CI builds an aarch64 bionic pack: the Wine layer from The412Banner/proton-wine (bionic build), an exec shim, launcher (tool/launch.sh + proton verbs run, runinprefix, waitforexitandrun), gamescope's WSI layer (patches 0117 + 0119), DroidDeck's GPU-load layer, fake input (fakeinput_steam.cpp), GStreamer plugins, Zink/Fast OpenGL Mesa, DXVK, VKD3D-Proton, D7VK and FEX (ARM64EC). - Games run on gamescope's X server; Steam store games reach DroidDeck's Steam (lsteamclient), Steam Input works (shared /dev/shm via libsteamshm), and Steam Cloud maps Windows save folders (tool name contains "Proton"). - DroidDeck's game settings, game-environment fixes, in-game layers and DXVK / VKD3D / FEX choices reach bionic games the same way they reach DroidDeck-Proton games (DD_* setting names). - Prefixes stay compatible both ways with DroidDeck-Proton: dead links are removed, the tool's .NET stubs and comctl32 v6 survive Wine updates, a stale FEX code cache from another FEX build is cleared, drive Z: is the whole device. - Store launches: Xbox (Windows exe path + Xbox runtime environment), GOG and Epic (.bat launchers, games that rename their process). App changes (all additive) - ProtonExtras / ProtonMenu / ExperimentalProtons / droiddeck-proton-extra: DroidDeck-Bionic pre-releases are checked and listed only with Run without proot on, in their own row (not under Experimental); updates replace the older build and carry the default tool and per-game picks over; deleting a tool removes links inside it, never what they point to. - ProtonDefault: a default or game pick left on an older bionic build moves to the installed one; bionic picks start on DroidDeck-Proton when Run without proot is off. - ComponentsManager / ComponentUpdates / ComponentUpdater / ComponentsPage / SessionOverlay: FEX components for DroidDeck-Bionic (bionic-stable on DroidDeck-Components); each tool is offered only FEX builds that fit it. - SessionService: DROIDDECK_DISPLAY_DRIVER tells bionic games which Turnip the display uses when the chosen runtime driver has no Android build. - steam-compatibility: with proot on, a launch sent to a DroidDeck-Bionic tool goes to the newest DroidDeck-Proton (picks stay as set); glibc FEX rows are never applied to a DroidDeck-Bionic tool. - droiddeck-game-env: Steam's install-script evaluator is skipped when its scripts only run processes already marked as done. Tests - New: ComponentsBionicFexTest; extended ComponentsRepublishTest, ExperimentalProtonsTest, ProtonDefaultTest, ProtonExtrasTest, test_game_environment.py, test_proton_extra.py. Device testing (Pocket FIT, Adreno 750; Pocket FIT Elite, Adreno 830) - Steam (Brawlhalla online, Left 4 Dead 2 controller, Black Ops II, Steam Cloud), Xbox, GOG, Epic and Amazon games run; saves carry both ways between DroidDeck-Bionic and DroidDeck-Proton on Xbox, GOG, Epic and Amazon. - Not tested: EA, Ubisoft, Battle.net (no owned game / not signed in).
This commit is contained in:
1 parent
6ef8e2274e
commit
dca443e3aa
40 files changed
+2829
-68
No files matched your search
Executable
+123
@@ -0,0 +1,123 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Checks that every library an ELF file in the bionic runtime pack needs is in the pack, in --available
|
||||
(the Proton layer's lib/, on the library path at run time) or on Android.
|
||||
|
||||
usage: check-needed.py <llvm-readelf> <pack dir> [--available DIR]... [--fill IMAGEFS_LIB] [--prune SUBDIR]
|
||||
--fill copies missing libraries (and the links on the way to them) from IMAGEFS_LIB into <pack>/lib, repeatedly
|
||||
--prune deletes ELF files under <pack>/SUBDIR that still miss a library (plugins nothing else links to)
|
||||
Exits 1 when anything is still missing."""
|
||||
import argparse
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
# Android's own libraries (/system/lib64, /apex) the pack may rely on.
|
||||
ANDROID = {
|
||||
"libc.so", "libm.so", "libdl.so", "liblog.so", "libz.so", "libandroid.so", "libnativewindow.so", "libsync.so",
|
||||
"libEGL.so", "libGLESv1_CM.so", "libGLESv2.so", "libGLESv3.so", "libvulkan.so", "libaaudio.so", "libOpenSLES.so",
|
||||
"libmediandk.so", "libjnigraphics.so", "libcamera2ndk.so", "libbinder_ndk.so", "ld-android.so",
|
||||
}
|
||||
# Known gaps, loaded only for features the first version does not cover.
|
||||
OPTIONAL = {
|
||||
"libGL.so.1", # OpenGL games; a dangling link in the pinned imagefs
|
||||
"libodbc.so", # odbc32
|
||||
}
|
||||
|
||||
|
||||
def elf_files(pack):
|
||||
for root, _, files in os.walk(pack):
|
||||
for f in files:
|
||||
path = os.path.join(root, f)
|
||||
if os.path.islink(path) or not os.path.isfile(path):
|
||||
continue
|
||||
with open(path, "rb") as fh:
|
||||
if fh.read(4) == b"\x7fELF":
|
||||
yield path
|
||||
|
||||
|
||||
def needed(readelf, path):
|
||||
out = subprocess.run([readelf, "-d", path], capture_output=True, text=True).stdout
|
||||
return [l.split("[", 1)[1].split("]", 1)[0] for l in out.splitlines() if "(NEEDED)" in l]
|
||||
|
||||
|
||||
def names_in(*dirs):
|
||||
names = set()
|
||||
for d in dirs:
|
||||
for _, _, files in os.walk(d):
|
||||
names.update(files)
|
||||
return names
|
||||
|
||||
|
||||
def missing_map(readelf, pack, available):
|
||||
have = names_in(pack, *available)
|
||||
missing = {}
|
||||
for path in elf_files(pack):
|
||||
for lib in needed(readelf, path):
|
||||
if lib not in have and lib not in ANDROID and lib not in OPTIONAL:
|
||||
missing.setdefault(lib, []).append(path)
|
||||
return missing
|
||||
|
||||
|
||||
def copy_from(img, name, dest):
|
||||
"""Copies img/name into dest, keeping relative links; False when absent or one of Android's (absolute link)."""
|
||||
src = os.path.join(img, name)
|
||||
if not os.path.lexists(src):
|
||||
return False
|
||||
while os.path.islink(src):
|
||||
target = os.readlink(src)
|
||||
if target.startswith("/"):
|
||||
return False
|
||||
link = os.path.join(dest, os.path.basename(src))
|
||||
if not os.path.lexists(link):
|
||||
os.symlink(os.path.basename(target), link)
|
||||
src = os.path.join(os.path.dirname(src), target)
|
||||
if not os.path.exists(src):
|
||||
return False
|
||||
out = os.path.join(dest, os.path.basename(src))
|
||||
if not os.path.exists(out):
|
||||
shutil.copy2(src, out)
|
||||
return True
|
||||
|
||||
|
||||
def main():
|
||||
ap = argparse.ArgumentParser()
|
||||
ap.add_argument("readelf")
|
||||
ap.add_argument("pack")
|
||||
ap.add_argument("--available", action="append", default=[])
|
||||
ap.add_argument("--fill")
|
||||
ap.add_argument("--prune")
|
||||
a = ap.parse_args()
|
||||
|
||||
if a.fill:
|
||||
added = []
|
||||
while True:
|
||||
missing = missing_map(a.readelf, a.pack, a.available)
|
||||
new = [lib for lib in sorted(missing) if copy_from(a.fill, lib, os.path.join(a.pack, "lib"))]
|
||||
if not new:
|
||||
break
|
||||
added += new
|
||||
print(f"added from the imagefs: {len(added)} ({', '.join(added)})" if added else "added from the imagefs: none")
|
||||
|
||||
if a.prune:
|
||||
prune_root = os.path.join(a.pack, a.prune)
|
||||
while True:
|
||||
missing = missing_map(a.readelf, a.pack, a.available)
|
||||
doomed = {p for users in missing.values() for p in users if p.startswith(prune_root + os.sep)}
|
||||
if not doomed:
|
||||
break
|
||||
for p in sorted(doomed):
|
||||
libs = sorted(l for l, users in missing.items() if p in users)
|
||||
print(f"pruned {os.path.relpath(p, a.pack)}: missing {', '.join(libs)}")
|
||||
os.remove(p)
|
||||
|
||||
missing = missing_map(a.readelf, a.pack, a.available)
|
||||
for lib, users in sorted(missing.items()):
|
||||
print(f"missing {lib}: needed by {', '.join(sorted(os.path.relpath(u, a.pack) for u in users)[:5])}")
|
||||
if missing:
|
||||
sys.exit(1)
|
||||
print("all needed libraries present")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in new issue
Block a user