feat: kit-connect + syno-balance SPK builds, busfleet hub registration endpoint
- kit-connect SPK (ipq806x): postinst with hub registration, start-stop-status, connect-daemon management, Tailscale + reverse SSH tunnel integration - syno-balance SPK (noarch, test build): SmartWAN-aware dual-WAN load balancer with 6-factor scoring engine, syno-daemon lifecycle - Busfleet hub: register.sh (port pool 2230-2299), Python HTTP server, systemd service, port-registry.json with x4078/x5925 assignments - .gitignore: exclude SSH keys (*_id_ed25519), SPK artifacts (*.spk) Gitea releases: - kit-connect v0.1-0001 → x5925-kit-connect-v1 (production) - syno-balance v0.1-0001 → syno-balance-test-v1 (prerelease) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Executable
+80
@@ -0,0 +1,80 @@
|
||||
#!/bin/sh
|
||||
# build.sh — Assemble syno-balance SPK for Synology SRM (noarch)
|
||||
# Output: syno-balance-0.1-0001.spk
|
||||
# TEST BUILD — not for production.
|
||||
#
|
||||
# SPK structure (outer tar, UNCOMPRESSED):
|
||||
# INFO
|
||||
# PACKAGE_ICON.PNG (64x64)
|
||||
# PACKAGE_ICON_256.PNG (256x256)
|
||||
# scripts/
|
||||
# postinst
|
||||
# start-stop-status
|
||||
# preinst
|
||||
# preuninst
|
||||
# postuninst
|
||||
# conf/
|
||||
# privilege
|
||||
# resource
|
||||
# package.tgz (gzipped inner tar of bin/ + etc/)
|
||||
# checksum (md5 of package.tgz)
|
||||
|
||||
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) ==="
|
||||
|
||||
# Clean and create build staging directory
|
||||
rm -rf "$BUILD_DIR"
|
||||
mkdir -p "$BUILD_DIR"
|
||||
|
||||
# ── 1. Create inner package.tgz (gzipped tar of bin/ + etc/) ──────────
|
||||
echo " → Creating package.tgz"
|
||||
tar -czf "$BUILD_DIR/package.tgz" \
|
||||
--format=ustar \
|
||||
bin/ \
|
||||
etc/
|
||||
|
||||
# ── 2. Generate checksum ──────────────────────────────────────────────
|
||||
echo " → Computing checksum"
|
||||
md5sum "$BUILD_DIR/package.tgz" | awk '{print $1}' > "$BUILD_DIR/checksum"
|
||||
|
||||
# ── 3. Assemble outer SPK (UNCOMPRESSED tar) ──────────────────────────
|
||||
echo " → Assembling SPK"
|
||||
tar -cf "${OUTPUT}" \
|
||||
--format=ustar \
|
||||
-C "$SCRIPT_DIR" \
|
||||
INFO \
|
||||
PACKAGE_ICON.PNG \
|
||||
PACKAGE_ICON_256.PNG \
|
||||
scripts/ \
|
||||
-C "$BUILD_DIR" \
|
||||
package.tgz \
|
||||
checksum
|
||||
|
||||
# SPK conf/ goes in the outer tar too
|
||||
tar -rf "${OUTPUT}" \
|
||||
--format=ustar \
|
||||
-C "$SCRIPT_DIR" \
|
||||
conf/privilege \
|
||||
conf/resource
|
||||
|
||||
# ── 4. Verify ─────────────────────────────────────────────────────────
|
||||
echo " → Verifying SPK contents"
|
||||
tar -tf "${OUTPUT}" | sort
|
||||
|
||||
SIZE=$(stat -f%z "${OUTPUT}" 2>/dev/null || stat -c%s "${OUTPUT}" 2>/dev/null)
|
||||
echo ""
|
||||
echo "=== Build complete: ${OUTPUT} ==="
|
||||
echo " Size: ${SIZE} bytes"
|
||||
echo " MD5: $(md5sum "${OUTPUT}" | awk '{print $1}')"
|
||||
|
||||
# Cleanup
|
||||
rm -rf "$BUILD_DIR"
|
||||
Reference in New Issue
Block a user