diff options
| author | tranch <tranch.xiao@gmail.com> | 2026-08-28 08:57:25 +0800 |
|---|---|---|
| committer | tranch <tranch.xiao@gmail.com> | 2026-08-28 08:57:35 +0800 |
| commit | 7889a92c2eea98189330ad1fbfbef4c33a7e3071 (patch) | |
| tree | b956f6670a15ab1730588b24567502ff82e64213 /build_files | |
| parent | 258e7422812b1a18f75c5a48030c64ccb16766ba (diff) | |
| download | AeroCore-OS-7889a92c2eea98189330ad1fbfbef4c33a7e3071.tar.gz AeroCore-OS-7889a92c2eea98189330ad1fbfbef4c33a7e3071.zip | |
Move branding migration into user setup
Diffstat (limited to 'build_files')
| -rwxr-xr-x | build_files/build.sh | 2 | ||||
| -rwxr-xr-x | build_files/patch-bazzite-deck-identity.sh | 50 |
2 files changed, 50 insertions, 2 deletions
diff --git a/build_files/build.sh b/build_files/build.sh index 916e29d..559dc7b 100755 --- a/build_files/build.sh +++ b/build_files/build.sh @@ -136,7 +136,5 @@ fi find /etc/environment.d /etc/skel/.config/environment.d -name 99-aerocore-mirrors.conf -type f -exec chmod 0644 {} + 2>/dev/null || true -systemctl enable aerocore-desktop-branding.service - /ctx/install-instruments.sh /ctx/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)" |
