Files
kit-busrouter/syno-balance/build.sh
T
kitadmin 34f8074ee7 fix: audit gaps — GL local keyword, key authorization in wizards, register script parity
GL daemon: removed remaining 'local ts_ip' (busybox ash compat)
Synology wizard: auto-authorizes tunnel key via POST /api/authorize-key
GL wizard: same key authorization flow added
Synology: added connect-register.sh for parity with GL
syno-balance build.sh: removed deprecated checksum file (same lesson as kit-connect)

All four curl hubs (wizards + register scripts) now have --max-time 15.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-22 04:20:40 +00:00

48 lines
1.2 KiB
Bash
Executable File

#!/bin/sh
# build.sh — Assemble syno-balance SPK for Synology SRM (noarch)
# Output: syno-balance-0.1-0001.spk
# TEST BUILD — not for production.
# Compatible: RT2600ac, RT6600ax, all ipq806x SRM routers.
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$SCRIPT_DIR"
PKG_NAME="syno-balance"
VERSION="0.1-0001"
OUTPUT="${PKG_NAME}-${VERSION}.spk"
BUILD_DIR="/tmp/syno-balance-build-$$"
echo "=== Building ${PKG_NAME}-${VERSION}.spk (TEST BUILD) ==="
rm -rf "$BUILD_DIR"
mkdir -p "$BUILD_DIR"
# Inner package.tgz
tar -czf "$BUILD_DIR/package.tgz" --format=ustar bin/ etc/
# Stage outer SPK
STAGE="$BUILD_DIR/stage"
mkdir -p "$STAGE"
cp INFO PACKAGE_ICON.PNG PACKAGE_ICON_256.PNG "$STAGE/"
cp -r scripts "$STAGE/"
mkdir -p "$STAGE/conf"
cp conf/privilege conf/resource "$STAGE/conf/"
cp "$BUILD_DIR/package.tgz" "$STAGE/"
# Assemble (no checksum — deprecated)
tar -cf "${OUTPUT}" -C "$STAGE" --format=ustar \
INFO PACKAGE_ICON.PNG PACKAGE_ICON_256.PNG scripts conf package.tgz
echo " → SPK contents:"
tar -tf "${OUTPUT}" | sort
SIZE=$(stat -c%s "${OUTPUT}" 2>/dev/null)
echo ""
echo "=== Build complete: ${OUTPUT} ==="
echo " Size: ${SIZE} bytes"
echo " MD5: $(md5sum "${OUTPUT}" | awk '{print $1}')"
rm -rf "$BUILD_DIR"