From 32f81419098bac6fd02739b18023b921de08bb9b 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 a1ba0cbb957c2763e43a0bc3b19618ec6059c7e2 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