From 90bc5e4408ca6197b63b77d5860e3aa85ff6eb98 Mon Sep 17 00:00:00 2001 From: rickpeters Date: Tue, 29 Sep 2026 19:16:06 +0200 Subject: [PATCH] fix: HDMI-CEC: Valve's CEC driver is downloaded once and kept in /var/cache/steamify (GitHub rate-limits repeated downloads with HTTP 429, which left CEC off) --- CHANGELOG.md | 3 ++- lib/cec.sh | 20 ++++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 172de22..4fffaf4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,8 @@ one per merged pull request. ## 2.9.1 - 2026-09-29 -- **chore: Version 2.9.1** +- **fix: HDMI-CEC: Valve's CEC driver is downloaded once and kept in /var/cache/steamify (GitHub rate-limits repeated downloads with HTTP 429, which left CEC off); turning CEC on again needs no network** +- `d99ff65` **chore: Version 2.9.1** ## 2.9.0 - 2026-09-28 diff --git a/lib/cec.sh b/lib/cec.sh index 4193628..e41368a 100644 --- a/lib/cec.sh +++ b/lib/cec.sh @@ -26,6 +26,9 @@ CEC_DKMS_VER=1 CEC_DKMS_SRC="/usr/src/$CEC_DKMS_NAME-$CEC_DKMS_VER" CEC_DRIVER_URL="https://raw.githubusercontent.com/evlaV/linux-integration/10c8c8800ccd3ae359203b4eefb6479f613b3b8e/drivers/media/cec/platform/cros-ec/cros-ec-cec.c" CEC_DRIVER_SHA256=e89fd4e87fceb32d713ffc59b64794779b3c2b3c012b0e2f2e9f0c40b42f4373 +# Downloaded once, then kept: raw.githubusercontent.com rate-limits (HTTP 429) repeated downloads +# from one address, and turning CEC off and on again needs no network then. +CEC_DRIVER_CACHE="/var/cache/steamify/cros-ec-cec-${CEC_DRIVER_SHA256:0:12}.c" cec_link_steamos_manager() { # On a Steam Machine: steamos-manager writes cecd's config from Steam's @@ -65,12 +68,17 @@ cec_driver_enable() { fi install_kernel_headers || return 1 tmp="$(mktemp -d)" - info "Downloading Valve's Steam Machine CEC driver..." - if ! curl -fsL "$CEC_DRIVER_URL" -o "$tmp/cros-ec-cec.c" || - ! echo "$CEC_DRIVER_SHA256 $tmp/cros-ec-cec.c" | sha256sum -c --quiet -; then - rm -rf "$tmp" - err "Downloading Valve's CEC driver failed (or its checksum didn't match)." - return 1 + if [[ -f "$CEC_DRIVER_CACHE" ]] && echo "$CEC_DRIVER_SHA256 $CEC_DRIVER_CACHE" | sha256sum -c --quiet - 2>/dev/null; then + cp "$CEC_DRIVER_CACHE" "$tmp/cros-ec-cec.c" + else + info "Downloading Valve's Steam Machine CEC driver..." + if ! curl -fsL --retry 2 "$CEC_DRIVER_URL" -o "$tmp/cros-ec-cec.c" || + ! echo "$CEC_DRIVER_SHA256 $tmp/cros-ec-cec.c" | sha256sum -c --quiet -; then + rm -rf "$tmp" + err "Downloading Valve's CEC driver failed (or its checksum didn't match)." + return 1 + fi + sudo install -Dm644 "$tmp/cros-ec-cec.c" "$CEC_DRIVER_CACHE" fi # So it finds amdgpu's HDMI port (see the patch for why). patch_file cros-ec-cec-single-port.patch | patch -s -d "$tmp" -p1 ||