diff options
| author | tranch <tranch.xiao@gmail.com> | 2026-10-23 16:58:49 +0800 |
|---|---|---|
| committer | tranch <tranch.xiao@gmail.com> | 2026-10-23 16:58:49 +0800 |
| commit | 885d1c77ac036bf2807c6a49a0cb49db5091a492 (patch) | |
| tree | 08db84e0fbe681f708800118f4a3988cee96f9af | |
| parent | 5725363f633c31a0f96e70f1400fba4958a4356c (diff) | |
| parent | fca1daca7dbe218dde1240b6c406a4257c70bd05 (diff) | |
| download | AeroCore-OS-885d1c77ac036bf2807c6a49a0cb49db5091a492.tar.gz AeroCore-OS-885d1c77ac036bf2807c6a49a0cb49db5091a492.zip | |
Merge testing changes before news triggerHEAD44.20261023main
| -rw-r--r-- | .github/workflows/build.yml | 6 | ||||
| -rw-r--r-- | Containerfile | 4 | ||||
| -rw-r--r-- | Justfile | 4 | ||||
| -rwxr-xr-x | build_files/build.sh | 20 | ||||
| -rwxr-xr-x | build_files/patch-bazzite-os-branch-select.sh | 58 | ||||
| -rw-r--r-- | image-template.env | 2 | ||||
| -rwxr-xr-x | system_files/usr/libexec/ogc/os-update | 115 |
7 files changed, 201 insertions, 8 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c56fc50..d49d506 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ env: IMAGE_LOGO_URL: ${{ vars.IMAGE_LOGO_URL || 'https://avatars.githubusercontent.com/u/120078124?s=200&v=4' }} DEFAULT_TAG: ${{ vars.DEFAULT_TAG || 'stable' }} BIB_IMAGE: ${{ vars.BIB_IMAGE || 'quay.io/centos-bootc/bootc-image-builder:latest' }} - BASE_IMAGE: ${{ vars.BASE_IMAGE || 'ghcr.io/ublue-os/bazzite-deck:stable-44.20261012' }} + BASE_IMAGE: ${{ vars.BASE_IMAGE || 'ghcr.io/ublue-os/bazzite-deck:stable-44.20261012.1' }} FLATPAK_REMOTE_URL: ${{ vars.FLATPAK_REMOTE_URL }} HOMEBREW_BOTTLE_DOMAIN: ${{ vars.HOMEBREW_BOTTLE_DOMAIN }} HOMEBREW_API_DOMAIN: ${{ vars.HOMEBREW_API_DOMAIN }} @@ -95,7 +95,7 @@ jobs: - name: Generate Version and Tags id: gen-version env: - BASE_IMAGE: ${{ vars.BASE_IMAGE || 'ghcr.io/ublue-os/bazzite-deck:stable-44.20261012' }} + BASE_IMAGE: ${{ vars.BASE_IMAGE || 'ghcr.io/ublue-os/bazzite-deck:stable-44.20261012.1' }} run: | set -euo pipefail @@ -162,7 +162,7 @@ jobs: id: build-image env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BASE_IMAGE: ${{ vars.BASE_IMAGE || 'ghcr.io/ublue-os/bazzite-deck:stable-44.20261012' }} + BASE_IMAGE: ${{ vars.BASE_IMAGE || 'ghcr.io/ublue-os/bazzite-deck:stable-44.20261012.1' }} FLATPAK_REMOTE_URL: ${{ vars.FLATPAK_REMOTE_URL }} HOMEBREW_BOTTLE_DOMAIN: ${{ vars.HOMEBREW_BOTTLE_DOMAIN }} HOMEBREW_API_DOMAIN: ${{ vars.HOMEBREW_API_DOMAIN }} diff --git a/Containerfile b/Containerfile index 794b46d..18606aa 100644 --- a/Containerfile +++ b/Containerfile @@ -1,5 +1,5 @@ # Allow build scripts to be referenced without being copied into the final image -ARG BASE_IMAGE="ghcr.io/ublue-os/bazzite-deck:stable-44.20261012" +ARG BASE_IMAGE="ghcr.io/ublue-os/bazzite-deck:stable-44.20261012.1" FROM scratch AS ctx COPY build_files / @@ -15,7 +15,7 @@ ARG VERSION_TAG="latest" ARG VERSION_PRETTY="latest" ARG OSTREE_IMAGE_REF="" ## Other possible base images include: -# ghcr.io/ublue-os/bazzite-deck:stable-44.20261012 +# ghcr.io/ublue-os/bazzite-deck:stable-44.20261012.1 # ghcr.io/ublue-os/bazzite-deck:testing-44.202609019 ### [IM]MUTABLE /opt @@ -11,7 +11,7 @@ export bib_image := env_var("BIB_IMAGE") export IMAGE_BRANCH := env_var_or_default("IMAGE_BRANCH", "testing-candidate") export VERSION_TAG := env_var_or_default("VERSION_TAG", "") export VERSION_PRETTY := env_var_or_default("VERSION_PRETTY", "") -export BASE_IMAGE := env_var_or_default("BASE_IMAGE", "ghcr.io/ublue-os/bazzite-deck:stable-44.20261012") +export BASE_IMAGE := env_var_or_default("BASE_IMAGE", "ghcr.io/ublue-os/bazzite-deck:stable-44.20261012.1") export OSTREE_IMAGE_REF := env_var_or_default("OSTREE_IMAGE_REF", "ostree-image-signed:docker://ghcr.io/" + repo_organization + "/" + image_name) export LIVE_BASE_IMAGE := env_var_or_default("LIVE_BASE_IMAGE", "quay.io/fedora/fedora-kinoite:44") export TITANOBOA_REPOSITORY := env_var_or_default("TITANOBOA_REPOSITORY", "https://github.com/Zeglius/titanoboa.git") @@ -137,7 +137,7 @@ build $target_image=image_name $tag=default_tag: "--build-arg" "IMAGE_BRANCH={{ tag }}" "--build-arg" "VERSION_TAG=${VERSION_TAG:-{{ tag }}}" "--build-arg" "VERSION_PRETTY=${VERSION_PRETTY:-${VERSION_TAG:-{{ tag }}}}" - "--label" "org.opencontainers.image.base.name=${BASE_IMAGE:-ghcr.io/ublue-os/bazzite-deck:stable-44.20261012}" + "--label" "org.opencontainers.image.base.name=${BASE_IMAGE:-ghcr.io/ublue-os/bazzite-deck:stable-44.20261012.1}" ) for arg in BASE_IMAGE FLATPAK_REMOTE_URL HOMEBREW_BOTTLE_DOMAIN HOMEBREW_API_DOMAIN OSTREE_IMAGE_REF INSTRUMENTS_ENABLED INSTRUMENTS_RELEASE_REPOSITORY INSTRUMENTS_VERSION INSTRUMENTS_RELEASE_API_BASE; do diff --git a/build_files/build.sh b/build_files/build.sh index 40b9efd..94a5ef5 100755 --- a/build_files/build.sh +++ b/build_files/build.sh @@ -14,6 +14,25 @@ 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; 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 = ${NEWS_FEED_URL}|" \ + "${NEWS_HOOK_CONFIG}" +grep -Fxq \ + "github = ${NEWS_FEED_URL}" \ + "${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 @@ -157,3 +176,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..a360a2e --- /dev/null +++ b/build_files/patch-bazzite-os-branch-select.sh @@ -0,0 +1,58 @@ +#!/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" + +# 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 diff --git a/image-template.env b/image-template.env index ea5dead..27387e4 100644 --- a/image-template.env +++ b/image-template.env @@ -16,7 +16,7 @@ BIB_IMAGE="quay.io/centos-bootc/bootc-image-builder:latest" # Keep this on bazzite-deck for Steam Deck, game mode, and handheld customizations. # Use a concrete tag during transition windows if stable/testing moves underneath you. -BASE_IMAGE="ghcr.io/ublue-os/bazzite-deck:stable-44.20261012" +BASE_IMAGE="ghcr.io/ublue-os/bazzite-deck:stable-44.20261012.1" # Optional mirror settings. FLATPAK_REMOTE_URL="" diff --git a/system_files/usr/libexec/ogc/os-update b/system_files/usr/libexec/ogc/os-update new file mode 100755 index 0000000..84efbed --- /dev/null +++ b/system_files/usr/libexec/ogc/os-update @@ -0,0 +1,115 @@ +#!/usr/bin/bash + +# The Steam client is known to call this script with the following parameter combinations: +# steamos-update --supports-duplicate-detection -- should do nothing +# steamos-update --enable-duplicate-detection check -- should check for update +# steamos-update check -- should check for update +# steamos-update --enable-duplicate-detection -- should perform an update +# steamos-update -- should perform an update + +# Exit Codes: +# 0: Success (e.g., upgrade available, --supports-duplicate-detection handled, or script completed even if upgrade failed). +# 7: Failure (e.g., uupd not installed, upgrade already installed, update checks failed, or mirror connectivity check failed). + +_upgrade() { + # Log rotate the last session + if [ -f "${HOME}/.steamos-update.log" ]; then + cp "${HOME}/.steamos-update.log" "${HOME}/.steamos-update.log.old" + fi + : > "${HOME}/.steamos-update.log" + + local last_pct=-1 + local uupd_status + + # Run uupd and capture its exit code + { + runcon system_u:unconfined_r:unconfined_t:s0 \ + /usr/bin/uupd --hw-check=false --disable-module-brew --disable-module-distrobox \ + --disable-module-flatpak --json --log-level debug 2>&1 + echo $? > /tmp/uupd_exit_code + } | while IFS= read -r line; do + echo "$line" >> "${HOME}/.steamos-update.log" + + pct=$(echo "$line" | jq -r 'select(.msg == "Updating") | .overall // empty' 2>/dev/null) + if [[ -n "$pct" ]]; then + pct=${pct%.*} + if [[ "$pct" -ne "$last_pct" ]]; then + echo "${pct}%" + last_pct=$pct + fi + fi + done + + uupd_status=$(cat /tmp/uupd_exit_code) + rm -f /tmp/uupd_exit_code + + return "$uupd_status" +} + + +# The first time the steam client starts in deck mode, it will attempt to fetch an update. +# We must exit the first time, otherwise you have users stuck when booting up the first time. +# See: https://www.reddit.com/r/Bazzite/comments/1psuar7/bazzite_xbox_ally_issue/ +_fixup_file=/etc/bazzite/fixups/first_steam_gamemode_boostrap +if [[ ! -f $_fixup_file ]]; then + mkdir -p "$(dirname "$_fixup_file")" + touch "$_fixup_file" + sync "$_fixup_file" + systemctl restart graphical.target + exit 7 +fi + +while [[ $# -gt 0 ]]; do + case $1 in + check) + _CHECK=1 + shift + ;; + --supports-duplicate-detection) + _EXIT=1 + shift + ;; + *) + shift + ;; + esac +done + +if [[ -n $_EXIT ]]; then + exit 0 +fi + +if ! command -v uupd >/dev/null; then + exit 7 # uupd not installed +fi + +if ! command -v jq >/dev/null; then + exit 7 # jq not installed +fi + +if [ -n "${_CHECK}" ]; then + if [ -f '/tmp/upgrade-installed' ]; then + exit 7 # Upgrade already installed + else + + # Require the downstream GitHub release mirror to be reachable before checking updates. + if ! wget -q --spider https://git.mirror.aerocore.com.cn; then + exit 7 # Connectivity check failed + fi + + # Check system state + if uupd update-check | grep -q "true"; then + exit 0 # Upgrade available + else + exit 7 # Checks failed + fi + fi +else + # We are triggering update + _upgrade + if [ $? -eq 0 ]; then + touch /tmp/upgrade-installed + else + exit 0 # Upgrade failed + fi +fi |
