mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-21 22:05:59 +00:00
refactor: Steam always runs in Deck mode on the Deck beta branch (#546)
This commit is contained in:
1 parent
a2e596a200
commit
b47302eb8c
19 files changed
+45
-247
No files matched your search
@@ -264,12 +264,12 @@ if [ -z "${BL_INSIDE:-}" ]; then
|
||||
[ "${BL_HDR:-0}" = 1 ] && args+=(--hdr-enabled)
|
||||
# Extra gamescope arguments for an experiment (--debug-focus, say), from Download/droiddeck-env.
|
||||
[ -n "${BL_GAMESCOPE_ARGS:-}" ] && read -r -a _bl_extra <<<"$BL_GAMESCOPE_ARGS" && args+=("${_bl_extra[@]}")
|
||||
# Deck mode's performance overlay (Quick Access Menu → Performance → Overlay Level) is drawn by
|
||||
# The performance overlay (Quick Access Menu → Performance → Overlay Level) is drawn by
|
||||
# mangoapp, which gamescope starts beside the client; the client sets the level by rewriting
|
||||
# MANGOHUD_CONFIGFILE. The apk stages Valve's aarch64 build (tools/mangoapp) - without it the menu
|
||||
# still offers the levels and nothing appears. Starts hidden until the client writes a level.
|
||||
# BL_MANGOAPP=0 turns it off (one community build found Valve's mangoapp crashing on Turnip).
|
||||
if [ "$mode" = steam ] && [ "${BL_STEAMDECK:-0}" = 1 ] && [ "${BL_MANGOAPP:-1}" = 1 ] \
|
||||
if [ "$mode" = steam ] && [ "${BL_MANGOAPP:-1}" = 1 ] \
|
||||
&& [ "${BL_STEAM_UI:-}" != desktop ] && command -v mangoapp >/dev/null 2>&1; then
|
||||
MANGOHUD_CONFIGFILE=$(mktemp /tmp/mangohud.XXXXXXXX)
|
||||
echo no_display > "$MANGOHUD_CONFIGFILE"
|
||||
@@ -821,7 +821,7 @@ BUSCONF
|
||||
# desktop's launchers ask for; gamescope shows one window at a time and the game takes over.
|
||||
_bl_ui=(-gamepadui)
|
||||
[ "${BL_STEAM_UI:-}" = desktop ] && _bl_ui=()
|
||||
# Deck mode (BL_STEAMDECK=1, the Steam page's Client settings): -steamdeck is the flag that puts
|
||||
# Deck mode, always outside the desktop UI: -steamdeck is the flag that puts
|
||||
# the Quick Access Menu and the Deck settings pages on screen; the QAM's performance overlay
|
||||
# controls stay greyed out without -steamos3, as SteamOS and Armada launch it. -steamos3 makes
|
||||
# the client manage itself as SteamOS does - it calls steamos-select-branch and writes
|
||||
@@ -829,7 +829,7 @@ BUSCONF
|
||||
# is an update that never installs: exit 42, a restart, for ever (Bannerlator 38996ea1). The
|
||||
# loop below puts package/beta back before every start. The SteamOS helpers the client calls
|
||||
# in this mode are staged as no-op stubs under /usr/bin.
|
||||
if [ "${BL_STEAMDECK:-0}" = 1 ] && [ "${BL_STEAM_UI:-}" != desktop ]; then
|
||||
if [ "${BL_STEAM_UI:-}" != desktop ]; then
|
||||
_bl_ui+=(-steamdeck -steamos3)
|
||||
# The QAM's Scaling Filter lists NVIDIA Image Scaling only when told gamescope has it (it does).
|
||||
export STEAM_GAMESCOPE_NIS_SUPPORTED=1
|
||||
@@ -851,13 +851,16 @@ BUSCONF
|
||||
[ -n "$_stale" ] && echo "== steam: cleared what an earlier session left:$_stale"
|
||||
unset _stale _f
|
||||
fi
|
||||
# Use the same configured branch as the first-run download. Whatever wrote package/beta, the branch on
|
||||
# disk has to agree with the one forced here - a disagreement is the restart loop above, and
|
||||
# it is silent apart from rc=42 in this log.
|
||||
# The Deck's beta branch, the one the first-run download takes: with -steamos3 on publicbeta
|
||||
# the client settled on steamdeck_stable, an older client it then offered as a "Software
|
||||
# Update" every session (2026-09-30); on steamdeck_publicbeta it finds no update. Whatever
|
||||
# wrote package/beta, the branch on disk has to agree with the one forced here - a
|
||||
# disagreement is the restart loop above, and it is silent apart from rc=42 in this log. A
|
||||
# client installed from publicbeta by an older app moves over this way at its next start.
|
||||
# Checked before every start, not once: the client rewrites package/beta during its own run,
|
||||
# and a restart below (rc=42, or the one after the ARM64 Proton lands) would otherwise start it
|
||||
# again on the branch it just wrote.
|
||||
steam_channel=${BL_STEAM_CHANNEL:-steamdeck_publicbeta}
|
||||
steam_channel=steamdeck_publicbeta
|
||||
# The app's language (Setup, or the system's): the client's interface takes -language over its
|
||||
# registry, and the registry is rewritten before each start below for its update window.
|
||||
_bl_lang=()
|
||||
|
||||
@@ -3,11 +3,9 @@
|
||||
# The client is not redistributable, so the runtime ships this script instead of the client.
|
||||
set -eu
|
||||
cdn=https://client-update.fastly.steamstatic.com
|
||||
steam_channel=${BL_STEAM_CHANNEL:-steamdeck_publicbeta}
|
||||
case "$steam_channel" in
|
||||
publicbeta|steamdeck_publicbeta) ;;
|
||||
*) echo "droiddeck-steam-install: unsupported Steam channel: $steam_channel" >&2; exit 1 ;;
|
||||
esac
|
||||
# The Deck's beta branch, which droiddeck-session forces on the command line too. A client already
|
||||
# on disk from another branch is left for the client to move (droiddeck-session's package/beta).
|
||||
steam_channel=steamdeck_publicbeta
|
||||
manifest=steam_client_${steam_channel}_linuxarm64
|
||||
steam_root=${XDG_DATA_HOME:-$HOME/.local/share}/Steam
|
||||
stamp=$steam_root/package/droiddeck-installed
|
||||
|
||||
@@ -45,8 +45,7 @@ cp "$TEST_CDN/${2##*/}" "$4"
|
||||
self.env = dict(os.environ, HOME=str(self.home), XDG_DATA_HOME=str(self.data),
|
||||
PATH=str(self.bin) + os.pathsep + os.environ['PATH'],
|
||||
TEST_CDN=str(self.cdn), TEST_REQUESTS=str(self.requests))
|
||||
self.env.pop('BL_STEAM_CHANNEL', None)
|
||||
for channel in ('publicbeta', 'steamdeck_publicbeta'):
|
||||
for channel in ('steamdeck_publicbeta',):
|
||||
archive = self.cdn / (channel + '.zip')
|
||||
with zipfile.ZipFile(archive, 'w') as package:
|
||||
package.writestr('steamrtarm64/steam', channel)
|
||||
@@ -58,14 +57,11 @@ cp "$TEST_CDN/${2##*/}" "$4"
|
||||
f'\t\t"file" "{archive.name}"\n\t\t"sha2" "{digest}"\n'
|
||||
'\t}\n}\n')
|
||||
|
||||
def install(self, channel=None):
|
||||
env = self.env.copy()
|
||||
if channel is not None:
|
||||
env['BL_STEAM_CHANNEL'] = channel
|
||||
return subprocess.run(['bash', str(SCRIPT)], env=env, text=True, capture_output=True)
|
||||
def install(self):
|
||||
return subprocess.run(['bash', str(SCRIPT)], env=self.env, text=True, capture_output=True)
|
||||
|
||||
def assert_installed(self, channel):
|
||||
result = self.install(channel)
|
||||
def assert_installed(self, channel='steamdeck_publicbeta'):
|
||||
result = self.install()
|
||||
self.assertEqual(0, result.returncode, result.stderr)
|
||||
self.assertEqual(channel + '\n', (self.steam / 'package/beta').read_text())
|
||||
self.assertEqual('123456\n', (self.steam / 'package/droiddeck-installed').read_text())
|
||||
@@ -78,38 +74,31 @@ cp "$TEST_CDN/${2##*/}" "$4"
|
||||
'https://client-update.fastly.steamstatic.com/' + channel + '.zip',
|
||||
], self.requests.read_text().splitlines())
|
||||
|
||||
def test_unset_channel_downloads_deck_beta(self):
|
||||
def test_downloads_the_deck_beta_client(self):
|
||||
self.assert_installed()
|
||||
|
||||
def test_an_install_from_another_branch_is_left_for_steam_to_move(self):
|
||||
# An older app could install publicbeta; droiddeck-session moves the client at its start.
|
||||
self.assert_installed()
|
||||
requests = self.requests.read_text()
|
||||
(self.steam / 'package/beta').write_text('publicbeta\n')
|
||||
result = self.install()
|
||||
self.assertEqual(0, result.returncode, result.stderr)
|
||||
self.assertEqual('steamdeck_publicbeta\n', (self.steam / 'package/beta').read_text())
|
||||
self.assertIn('/steam_client_steamdeck_publicbeta_linuxarm64\n', self.requests.read_text())
|
||||
|
||||
def test_explicit_deck_beta_downloads_matching_client(self):
|
||||
self.assert_installed('steamdeck_publicbeta')
|
||||
|
||||
def test_explicit_public_beta_downloads_matching_client(self):
|
||||
self.assert_installed('publicbeta')
|
||||
|
||||
def test_existing_install_is_left_for_steam_to_update(self):
|
||||
self.assert_installed('steamdeck_publicbeta')
|
||||
requests = self.requests.read_text()
|
||||
result = self.install('publicbeta')
|
||||
self.assertEqual(0, result.returncode, result.stderr)
|
||||
self.assertEqual(requests, self.requests.read_text())
|
||||
self.assertEqual('steamdeck_publicbeta\n', (self.steam / 'package/beta').read_text())
|
||||
|
||||
def test_failed_download_has_no_ready_marker_and_can_retry(self):
|
||||
archive = self.cdn / 'publicbeta.zip'
|
||||
original = archive.read_bytes()
|
||||
archive.write_bytes(b'corrupt download')
|
||||
self.assertNotEqual(0, self.install('publicbeta').returncode)
|
||||
self.assertFalse((self.steam / 'package/droiddeck-installed').exists())
|
||||
archive.write_bytes(original)
|
||||
self.assertEqual(0, self.install('publicbeta').returncode)
|
||||
self.assertEqual('publicbeta\n', (self.steam / 'package/beta').read_text())
|
||||
|
||||
def test_failed_download_has_no_ready_marker_and_can_retry(self):
|
||||
archive = self.cdn / 'steamdeck_publicbeta.zip'
|
||||
original = archive.read_bytes()
|
||||
archive.write_bytes(b'corrupt download')
|
||||
self.assertNotEqual(0, self.install().returncode)
|
||||
self.assertFalse((self.steam / 'package/droiddeck-installed').exists())
|
||||
archive.write_bytes(original)
|
||||
self.assertEqual(0, self.install().returncode)
|
||||
self.assertEqual('steamdeck_publicbeta\n', (self.steam / 'package/beta').read_text())
|
||||
|
||||
def break_client(self, starts):
|
||||
self.assert_installed('steamdeck_publicbeta')
|
||||
self.assert_installed()
|
||||
self.requests.unlink()
|
||||
package = self.steam / 'package'
|
||||
(self.steam / 'steamrtarm64/steam').write_text('half updated')
|
||||
@@ -125,7 +114,7 @@ cp "$TEST_CDN/${2##*/}" "$4"
|
||||
|
||||
def test_two_starts_with_nothing_shown_fetch_the_client_again(self):
|
||||
package = self.break_client(2)
|
||||
self.assert_installed('steamdeck_publicbeta')
|
||||
self.assert_installed()
|
||||
self.assertEqual('repaired\n', (package / 'droiddeck-unconfirmed').read_text())
|
||||
self.assertFalse((self.steam / '.crash').exists())
|
||||
self.assertEqual([], sorted(p.name for p in package.glob('steam_client_*')))
|
||||
@@ -161,18 +150,12 @@ cp "$TEST_CDN/${2##*/}" "$4"
|
||||
self.assertFalse((package / 'droiddeck-installed').exists())
|
||||
archive.write_bytes(original)
|
||||
self.requests.unlink()
|
||||
self.assert_installed('steamdeck_publicbeta')
|
||||
self.assert_installed()
|
||||
self.assertFalse(request.exists())
|
||||
self.requests.unlink()
|
||||
self.assertEqual(0, self.install().returncode)
|
||||
self.assertFalse(self.requests.exists())
|
||||
|
||||
def test_invalid_channel_fails_before_any_download(self):
|
||||
result = self.install('../unknown')
|
||||
self.assertNotEqual(0, result.returncode)
|
||||
self.assertIn('unsupported Steam channel', result.stderr)
|
||||
self.assertFalse(self.requests.exists())
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user