#!/usr/bin/env bash set -euo pipefail if [[ "${FANYU_S100_MODE:-}" != "edge_remote" ]]; then echo "FANYU_S100_MODE=edge_remote is required; full local platform is unsupported on S100" >&2 exit 2 fi case "$(uname -m)" in aarch64|arm64) ;; *) echo "S100 edge bundle requires ARM64; got $(uname -m)" >&2; exit 2 ;; esac for value in "${FANYU_REMOTE_API_BASE_URL:-}" "${FANYU_REMOTE_BOS_ENDPOINT:-}"; do if [[ ! "$value" =~ ^https?:// ]]; then echo "remote API/BOS endpoints must be absolute HTTP(S) URLs" >&2 exit 2 fi done if [[ "${FANYU_DROSYNC_PLATFORM:-}" != "linux-arm64" ]]; then echo "FANYU_DROSYNC_PLATFORM=linux-arm64 is required" >&2 exit 2 fi if ! command -v drosync >/dev/null 2>&1 || ! command -v drosync-daemon >/dev/null 2>&1; then echo "drosync and drosync-daemon must be installed from the verified ARM64 bundle" >&2 exit 2 fi drosync --json version | grep -q '"releasePlatform":"linux-arm64"' curl --fail --silent --show-error --max-time 15 "${FANYU_REMOTE_API_BASE_URL%/}/api/health" >/dev/null echo "S100 ARM64 drosync preflight passed; external x86_64/GPU control plane is reachable."