summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortranch <tranch.xiao@gmail.com>2026-09-11 02:09:29 +0800
committertranch <tranch.xiao@gmail.com>2026-09-11 02:09:29 +0800
commitb7cf961255e1f1efbae76c9a6a1a63e5a0f3bae7 (patch)
tree4e6af227b9f87536cbc06b9f1cb73c9ac7186cec
parent6f6f3c5f02f2c8d909c263166793dd4fb05e547c (diff)
downloadAeroCore-OS-b7cf961255e1f1efbae76c9a6a1a63e5a0f3bae7.tar.gz
AeroCore-OS-b7cf961255e1f1efbae76c9a6a1a63e5a0f3bae7.zip
Configure Decky plugin store mirror
Persist the AeroCore plugin store URL after installation. Avoid service startup races when updating loader.json.
-rw-r--r--system_files/usr/share/ublue-os/just/92-aerocore-decky-mirror.just24
-rwxr-xr-xtests/test-decky-mirror-ujust.sh12
2 files changed, 36 insertions, 0 deletions
diff --git a/system_files/usr/share/ublue-os/just/92-aerocore-decky-mirror.just b/system_files/usr/share/ublue-os/just/92-aerocore-decky-mirror.just
index bfba05b..df9b6d5 100644
--- a/system_files/usr/share/ublue-os/just/92-aerocore-decky-mirror.just
+++ b/system_files/usr/share/ublue-os/just/92-aerocore-decky-mirror.just
@@ -27,6 +27,8 @@ setup-decky-mirror ACTION="":
DECKY_MIRROR_HOST="${AEROCORE_DECKY_MIRROR_HOST:-decky.mirror.aerocore.com.cn}"
DECKY_INSTALLER_BASE="https://${DECKY_MIRROR_HOST}/SteamDeckHomebrew/decky-installer/releases/latest/download"
+ DECKY_PLUGIN_MIRROR_HOST="${AEROCORE_DECKY_PLUGIN_MIRROR_HOST:-plugins.decky.mirror.aerocore.com.cn}"
+ DECKY_PLUGIN_STORE_URL="https://${DECKY_PLUGIN_MIRROR_HOST}/plugins"
get_status_token() {
local decky_service="/etc/systemd/system/plugin_loader.service"
@@ -63,6 +65,22 @@ setup-decky-mirror ACTION="":
fi
}
+ configure_plugin_store() {
+ echo "Configuring Decky plugin store: ${DECKY_PLUGIN_STORE_URL}"
+ local settings_file="$HOME/homebrew/settings/loader.json"
+ local settings_dir="$(dirname "$settings_file")"
+ local temporary_file
+ mkdir -p "$settings_dir"
+ temporary_file="$(mktemp "${settings_dir}/.loader.XXXXXX")"
+ if [[ -f "$settings_file" ]]; then
+ jq --arg store_url "$DECKY_PLUGIN_STORE_URL" '.store = 2 | ."store-url" = $store_url' "$settings_file" > "$temporary_file"
+ else
+ jq -n --arg store_url "$DECKY_PLUGIN_STORE_URL" '{store: 2, "store-url": $store_url}' > "$temporary_file"
+ fi
+ chmod --reference="$settings_file" "$temporary_file" 2>/dev/null || chmod 0644 "$temporary_file"
+ mv -f "$temporary_file" "$settings_file"
+ }
+
install_release() {
setup_home_deck_compat
if [[ "$HAS_GRAPHICAL_SESSION" -eq 1 ]]; then
@@ -72,6 +90,9 @@ setup-decky-mirror ACTION="":
curl -L "${DECKY_INSTALLER_BASE}/install_release.sh" | sh
fi
run_as_root chcon -R -t bin_t "$HOME/homebrew/services/PluginLoader"
+ run_as_root systemctl stop plugin_loader.service 2>/dev/null || true
+ configure_plugin_store
+ run_as_root systemctl start plugin_loader.service 2>/dev/null || true
}
install_prerelease() {
@@ -83,6 +104,9 @@ setup-decky-mirror ACTION="":
curl -L "${DECKY_INSTALLER_BASE}/install_prerelease.sh" | sh
fi
run_as_root chcon -R -t bin_t "$HOME/homebrew/services/PluginLoader"
+ run_as_root systemctl stop plugin_loader.service 2>/dev/null || true
+ configure_plugin_store
+ run_as_root systemctl start plugin_loader.service 2>/dev/null || true
}
uninstall() {
diff --git a/tests/test-decky-mirror-ujust.sh b/tests/test-decky-mirror-ujust.sh
index bb15f26..125983b 100755
--- a/tests/test-decky-mirror-ujust.sh
+++ b/tests/test-decky-mirror-ujust.sh
@@ -24,6 +24,18 @@ if rg -q 'https://github\.com/SteamDeckHomebrew/decky-installer' "${recipe}"; th
exit 1
fi
+if ! rg -q 'configure_plugin_store\(\)' "${recipe}" || \
+ ! rg -q 'plugins\.decky\.mirror\.aerocore\.com\.cn' "${recipe}" || \
+ ! rg -q 'DECKY_PLUGIN_STORE_URL=.*\/plugins' "${recipe}"; then
+ echo "Decky mirror recipe must configure the AeroCore plugin store URL" >&2
+ exit 1
+fi
+
+if ! rg -q 'loader\.json' "${recipe}" || ! rg -q '\.store = 2' "${recipe}" || ! rg -q 'store-url' "${recipe}"; then
+ echo "Decky mirror recipe must persist the custom plugin store in loader.json" >&2
+ exit 1
+fi
+
for script_name in install_release.sh install_prerelease.sh uninstall.sh; do
if ! rg -q "\\$\\{DECKY_INSTALLER_BASE\\}/${script_name}" "${recipe}"; then
echo "Decky mirror recipe does not route ${script_name} through the mirror base" >&2