From 92805891f11bd9aa358247557fb432262bf17877 Mon Sep 17 00:00:00 2001 From: tranch Date: Thu, 22 Oct 2026 16:35:20 +0800 Subject: feat: show mirrored testing release notes Point Bazzite game mode news at the testing announcements branch so Steam can display AeroCore OS prerelease notes without GitHub access. Keep the upstream hook and announcement format intact. --- build_files/build.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'build_files') diff --git a/build_files/build.sh b/build_files/build.sh index 40b9efd..988b7f0 100755 --- a/build_files/build.sh +++ b/build_files/build.sh @@ -14,6 +14,19 @@ esac # Copy the contents of system_files/ of the git repo to / cp -avf "/ctx/system_files"/. / +# Keep Bazzite's game mode news hook unchanged; only switch its feed URL. +NEWS_HOOK_CONFIG=/etc/gamemode-news-hook.conf +if [[ ! -f "${NEWS_HOOK_CONFIG}" ]]; then + echo "Unable to locate game mode news hook config: ${NEWS_HOOK_CONFIG}" >&2 + exit 1 +fi +sed -i \ + 's|^github = .*|github = https://git.mirror.aerocore.com.cn/AeroCore-IO/aerocore-os-gamemode-news/plain/announcements.json?h=testing|' \ + "${NEWS_HOOK_CONFIG}" +grep -Fxq \ + 'github = https://git.mirror.aerocore.com.cn/AeroCore-IO/aerocore-os-gamemode-news/plain/announcements.json?h=testing' \ + "${NEWS_HOOK_CONFIG}" + # Bazzite's Kinoite/Plasma desktop shortcut used to start a privileged # return-to-gamemode.service. Current Bazzite invokes the user-session entry # point directly; keep the shortcut correct when the base image still ships -- cgit v1.2.3 From 20253bfffc4815e1c48aebb8ede28527ce80ad3e Mon Sep 17 00:00:00 2001 From: tranch Date: Fri, 23 Oct 2026 10:23:18 +0800 Subject: fix: detect Game Mode channel from booted image Read the booted deployment reference instead of filtering status by the os-release ID, which differs from AeroCore image names. --- build_files/build.sh | 1 + build_files/patch-bazzite-os-branch-select.sh | 35 +++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100755 build_files/patch-bazzite-os-branch-select.sh (limited to 'build_files') diff --git a/build_files/build.sh b/build_files/build.sh index 988b7f0..1875ddf 100755 --- a/build_files/build.sh +++ b/build_files/build.sh @@ -170,3 +170,4 @@ find /etc/environment.d /etc/skel/.config/environment.d -name 99-aerocore-mirror /ctx/install-instruments.sh /ctx/patch-bazzite-deck-identity.sh /ctx/patch-bazzite-rollback-helper.sh +/ctx/patch-bazzite-os-branch-select.sh diff --git a/build_files/patch-bazzite-os-branch-select.sh b/build_files/patch-bazzite-os-branch-select.sh new file mode 100755 index 0000000..544b1a5 --- /dev/null +++ b/build_files/patch-bazzite-os-branch-select.sh @@ -0,0 +1,35 @@ +#!/usr/bin/bash + +set -euo pipefail + +file=/usr/libexec/os-branch-select + +if [[ ! -f "$file" ]]; then + echo "Unable to locate Bazzite OS branch selector: $file" >&2 + exit 1 +fi + +old=' branch=$(cut -d ":" -f4 <<< "$(rpm-ostree status --booted | grep -m 1 $ID)")' +if ! grep -Fxq "$old" "$file"; then + echo "Bazzite OS branch selector changed; review the downstream patch" >&2 + exit 1 +fi + +patched_file=$(mktemp) +awk -v old="$old" ' + $0 == old { + print " # Read the booted deployment directly; its image name need not match os-release ID." + print " image_ref=$(rpm-ostree status --booted --json | jq -r '\''[.deployments[] | select(.booted) | .[\"container-image-reference\"] // empty][0] // empty'\'')" + print " branch=\"\"" + print " if [[ $image_ref =~ :([^/:]+)$ ]]; then" + print " branch=${BASH_REMATCH[1]}" + print " fi" + found++ + next + } + { print } + END { if (found != 1) exit 1 } +' "$file" > "$patched_file" + +install -m 0755 "$patched_file" "$file" +rm -f "$patched_file" -- cgit v1.2.3 From fca1daca7dbe218dde1240b6c406a4257c70bd05 Mon Sep 17 00:00:00 2001 From: tranch Date: Fri, 23 Oct 2026 14:49:26 +0800 Subject: fix: align Game Mode update channels with news Select the feed matching each image branch and expose Steam channels that match the announcement data for testing and unstable builds. --- build_files/build.sh | 12 +++++++++--- build_files/patch-bazzite-os-branch-select.sh | 23 +++++++++++++++++++++++ 2 files changed, 32 insertions(+), 3 deletions(-) (limited to 'build_files') diff --git a/build_files/build.sh b/build_files/build.sh index 1875ddf..94a5ef5 100755 --- a/build_files/build.sh +++ b/build_files/build.sh @@ -14,17 +14,23 @@ esac # Copy the contents of system_files/ of the git repo to / cp -avf "/ctx/system_files"/. / -# Keep Bazzite's game mode news hook unchanged; only switch its feed URL. +# Keep Bazzite's game mode news hook unchanged; select the matching feed branch. NEWS_HOOK_CONFIG=/etc/gamemode-news-hook.conf if [[ ! -f "${NEWS_HOOK_CONFIG}" ]]; then echo "Unable to locate game mode news hook config: ${NEWS_HOOK_CONFIG}" >&2 exit 1 fi +NEWS_BRANCH="${IMAGE_BRANCH:-stable}" +case "${NEWS_BRANCH}" in + testing|unstable) ;; + *) NEWS_BRANCH=stable ;; +esac +NEWS_FEED_URL="https://git.mirror.aerocore.com.cn/AeroCore-IO/aerocore-os-gamemode-news/plain/announcements.json?h=${NEWS_BRANCH}" sed -i \ - 's|^github = .*|github = https://git.mirror.aerocore.com.cn/AeroCore-IO/aerocore-os-gamemode-news/plain/announcements.json?h=testing|' \ + "s|^github = .*|github = ${NEWS_FEED_URL}|" \ "${NEWS_HOOK_CONFIG}" grep -Fxq \ - 'github = https://git.mirror.aerocore.com.cn/AeroCore-IO/aerocore-os-gamemode-news/plain/announcements.json?h=testing' \ + "github = ${NEWS_FEED_URL}" \ "${NEWS_HOOK_CONFIG}" # Bazzite's Kinoite/Plasma desktop shortcut used to start a privileged diff --git a/build_files/patch-bazzite-os-branch-select.sh b/build_files/patch-bazzite-os-branch-select.sh index 544b1a5..a360a2e 100755 --- a/build_files/patch-bazzite-os-branch-select.sh +++ b/build_files/patch-bazzite-os-branch-select.sh @@ -33,3 +33,26 @@ awk -v old="$old" ' install -m 0755 "$patched_file" "$file" rm -f "$patched_file" + +# Match the channel names used by Bazzite's Game Mode announcement feeds. +# Steam's rc/beta and bc/main aliases still select the same image branches. +python3 - "$file" <<'PY' +from pathlib import Path +import sys + +path = Path(sys.argv[1]) +text = path.read_text() +replacements = { + " testing)\n echo rc\n": " testing)\n echo beta\n", + " unstable)\n echo main\n": " unstable)\n echo preview\n", + " echo rc\n echo beta\n echo bc\n echo main\n": + " echo rc\n echo beta\n echo bc\n echo preview\n echo main\n", + " bc|main|unstable)\n": " bc|preview|main|unstable)\n", +} +for old in replacements: + if text.count(old) != 1: + raise SystemExit(f"Bazzite branch selector changed; expected exactly one {old!r}") +for old, new in replacements.items(): + text = text.replace(old, new, 1) +path.write_text(text) +PY -- cgit v1.2.3