From f66aa82b4c3890c8f6b2741bfedd31405dcbd39f Mon Sep 17 00:00:00 2001 From: tranch Date: Wed, 15 Jul 2026 14:39:34 +0800 Subject: Recognize AeroCore as a Deck image Preserve Bazzite's Deck configuration for AeroCore images. Restore SDDM defaults removed by earlier deployments. --- build_files/patch-bazzite-deck-identity.sh | 47 ++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 build_files/patch-bazzite-deck-identity.sh (limited to 'build_files/patch-bazzite-deck-identity.sh') diff --git a/build_files/patch-bazzite-deck-identity.sh b/build_files/patch-bazzite-deck-identity.sh new file mode 100755 index 0000000..600d97e --- /dev/null +++ b/build_files/patch-bazzite-deck-identity.sh @@ -0,0 +1,47 @@ +#!/usr/bin/bash + +set -euo pipefail + +hardware_setup="${1:-/usr/libexec/bazzite-hardware-setup}" +# These are literal source lines; variable expansion must happen at boot time. +# shellcheck disable=SC2016 +old_condition='if [[ "$IMAGE_NAME" != *deck* && "$IMAGE_NAME" != *dx* ]]; then' +# shellcheck disable=SC2016 +new_condition='if [[ "$IMAGE_NAME" != aerocore-os && "$IMAGE_NAME" != *deck* && "$IMAGE_NAME" != *dx* && "$BASE_IMAGE_NAME" != *deck* && "$BASE_IMAGE_NAME" != *dx* ]]; then' +# shellcheck disable=SC2016 +base_image_assignment='BASE_IMAGE_NAME=$(jq -r '\''."base-image-name"'\'' < $IMAGE_INFO)' + +if grep -Fqx "$new_condition" "$hardware_setup"; then + exit 0 +fi + +if [[ "$(grep -Fxc "$old_condition" "$hardware_setup")" -ne 1 ]]; then + echo "Unable to locate the Bazzite Deck image check in $hardware_setup" >&2 + exit 1 +fi + +add_base_image_assignment=0 +if ! grep -Fqx "$base_image_assignment" "$hardware_setup"; then + add_base_image_assignment=1 +fi + +patched_file=$(mktemp) +trap 'rm -f "$patched_file"' EXIT + +awk \ + -v old_condition="$old_condition" \ + -v new_condition="$new_condition" \ + -v base_image_assignment="$base_image_assignment" \ + -v add_base_image_assignment="$add_base_image_assignment" \ + '$0 == old_condition { + if (add_base_image_assignment) { + print base_image_assignment + } + print new_condition + next + } + { print }' "$hardware_setup" > "$patched_file" + +cp "$patched_file" "$hardware_setup" + +grep -Fqx "$new_condition" "$hardware_setup" -- cgit v1.2.3 From f2a767a9cdc51384115c054020611a980451f074 Mon Sep 17 00:00:00 2001 From: tranch Date: Wed, 15 Jul 2026 15:41:48 +0800 Subject: Preserve upstream desktop metadata Keep the base image's kinoite or silverblue identity intact. Detect AeroCore Deck behavior from its image name instead. --- build_files/patch-bazzite-deck-identity.sh | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'build_files/patch-bazzite-deck-identity.sh') diff --git a/build_files/patch-bazzite-deck-identity.sh b/build_files/patch-bazzite-deck-identity.sh index 600d97e..078b76c 100755 --- a/build_files/patch-bazzite-deck-identity.sh +++ b/build_files/patch-bazzite-deck-identity.sh @@ -7,9 +7,7 @@ hardware_setup="${1:-/usr/libexec/bazzite-hardware-setup}" # shellcheck disable=SC2016 old_condition='if [[ "$IMAGE_NAME" != *deck* && "$IMAGE_NAME" != *dx* ]]; then' # shellcheck disable=SC2016 -new_condition='if [[ "$IMAGE_NAME" != aerocore-os && "$IMAGE_NAME" != *deck* && "$IMAGE_NAME" != *dx* && "$BASE_IMAGE_NAME" != *deck* && "$BASE_IMAGE_NAME" != *dx* ]]; then' -# shellcheck disable=SC2016 -base_image_assignment='BASE_IMAGE_NAME=$(jq -r '\''."base-image-name"'\'' < $IMAGE_INFO)' +new_condition='if [[ "$IMAGE_NAME" != aerocore-os && "$IMAGE_NAME" != *deck* && "$IMAGE_NAME" != *dx* ]]; then' if grep -Fqx "$new_condition" "$hardware_setup"; then exit 0 @@ -20,23 +18,13 @@ if [[ "$(grep -Fxc "$old_condition" "$hardware_setup")" -ne 1 ]]; then exit 1 fi -add_base_image_assignment=0 -if ! grep -Fqx "$base_image_assignment" "$hardware_setup"; then - add_base_image_assignment=1 -fi - patched_file=$(mktemp) trap 'rm -f "$patched_file"' EXIT awk \ -v old_condition="$old_condition" \ -v new_condition="$new_condition" \ - -v base_image_assignment="$base_image_assignment" \ - -v add_base_image_assignment="$add_base_image_assignment" \ '$0 == old_condition { - if (add_base_image_assignment) { - print base_image_assignment - } print new_condition next } -- cgit v1.2.3 From 50ff7ec0acaea2b426aa026772ae6c1eb944df23 Mon Sep 17 00:00:00 2001 From: tranch Date: Sat, 25 Jul 2026 09:30:11 +0800 Subject: Preserve Deck runtime checks for AeroCore Patch Bazzite Steam and user setup scripts to recognize aerocore-os as a Deck image, keeping Steam bootstrap and gamescope-related initialization active after rebranding. --- build_files/patch-bazzite-deck-identity.sh | 107 ++++++++++++++++++++++------- 1 file changed, 82 insertions(+), 25 deletions(-) (limited to 'build_files/patch-bazzite-deck-identity.sh') diff --git a/build_files/patch-bazzite-deck-identity.sh b/build_files/patch-bazzite-deck-identity.sh index 078b76c..05b6e5f 100755 --- a/build_files/patch-bazzite-deck-identity.sh +++ b/build_files/patch-bazzite-deck-identity.sh @@ -2,34 +2,91 @@ set -euo pipefail -hardware_setup="${1:-/usr/libexec/bazzite-hardware-setup}" -# These are literal source lines; variable expansion must happen at boot time. -# shellcheck disable=SC2016 -old_condition='if [[ "$IMAGE_NAME" != *deck* && "$IMAGE_NAME" != *dx* ]]; then' -# shellcheck disable=SC2016 -new_condition='if [[ "$IMAGE_NAME" != aerocore-os && "$IMAGE_NAME" != *deck* && "$IMAGE_NAME" != *dx* ]]; then' +root="${AEROCORE_DECK_COMPAT_ROOT:-}" +root="${root%/}" + +target_path() { + printf '%s%s\n' "$root" "$1" +} + +patch_condition() { + local file="$1" + local old_condition="$2" + local new_condition="$3" + local expected_count="$4" + local old_count new_count patched_file + + if [[ ! -f "$file" ]]; then + echo "Unable to locate expected Bazzite Deck file: $file" >&2 + exit 1 + fi + + new_count="$(grep -Foc "$new_condition" "$file" || true)" + if [[ "$new_count" -eq "$expected_count" ]]; then + return 0 + fi -if grep -Fqx "$new_condition" "$hardware_setup"; then - exit 0 -fi + old_count="$(grep -Foc "$old_condition" "$file" || true)" + if [[ "$old_count" -ne "$expected_count" ]]; then + echo "Unable to locate the expected Bazzite Deck image check in $file" >&2 + echo "Expected $expected_count occurrence(s), found old=$old_count new=$new_count" >&2 + exit 1 + fi -if [[ "$(grep -Fxc "$old_condition" "$hardware_setup")" -ne 1 ]]; then - echo "Unable to locate the Bazzite Deck image check in $hardware_setup" >&2 - exit 1 -fi + patched_file="$(mktemp)" + awk \ + -v old_condition="$old_condition" \ + -v new_condition="$new_condition" \ + ' { + position = index($0, old_condition) + if (position) { + $0 = substr($0, 1, position - 1) new_condition substr($0, position + length(old_condition)) + } + print + }' "$file" > "$patched_file" -patched_file=$(mktemp) -trap 'rm -f "$patched_file"' EXIT + cp "$patched_file" "$file" + rm -f "$patched_file" -awk \ - -v old_condition="$old_condition" \ - -v new_condition="$new_condition" \ - '$0 == old_condition { - print new_condition - next - } - { print }' "$hardware_setup" > "$patched_file" + new_count="$(grep -Foc "$new_condition" "$file" || true)" + if [[ "$new_count" -ne "$expected_count" ]]; then + echo "Failed to patch the Bazzite Deck image check in $file" >&2 + exit 1 + fi +} -cp "$patched_file" "$hardware_setup" +# Keep AeroCore's public image-name, while restoring the Deck capability checks +# used by Bazzite's runtime scripts. These are literal source lines; variable +# expansion must happen later, when the scripts run on the installed system. +# shellcheck disable=SC2016 +patch_condition \ + "${1:-$(target_path /usr/libexec/bazzite-hardware-setup)}" \ + 'if [[ "$IMAGE_NAME" != *deck* && "$IMAGE_NAME" != *dx* ]]; then' \ + 'if [[ "$IMAGE_NAME" != aerocore-os && "$IMAGE_NAME" != *deck* && "$IMAGE_NAME" != *dx* ]]; then' \ + 1 + +# The hardware setup has a second Deck-only block after the top-level image +# guard. Keep it active for AeroCore as well. +# shellcheck disable=SC2016 +patch_condition \ + "${1:-$(target_path /usr/libexec/bazzite-hardware-setup)}" \ + 'if [[ $IMAGE_NAME =~ "deck" || $IMAGE_NAME =~ "ally" ]]; then' \ + 'if [[ $IMAGE_NAME =~ "deck" || $IMAGE_NAME =~ "ally" || $IMAGE_NAME == aerocore-os ]]; then' \ + 1 -grep -Fqx "$new_condition" "$hardware_setup" +# bazzite-steam gates the Steam bootstrap archive and -steamdeck flag on the +# image name. The user setup script has the same Deck-only gating in three +# places. +# shellcheck disable=SC2016 +patch_condition \ + "$(target_path /usr/bin/bazzite-steam)" \ + 'if [[ $IMAGE_NAME =~ "deck" ]]; then' \ + 'if [[ $IMAGE_NAME =~ "deck" || $IMAGE_NAME == aerocore-os ]]; then' \ + 1 + +# shellcheck disable=SC2016 +patch_condition \ + "$(target_path /usr/libexec/bazzite-user-setup)" \ + 'if [[ $IMAGE_NAME =~ "deck" || $IMAGE_NAME =~ "ally" ]]; then' \ + 'if [[ $IMAGE_NAME =~ "deck" || $IMAGE_NAME =~ "ally" || $IMAGE_NAME == aerocore-os ]]; then' \ + 3 -- cgit v1.2.3 From 63e9dd98331d0ef7c9c9984cbcf6a7aaba9572dc Mon Sep 17 00:00:00 2001 From: tranch Date: Sat, 25 Jul 2026 18:15:12 +0800 Subject: Repair stale Steam user state --- build_files/patch-bazzite-deck-identity.sh | 57 ++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) (limited to 'build_files/patch-bazzite-deck-identity.sh') diff --git a/build_files/patch-bazzite-deck-identity.sh b/build_files/patch-bazzite-deck-identity.sh index 05b6e5f..ea561e4 100755 --- a/build_files/patch-bazzite-deck-identity.sh +++ b/build_files/patch-bazzite-deck-identity.sh @@ -55,6 +55,61 @@ patch_condition() { fi } +patch_steam_state_migration() { + local file="$1" + # shellcheck disable=SC2016 + local condition='if [[ $IMAGE_NAME =~ "deck" || $IMAGE_NAME == aerocore-os ]]; then' + local marker='AeroCore Steam state migration' + local patched_file + + if [[ ! -f "$file" ]]; then + echo "Unable to locate expected Bazzite Deck file: $file" >&2 + exit 1 + fi + + if grep -Fq "$marker" "$file"; then + return 0 + fi + + if [[ "$(grep -Foc "$condition" "$file" || true)" -ne 1 ]]; then + echo "Unable to locate the AeroCore Steam bootstrap condition in $file" >&2 + exit 1 + fi + + patched_file="$(mktemp)" + awk -v condition="$condition" ' + !inserted && $0 == condition { + print + print " # AeroCore Steam state migration" + print " # Older AeroCore images could leave ~/.steam/steam as a directory." + print " # Preserve it before restoring the symlink expected by Steam." + print " STEAM_DATA_HOME=\"$HOME/.local/share/Steam\"" + print " STEAM_DATA_LINK=\"$HOME/.steam/steam\"" + print " if [[ -d \"$STEAM_DATA_LINK\" && ! -L \"$STEAM_DATA_LINK\" && -x \"$STEAM_DATA_HOME/steam.sh\" ]]; then" + print " STEAM_DATA_BACKUP=\"${STEAM_DATA_LINK}.aerocore-backup-$(date +%s)-$$\"" + print " STEAM_DATA_TEMP=\"${STEAM_DATA_LINK}.aerocore-link-$$\"" + print " if ln -s \"$STEAM_DATA_HOME\" \"$STEAM_DATA_TEMP\" && mv -- \"$STEAM_DATA_LINK\" \"$STEAM_DATA_BACKUP\" && mv -- \"$STEAM_DATA_TEMP\" \"$STEAM_DATA_LINK\"; then" + print " :" + print " else" + print " rm -f -- \"$STEAM_DATA_TEMP\"" + print " fi" + print " fi" + inserted=1 + next + } + { print } + END { if (!inserted) exit 1 } + ' "$file" > "$patched_file" + + cp "$patched_file" "$file" + rm -f "$patched_file" + + if ! grep -Fq "$marker" "$file"; then + echo "Failed to add the AeroCore Steam state migration to $file" >&2 + exit 1 + fi +} + # Keep AeroCore's public image-name, while restoring the Deck capability checks # used by Bazzite's runtime scripts. These are literal source lines; variable # expansion must happen later, when the scripts run on the installed system. @@ -84,6 +139,8 @@ patch_condition \ 'if [[ $IMAGE_NAME =~ "deck" || $IMAGE_NAME == aerocore-os ]]; then' \ 1 +patch_steam_state_migration "$(target_path /usr/bin/bazzite-steam)" + # shellcheck disable=SC2016 patch_condition \ "$(target_path /usr/libexec/bazzite-user-setup)" \ -- cgit v1.2.3 From 80cde14b9c368f58e8f16ad121396ce2f1a50f44 Mon Sep 17 00:00:00 2001 From: tranch Date: Fri, 21 Aug 2026 08:42:38 +0800 Subject: Adapt to Bazzite 44 Update Deck identity matching for the new upstream scripts and add fixture coverage for patch idempotence. Move the live installer base to Fedora 44 while retaining the Fedora 43 Anaconda workaround for explicit legacy builds. --- build_files/patch-bazzite-deck-identity.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'build_files/patch-bazzite-deck-identity.sh') diff --git a/build_files/patch-bazzite-deck-identity.sh b/build_files/patch-bazzite-deck-identity.sh index ea561e4..ea32cf3 100755 --- a/build_files/patch-bazzite-deck-identity.sh +++ b/build_files/patch-bazzite-deck-identity.sh @@ -125,8 +125,8 @@ patch_condition \ # shellcheck disable=SC2016 patch_condition \ "${1:-$(target_path /usr/libexec/bazzite-hardware-setup)}" \ - 'if [[ $IMAGE_NAME =~ "deck" || $IMAGE_NAME =~ "ally" ]]; then' \ - 'if [[ $IMAGE_NAME =~ "deck" || $IMAGE_NAME =~ "ally" || $IMAGE_NAME == aerocore-os ]]; then' \ + 'if [[ $IMAGE_NAME =~ "deck" ]]; then' \ + 'if [[ $IMAGE_NAME =~ "deck" || $IMAGE_NAME == aerocore-os ]]; then' \ 1 # bazzite-steam gates the Steam bootstrap archive and -steamdeck flag on the @@ -144,6 +144,6 @@ patch_steam_state_migration "$(target_path /usr/bin/bazzite-steam)" # shellcheck disable=SC2016 patch_condition \ "$(target_path /usr/libexec/bazzite-user-setup)" \ - 'if [[ $IMAGE_NAME =~ "deck" || $IMAGE_NAME =~ "ally" ]]; then' \ - 'if [[ $IMAGE_NAME =~ "deck" || $IMAGE_NAME =~ "ally" || $IMAGE_NAME == aerocore-os ]]; then' \ + 'if [[ $IMAGE_NAME =~ "deck" ]]; then' \ + 'if [[ $IMAGE_NAME =~ "deck" || $IMAGE_NAME == aerocore-os ]]; then' \ 3 -- cgit v1.2.3 From 7889a92c2eea98189330ad1fbfbef4c33a7e3071 Mon Sep 17 00:00:00 2001 From: tranch Date: Fri, 28 Aug 2026 08:57:25 +0800 Subject: Move branding migration into user setup --- build_files/patch-bazzite-deck-identity.sh | 50 ++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'build_files/patch-bazzite-deck-identity.sh') diff --git a/build_files/patch-bazzite-deck-identity.sh b/build_files/patch-bazzite-deck-identity.sh index ea32cf3..d3ee860 100755 --- a/build_files/patch-bazzite-deck-identity.sh +++ b/build_files/patch-bazzite-deck-identity.sh @@ -110,6 +110,54 @@ patch_steam_state_migration() { fi } +patch_desktop_branding_migration() { + local file="$1" + local marker='AeroCore desktop branding migration' + local condition='pkexec /usr/libexec/bazzite-privileged-user-setup "$USER"' + local patched_file + + if [[ ! -f "$file" ]]; then + echo "Unable to locate expected Bazzite user setup file: $file" >&2 + exit 1 + fi + + if grep -Fq "$marker" "$file"; then + return 0 + fi + + if [[ "$(grep -Foc "$condition" "$file" || true)" -ne 1 ]]; then + echo "Unable to locate the Bazzite privileged user setup call in $file" >&2 + exit 1 + fi + + patched_file="$(mktemp)" + awk -v condition="$condition" ' + !inserted && $0 == condition { + print + print "" + print " # AeroCore desktop branding migration" + print " # The image contains the correct defaults. This only repairs values" + print " # persisted by an older Bazzite/AeroCore deployment." + print " if [[ -f /etc/xdg/kcm-about-distrorc ]] && grep -Fxq \"Name=Bazzite\" /etc/xdg/kcm-about-distrorc; then" + print " pkexec /usr/libexec/aerocore-desktop-branding-privileged" + print " fi" + print " /usr/libexec/aerocore-desktop-branding" + inserted=1 + next + } + { print } + END { if (!inserted) exit 1 } + ' "$file" > "$patched_file" + + cp "$patched_file" "$file" + rm -f "$patched_file" + + if ! grep -Fq "$marker" "$file"; then + echo "Failed to add the AeroCore desktop branding migration to $file" >&2 + exit 1 + fi +} + # Keep AeroCore's public image-name, while restoring the Deck capability checks # used by Bazzite's runtime scripts. These are literal source lines; variable # expansion must happen later, when the scripts run on the installed system. @@ -147,3 +195,5 @@ patch_condition \ 'if [[ $IMAGE_NAME =~ "deck" ]]; then' \ 'if [[ $IMAGE_NAME =~ "deck" || $IMAGE_NAME == aerocore-os ]]; then' \ 3 + +patch_desktop_branding_migration "$(target_path /usr/libexec/bazzite-user-setup)" -- cgit v1.2.3 From 9f1490f28db8643e78cd26e3cd8f0c92909f16a2 Mon Sep 17 00:00:00 2001 From: tranch Date: Sun, 13 Sep 2026 13:58:34 +0800 Subject: Migrate legacy gaming mode shortcut Repair existing user desktop launchers that still reference the removed return-to-gamemode systemd service. --- build_files/patch-bazzite-deck-identity.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'build_files/patch-bazzite-deck-identity.sh') diff --git a/build_files/patch-bazzite-deck-identity.sh b/build_files/patch-bazzite-deck-identity.sh index d3ee860..da2a74e 100755 --- a/build_files/patch-bazzite-deck-identity.sh +++ b/build_files/patch-bazzite-deck-identity.sh @@ -158,6 +158,29 @@ patch_desktop_branding_migration() { fi } +patch_gamemode_shortcut_migration() { + local file="$1" + local marker='AeroCore Return to Gaming Mode shortcut migration' + + if [[ ! -f "$file" ]]; then + echo "Unable to locate expected Bazzite user setup file: $file" >&2 + exit 1 + fi + + if grep -Fq "$marker" "$file"; then + return 0 + fi + + cat >> "$file" <<'EOF' + +# AeroCore Return to Gaming Mode shortcut migration +# Replace the legacy privileged systemd launcher left by older Bazzite images. +if [[ -f "$HOME/Desktop/Return.desktop" ]]; then + sed -i 's|^Exec=systemctl start return-to-gamemode\.service$|Exec=/usr/bin/return-to-gamemode|' "$HOME/Desktop/Return.desktop" +fi +EOF +} + # Keep AeroCore's public image-name, while restoring the Deck capability checks # used by Bazzite's runtime scripts. These are literal source lines; variable # expansion must happen later, when the scripts run on the installed system. @@ -197,3 +220,4 @@ patch_condition \ 3 patch_desktop_branding_migration "$(target_path /usr/libexec/bazzite-user-setup)" +patch_gamemode_shortcut_migration "$(target_path /usr/libexec/bazzite-user-setup)" -- cgit v1.2.3 From f068acf3b1c2a4551c5119997fd40909ddd35386 Mon Sep 17 00:00:00 2001 From: tranch Date: Sun, 13 Sep 2026 19:05:58 +0800 Subject: Run shortcut migration before setup guard Ensure legacy Return.desktop files are repaired even when Bazzite user setup has already completed for the user. --- build_files/patch-bazzite-deck-identity.sh | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) (limited to 'build_files/patch-bazzite-deck-identity.sh') diff --git a/build_files/patch-bazzite-deck-identity.sh b/build_files/patch-bazzite-deck-identity.sh index da2a74e..8ddacf9 100755 --- a/build_files/patch-bazzite-deck-identity.sh +++ b/build_files/patch-bazzite-deck-identity.sh @@ -161,6 +161,8 @@ patch_desktop_branding_migration() { patch_gamemode_shortcut_migration() { local file="$1" local marker='AeroCore Return to Gaming Mode shortcut migration' + local insertion='# Run script if updated' + local patched_file if [[ ! -f "$file" ]]; then echo "Unable to locate expected Bazzite user setup file: $file" >&2 @@ -171,14 +173,28 @@ patch_gamemode_shortcut_migration() { return 0 fi - cat >> "$file" <<'EOF' + if [[ "$(grep -Foc "$insertion" "$file" || true)" -ne 1 ]]; then + echo "Unable to locate the Bazzite user setup version guard in $file" >&2 + exit 1 + fi -# AeroCore Return to Gaming Mode shortcut migration -# Replace the legacy privileged systemd launcher left by older Bazzite images. -if [[ -f "$HOME/Desktop/Return.desktop" ]]; then - sed -i 's|^Exec=systemctl start return-to-gamemode\.service$|Exec=/usr/bin/return-to-gamemode|' "$HOME/Desktop/Return.desktop" -fi -EOF + patched_file="$(mktemp)" + awk -v insertion="$insertion" ' + !inserted && $0 == insertion { + print "# AeroCore Return to Gaming Mode shortcut migration" + print "# Replace the legacy privileged systemd launcher left by older Bazzite images." + print "if [[ -f \"$HOME/Desktop/Return.desktop\" ]]; then" + print " sed -i '\''s|^Exec=systemctl start return-to-gamemode\\.service$|Exec=/usr/bin/return-to-gamemode|'\'' \"$HOME/Desktop/Return.desktop\"" + print "fi" + print "" + inserted=1 + } + { print } + END { if (!inserted) exit 1 } + ' "$file" > "$patched_file" + + cp "$patched_file" "$file" + rm -f "$patched_file" } # Keep AeroCore's public image-name, while restoring the Deck capability checks -- cgit v1.2.3 From 47ede79dece8e8e04f8105c8f2ef9c8883d9c738 Mon Sep 17 00:00:00 2001 From: tranch Date: Sun, 13 Sep 2026 19:16:12 +0800 Subject: Revert "Run shortcut migration before setup guard" This reverts commit f068acf3b1c2a4551c5119997fd40909ddd35386. --- build_files/patch-bazzite-deck-identity.sh | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) (limited to 'build_files/patch-bazzite-deck-identity.sh') diff --git a/build_files/patch-bazzite-deck-identity.sh b/build_files/patch-bazzite-deck-identity.sh index 8ddacf9..da2a74e 100755 --- a/build_files/patch-bazzite-deck-identity.sh +++ b/build_files/patch-bazzite-deck-identity.sh @@ -161,8 +161,6 @@ patch_desktop_branding_migration() { patch_gamemode_shortcut_migration() { local file="$1" local marker='AeroCore Return to Gaming Mode shortcut migration' - local insertion='# Run script if updated' - local patched_file if [[ ! -f "$file" ]]; then echo "Unable to locate expected Bazzite user setup file: $file" >&2 @@ -173,28 +171,14 @@ patch_gamemode_shortcut_migration() { return 0 fi - if [[ "$(grep -Foc "$insertion" "$file" || true)" -ne 1 ]]; then - echo "Unable to locate the Bazzite user setup version guard in $file" >&2 - exit 1 - fi + cat >> "$file" <<'EOF' - patched_file="$(mktemp)" - awk -v insertion="$insertion" ' - !inserted && $0 == insertion { - print "# AeroCore Return to Gaming Mode shortcut migration" - print "# Replace the legacy privileged systemd launcher left by older Bazzite images." - print "if [[ -f \"$HOME/Desktop/Return.desktop\" ]]; then" - print " sed -i '\''s|^Exec=systemctl start return-to-gamemode\\.service$|Exec=/usr/bin/return-to-gamemode|'\'' \"$HOME/Desktop/Return.desktop\"" - print "fi" - print "" - inserted=1 - } - { print } - END { if (!inserted) exit 1 } - ' "$file" > "$patched_file" - - cp "$patched_file" "$file" - rm -f "$patched_file" +# AeroCore Return to Gaming Mode shortcut migration +# Replace the legacy privileged systemd launcher left by older Bazzite images. +if [[ -f "$HOME/Desktop/Return.desktop" ]]; then + sed -i 's|^Exec=systemctl start return-to-gamemode\.service$|Exec=/usr/bin/return-to-gamemode|' "$HOME/Desktop/Return.desktop" +fi +EOF } # Keep AeroCore's public image-name, while restoring the Deck capability checks -- cgit v1.2.3 From d734f2c746632772b794143762f2fcea78e62011 Mon Sep 17 00:00:00 2001 From: tranch Date: Sun, 13 Sep 2026 19:16:12 +0800 Subject: Revert "Migrate legacy gaming mode shortcut" This reverts commit 9f1490f28db8643e78cd26e3cd8f0c92909f16a2. --- build_files/patch-bazzite-deck-identity.sh | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'build_files/patch-bazzite-deck-identity.sh') diff --git a/build_files/patch-bazzite-deck-identity.sh b/build_files/patch-bazzite-deck-identity.sh index da2a74e..d3ee860 100755 --- a/build_files/patch-bazzite-deck-identity.sh +++ b/build_files/patch-bazzite-deck-identity.sh @@ -158,29 +158,6 @@ patch_desktop_branding_migration() { fi } -patch_gamemode_shortcut_migration() { - local file="$1" - local marker='AeroCore Return to Gaming Mode shortcut migration' - - if [[ ! -f "$file" ]]; then - echo "Unable to locate expected Bazzite user setup file: $file" >&2 - exit 1 - fi - - if grep -Fq "$marker" "$file"; then - return 0 - fi - - cat >> "$file" <<'EOF' - -# AeroCore Return to Gaming Mode shortcut migration -# Replace the legacy privileged systemd launcher left by older Bazzite images. -if [[ -f "$HOME/Desktop/Return.desktop" ]]; then - sed -i 's|^Exec=systemctl start return-to-gamemode\.service$|Exec=/usr/bin/return-to-gamemode|' "$HOME/Desktop/Return.desktop" -fi -EOF -} - # Keep AeroCore's public image-name, while restoring the Deck capability checks # used by Bazzite's runtime scripts. These are literal source lines; variable # expansion must happen later, when the scripts run on the installed system. @@ -220,4 +197,3 @@ patch_condition \ 3 patch_desktop_branding_migration "$(target_path /usr/libexec/bazzite-user-setup)" -patch_gamemode_shortcut_migration "$(target_path /usr/libexec/bazzite-user-setup)" -- cgit v1.2.3