diff --git a/tools/linuxfs/overlay/usr/local/bin/droiddeck-game-env b/tools/linuxfs/overlay/usr/local/bin/droiddeck-game-env index 82d877f8d8..cbe96fa3ce 100755 --- a/tools/linuxfs/overlay/usr/local/bin/droiddeck-game-env +++ b/tools/linuxfs/overlay/usr/local/bin/droiddeck-game-env @@ -1190,8 +1190,9 @@ def time_now(): return time.time() -def upscale_link(source, target): - """target = source's bytes: a hard link when both are on one file system, else a copy. Kept when equal.""" +def upscale_link(source, target, hard_link=True): + """target = source's bytes: a hard link when both are on one file system (and hard_link), else a copy. Kept when + equal.""" if os.path.isfile(target) and os.path.getsize(target) == os.path.getsize(source): with open(source, "rb") as a, open(target, "rb") as b: if a.read() == b.read(): @@ -1200,6 +1201,8 @@ def upscale_link(source, target): if os.path.lexists(staged): os.unlink(staged) try: + if not hard_link: + raise OSError("copy wanted") os.link(source, staged) except OSError: with open(source, "rb") as src, open(staged, "wb") as dst: @@ -1230,7 +1233,9 @@ def upscale_ngx_files(prefix, bridges, dlss): if not os.path.isfile(source): continue if dlss: - upscale_link(source, target) + # A copy, not a hard link: something writing over the prefix's nvapi64.dll in place must not change + # DroidDeck's staged bridge. + upscale_link(source, target, hard_link=False) elif os.path.isfile(target) and os.path.getsize(target) == os.path.getsize(source): with open(source, "rb") as a, open(target, "rb") as b: if a.read() == b.read():