mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 04:46:08 +00:00
fix: fall back to Valve's stable Steam client when the beta one keeps failing
The native arm64 client follows steamdeck_publicbeta, so a Valve beta regression reaches every user at once. If the repaired beta client is still started twice without being shown, or the beta manifest carries no arm64 client, droiddeck-steam-install now installs steamdeck_stable, keeps it, and logs why (listing the manifest's blocks in the second case). The session asks the installer for the channel, so -clientbeta and package/beta stay in sync. BL_STEAM_CHANNEL or ~/.config/droiddeck/steam-channel (beta|stable) pins it. Valve's 2026-10-15 beta moved the x86 client into a Steam Runtime container. In case the arm64 client follows, its session now exports STEAM_STEAMRT_RECURSION_GUARD=1 and, only if steamrtarm64 carries pv-runtime or a steam-runtime-check-requirements probe, starts it through the same steamrt shim the x86-64 client uses (now droiddeck-steamrt-shim) and logs it.
This commit is contained in:
1 parent
b88eebe09b
commit
7aeb7779bb
9 files changed
+379
-65
No files matched your search
@@ -403,6 +403,11 @@ case $mode in
|
||||
droiddeck-steam-x64 --sync-login || true
|
||||
fi
|
||||
steam_client=("$steam_root/steamrtarm64/steam")
|
||||
_bl_srt_shim=$HOME/.droiddeck-steamrt-shim
|
||||
if droiddeck-steamrt-shim "$steam_root/steamrtarm64" "$_bl_srt_shim"; then
|
||||
echo "== steam: Valve containerized the arm64 Steam client (it carries a Steam Runtime container); starting it through $_bl_srt_shim"
|
||||
steam_client=(env STEAM_RUNTIME_STEAMRT="$_bl_srt_shim" PATH="$_bl_srt_shim/bin:$PATH" "${steam_client[@]}")
|
||||
fi
|
||||
fi
|
||||
_bl_proton_root=$steam_root
|
||||
if [ "$steam_x64" = 1 ]; then
|
||||
@@ -746,10 +751,13 @@ BUSCONF
|
||||
fi
|
||||
|
||||
# The UI bridge launches SteamVR, which needs the guest agent's library environment.
|
||||
_bl_compat_env=(env -u LD_LIBRARY_PATH -u STEAM_RUNTIME)
|
||||
_bl_compat_env=(env -u LD_LIBRARY_PATH -u STEAM_RUNTIME -u STEAM_STEAMRT_RECURSION_GUARD)
|
||||
[ "${LD_LIBRARY_PATH+x}" ] && _bl_compat_env+=("LD_LIBRARY_PATH=$LD_LIBRARY_PATH")
|
||||
[ "${STEAM_RUNTIME+x}" ] && _bl_compat_env+=("STEAM_RUNTIME=$STEAM_RUNTIME")
|
||||
[ "${STEAM_STEAMRT_RECURSION_GUARD+x}" ] && _bl_compat_env+=("STEAM_STEAMRT_RECURSION_GUARD=$STEAM_STEAMRT_RECURSION_GUARD")
|
||||
export STEAM_RUNTIME=1
|
||||
# A containerized client re-executes itself through pressure-vessel-wrap (bwrap) unless told it is already inside.
|
||||
export STEAM_STEAMRT_RECURSION_GUARD=1
|
||||
export LD_LIBRARY_PATH=$steam_root/steamrtarm64:$steam_root/steamrtarm64/panorama${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
|
||||
export SDL_VIDEO_X11_DGAMOUSE=0
|
||||
decky_loader=$HOME/homebrew/services/PluginLoader
|
||||
@@ -829,6 +837,9 @@ BUSCONF
|
||||
unset _stale _f
|
||||
fi
|
||||
steam_channel=steamdeck_publicbeta
|
||||
if [ "$steam_x64" = 0 ]; then
|
||||
steam_channel=$(droiddeck-steam-install --channel 2>/dev/null || echo steamdeck_publicbeta)
|
||||
fi
|
||||
_bl_lang=()
|
||||
[ -n "${BL_STEAM_LANGUAGE:-}" ] && _bl_lang=(-language "$BL_STEAM_LANGUAGE")
|
||||
steam_beta=$steam_root/package/beta
|
||||
|
||||
@@ -1,9 +1,26 @@
|
||||
#!/bin/bash
|
||||
set -eu
|
||||
cdn_list="https://client-update.steamstatic.com https://client-update.akamai.steamstatic.com https://client-update.fastly.steamstatic.com"
|
||||
steam_channel=steamdeck_publicbeta
|
||||
manifest=steam_client_${steam_channel}_linuxarm64
|
||||
beta_channel=steamdeck_publicbeta
|
||||
stable_channel=steamdeck_stable
|
||||
steam_root=${XDG_DATA_HOME:-$HOME/.local/share}/Steam
|
||||
channel_state=$steam_root/package/droiddeck-channel
|
||||
pinned=1
|
||||
wanted=${BL_STEAM_CHANNEL:-$(cat "$HOME/.config/droiddeck/steam-channel" 2>/dev/null || true)}
|
||||
case $wanted in
|
||||
stable|"$stable_channel") steam_channel=$stable_channel ;;
|
||||
beta|"$beta_channel") steam_channel=$beta_channel ;;
|
||||
*)
|
||||
pinned=
|
||||
steam_channel=$beta_channel
|
||||
[ "$(cat "$channel_state" 2>/dev/null)" = "$stable_channel" ] && steam_channel=$stable_channel
|
||||
;;
|
||||
esac
|
||||
if [ "${1:-}" = --channel ]; then
|
||||
echo "$steam_channel"
|
||||
exit 0
|
||||
fi
|
||||
manifest=steam_client_${steam_channel}_linuxarm64
|
||||
stamp=$steam_root/package/droiddeck-installed
|
||||
legacy_stamp=$steam_root/package/bannerlator-installed
|
||||
unconfirmed=$steam_root/package/droiddeck-unconfirmed
|
||||
@@ -12,11 +29,21 @@ if [ -f "$legacy_stamp" ] && [ ! -f "$stamp" ]; then
|
||||
mv -f "$legacy_stamp" "$stamp" || true
|
||||
fi
|
||||
repair=""
|
||||
fallback=""
|
||||
starts=0
|
||||
[ -f "$unconfirmed" ] && starts=$(grep -cx start "$unconfirmed" || true)
|
||||
if [ -e "$repair_request" ]; then
|
||||
repair="requested"
|
||||
elif [ -f "$unconfirmed" ] && ! grep -qx repaired "$unconfirmed" \
|
||||
&& [ "$(grep -cx start "$unconfirmed")" -ge 2 ]; then
|
||||
repair="the client was started $(grep -cx start "$unconfirmed") times without showing anything"
|
||||
elif [ "$starts" -ge 2 ] && ! grep -qx repaired "$unconfirmed"; then
|
||||
repair="the client was started $starts times without showing anything"
|
||||
elif [ "$starts" -ge 2 ] && [ -z "$pinned" ] && [ "$steam_channel" = "$beta_channel" ] && [ "${1:-}" != --sync ]; then
|
||||
repair="the repaired $beta_channel client was started $starts more times without showing anything"
|
||||
fallback=1
|
||||
fi
|
||||
if [ -n "$fallback" ]; then
|
||||
echo "== STEP $(date -u +%H:%M:%S) falling back to Valve's $stable_channel Steam client: $repair"
|
||||
steam_channel=$stable_channel
|
||||
manifest=steam_client_${steam_channel}_linuxarm64
|
||||
fi
|
||||
if [ -n "$repair" ]; then
|
||||
echo "== STEP $(date -u +%H:%M:%S) repairing the Steam client ($repair)"
|
||||
@@ -42,20 +69,42 @@ fi
|
||||
|
||||
work=$(mktemp -d)
|
||||
trap 'rm -rf "$work"' EXIT
|
||||
cdn=""
|
||||
for candidate in $cdn_list; do
|
||||
if curl -fsSL --connect-timeout 10 --max-time 30 --retry 2 --retry-connrefused --retry-delay 3 \
|
||||
"$candidate/$manifest" -o "$work/manifest"; then
|
||||
cdn=$candidate
|
||||
break
|
||||
fetch_manifest() {
|
||||
cdn=""
|
||||
for candidate in $cdn_list; do
|
||||
if curl -fsSL --connect-timeout 10 --max-time 30 --retry 2 --retry-connrefused --retry-delay 3 \
|
||||
"$candidate/$manifest" -o "$work/manifest"; then
|
||||
cdn=$candidate
|
||||
break
|
||||
fi
|
||||
done
|
||||
[ -n "$cdn" ] || { echo "droiddeck-steam-install: no Steam client CDN answered for $manifest" >&2; exit 1; }
|
||||
cdn_order=("$cdn")
|
||||
for candidate in $cdn_list; do
|
||||
[ "$candidate" = "$cdn" ] || cdn_order+=("$candidate")
|
||||
done
|
||||
version=$(awk -F'"' '$2 == "version" { print $4; exit }' "$work/manifest")
|
||||
awk -F'"' '
|
||||
/^\t"/ && NF >= 3 && $4 == "" { block = $2 }
|
||||
$2 == "file" { file[block] = $4 }
|
||||
$2 == "sha2" { sha[block] = $4 }
|
||||
END { for (b in file) if (b ~ /_all$/ || b ~ /_linuxarm64_linuxarm64$/) print b, file[b], sha[b] }
|
||||
' "$work/manifest" | sort > "$work/parts"
|
||||
[ -s "$work/parts" ] && return 0
|
||||
echo "droiddeck-steam-install: no client components in $manifest; its blocks are:" \
|
||||
"$(awk -F'"' '/^\t"/ && NF >= 3 && $4 == "" { printf "%s ", $2 }' "$work/manifest")" >&2
|
||||
return 1
|
||||
}
|
||||
if ! fetch_manifest; then
|
||||
if [ -n "$sync" ] || [ -n "$pinned" ] || [ "$steam_channel" = "$stable_channel" ]; then
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
[ -n "$cdn" ] || { echo "droiddeck-steam-install: no Steam client CDN answered for $manifest" >&2; exit 1; }
|
||||
cdn_order=("$cdn")
|
||||
for candidate in $cdn_list; do
|
||||
[ "$candidate" = "$cdn" ] || cdn_order+=("$candidate")
|
||||
done
|
||||
version=$(awk -F'"' '$2 == "version" { print $4; exit }' "$work/manifest")
|
||||
echo "== STEP $(date -u +%H:%M:%S) falling back to Valve's $stable_channel Steam client: $manifest has no arm64 client"
|
||||
steam_channel=$stable_channel
|
||||
manifest=steam_client_${steam_channel}_linuxarm64
|
||||
fallback=1
|
||||
fetch_manifest || exit 1
|
||||
fi
|
||||
if [ -n "$sync" ]; then
|
||||
installed=$(awk -F'"' '$2 == "version" { print $4; exit }' "$steam_root/package/$manifest.manifest" 2>/dev/null || true)
|
||||
if [ -x "$steam_root/steamrtarm64/steam" ] && [ "$installed" = "$version" ]; then
|
||||
@@ -64,13 +113,6 @@ if [ -n "$sync" ]; then
|
||||
fi
|
||||
echo "== STEP $(date -u +%H:%M:%S) updating the arm64 Steam client to $version (was ${installed:-none}) for the x86-64 client"
|
||||
fi
|
||||
awk -F'"' '
|
||||
/^\t"/ && NF >= 3 && $4 == "" { block = $2 }
|
||||
$2 == "file" { file[block] = $4 }
|
||||
$2 == "sha2" { sha[block] = $4 }
|
||||
END { for (b in file) if (b ~ /_all$/ || b ~ /_linuxarm64_linuxarm64$/) print b, file[b], sha[b] }
|
||||
' "$work/manifest" | sort > "$work/parts"
|
||||
[ -s "$work/parts" ] || { echo "droiddeck-steam-install: no client components in $manifest" >&2; exit 1; }
|
||||
total=$(grep -c . "$work/parts" 2>/dev/null || echo 0)
|
||||
|
||||
mkdir -p "$steam_root/package"
|
||||
@@ -117,6 +159,10 @@ ln -sfn "$steam_root/linuxarm64" "$HOME/.steam/sdkarm64"
|
||||
ln -sfn "$steam_root/steamrtarm64" "$HOME/.steam/binarm64"
|
||||
ln -sfn "$steam_root/linux32" "$HOME/.steam/sdk32"
|
||||
echo "$version" > "$stamp"
|
||||
if [ -n "$fallback" ]; then
|
||||
echo "$stable_channel" > "$channel_state"
|
||||
echo "== STEP $(date -u +%H:%M:%S) the Steam client now follows $stable_channel (beta in ~/.config/droiddeck/steam-channel returns to $beta_channel)"
|
||||
fi
|
||||
if [ -n "$repair" ]; then
|
||||
echo repaired > "$unconfirmed"
|
||||
rm -f "$repair_request"
|
||||
|
||||
@@ -520,39 +520,8 @@ ln -sfn "$STEAM_X64/ubuntu12_32" "$X64_HOME/.steam/bin32"
|
||||
ln -sfn "$STEAM_X64/ubuntu12_64" "$X64_HOME/.steam/bin64"
|
||||
ln -sfn "$STEAM_X64/linux32" "$X64_HOME/.steam/sdk32"
|
||||
ln -sfn "$STEAM_X64/linux64" "$X64_HOME/.steam/sdk64"
|
||||
# The client's bwrap probe (steam-runtime-check-requirements) needs user namespaces, which no Android app has.
|
||||
srt_real=$STEAM_X64/steamrt64/pv-runtime/steam-runtime-steamrt
|
||||
srt_shim=$X64_HOME/steamrt-shim
|
||||
if [ -d "$srt_real" ]; then
|
||||
rm -rf "$srt_shim"
|
||||
mkdir -p "$srt_shim/bin"
|
||||
for e in "$srt_real"/* "$srt_real"/.[!.]*; do
|
||||
[ -e "$e" ] || continue
|
||||
[ "$(basename "$e")" = bin ] || ln -s "$e" "$srt_shim/$(basename "$e")"
|
||||
done
|
||||
for e in "$srt_real"/bin/*; do ln -s "$e" "$srt_shim/bin/$(basename "$e")"; done
|
||||
rm -f "$srt_shim/bin/steam-runtime-check-requirements"
|
||||
printf '#!/bin/sh
|
||||
exit 0
|
||||
' > "$srt_shim/bin/steam-runtime-check-requirements"
|
||||
chmod 755 "$srt_shim/bin/steam-runtime-check-requirements"
|
||||
rm -f "$srt_shim/bin/steam-runtime-launch-client"
|
||||
cat > "$srt_shim/bin/steam-runtime-launch-client" <<'LAUNCH'
|
||||
#!/bin/sh
|
||||
while [ $# -gt 0 ]; do
|
||||
case $1 in
|
||||
--) shift; break ;;
|
||||
--directory=*) cd "${1#--directory=}" || exit 127 ;;
|
||||
--env=*) export "${1#--env=}" ;;
|
||||
--unset-env=*) unset "${1#--unset-env=}" ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
[ $# -gt 0 ] || exit 0
|
||||
exec "$@"
|
||||
LAUNCH
|
||||
chmod 755 "$srt_shim/bin/steam-runtime-launch-client"
|
||||
fi
|
||||
# Valve's Steam Runtime container needs user namespaces and a session-bus launcher; steamrt-shim stands in for both.
|
||||
droiddeck-steamrt-shim "$STEAM_X64/steamrt64" "$X64_HOME/steamrt-shim" || true
|
||||
# Valve's platform libraries ship without soname links (pressure-vessel makes them); ldconfig adds them here.
|
||||
srt_libs=$X64_HOME/steamrt-libs
|
||||
rm -rf "$srt_libs"
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
# droiddeck-steamrt-shim <client runtime dir> <shim dir>
|
||||
# Builds <shim dir> from the Steam Runtime container the client carries and exits 0, or removes it and exits 1
|
||||
# when the client carries none.
|
||||
set -eu
|
||||
client=$1
|
||||
shim=$2
|
||||
srt_real=$client/pv-runtime/steam-runtime-steamrt
|
||||
if [ ! -d "$srt_real" ]; then
|
||||
probe=$(find "$client" -maxdepth 4 -name steam-runtime-check-requirements -path '*/bin/*' -print -quit 2>/dev/null || true)
|
||||
srt_real=${probe:+${probe%/bin/*}}
|
||||
fi
|
||||
if [ -z "$srt_real" ] || [ ! -d "$srt_real" ]; then
|
||||
rm -rf "$shim"
|
||||
exit 1
|
||||
fi
|
||||
rm -rf "$shim"
|
||||
mkdir -p "$shim/bin"
|
||||
for e in "$srt_real"/* "$srt_real"/.[!.]*; do
|
||||
[ -e "$e" ] || continue
|
||||
[ "$(basename "$e")" = bin ] || ln -s "$e" "$shim/$(basename "$e")"
|
||||
done
|
||||
for e in "$srt_real"/bin/*; do
|
||||
[ -e "$e" ] || continue
|
||||
ln -s "$e" "$shim/bin/$(basename "$e")"
|
||||
done
|
||||
# The client's bwrap probe (steam-runtime-check-requirements) needs user namespaces, which no Android app has.
|
||||
rm -f "$shim/bin/steam-runtime-check-requirements"
|
||||
printf '#!/bin/sh
|
||||
exit 0
|
||||
' > "$shim/bin/steam-runtime-check-requirements"
|
||||
chmod 755 "$shim/bin/steam-runtime-check-requirements"
|
||||
# Valve's launcher asks a service on the session bus; proot is already the container, so the command runs here.
|
||||
rm -f "$shim/bin/steam-runtime-launch-client"
|
||||
cat > "$shim/bin/steam-runtime-launch-client" <<'LAUNCH'
|
||||
#!/bin/sh
|
||||
while [ $# -gt 0 ]; do
|
||||
case $1 in
|
||||
--) shift; break ;;
|
||||
--directory=*) cd "${1#--directory=}" || exit 127 ;;
|
||||
--env=*) export "${1#--env=}" ;;
|
||||
--unset-env=*) unset "${1#--unset-env=}" ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
[ $# -gt 0 ] || exit 0
|
||||
exec "$@"
|
||||
LAUNCH
|
||||
chmod 755 "$shim/bin/steam-runtime-launch-client"
|
||||
Reference in new issue
Block a user