#!/bin/bash # Quick test build for Start9 Server Pure # This creates a minimal build to verify the system works set -e SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" echo "๐Ÿงช Quick Test Build for Start9 Server Pure" echo "โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”" echo "" echo "This will create a test build to verify the system works." echo "A full production build takes 45-60 minutes." echo "" # Check prerequisites echo "๐Ÿ“‹ Checking prerequisites..." echo "" # Check for Docker on macOS if [ "$(uname)" = "Darwin" ]; then if ! command -v docker >/dev/null 2>&1; then echo "โŒ Docker not found. Install Docker Desktop:" echo " https://www.docker.com/products/docker-desktop" exit 1 fi if ! docker info >/dev/null 2>&1; then echo "โŒ Docker not running. Starting Docker Desktop..." open -a Docker echo "โณ Waiting for Docker to start..." while ! docker info >/dev/null 2>&1; do sleep 2 done echo "โœ… Docker is running" else echo "โœ… Docker is running" fi fi # Check disk space AVAILABLE_SPACE=$(df -h "$SCRIPT_DIR" | awk 'NR==2 {print $4}') echo "โœ… Available disk space: $AVAILABLE_SPACE" echo "" echo "โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”" echo "๐Ÿš€ Starting Test Build" echo "โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”" echo "" # Create test overlay to verify hardware detection works TEST_OVERLAY="$SCRIPT_DIR/alpine-profile/overlay-start9-pure-test" rm -rf "$TEST_OVERLAY" mkdir -p "$TEST_OVERLAY/etc/archipelago" cat > "$TEST_OVERLAY/etc/archipelago/test-info.txt" <<'EOF' This is a test build for Start9 Server Pure. If you can read this file after booting, the build system worked! Hardware Target: Start9 Server Pure CPU: Intel i7-10710U RAM: 32-64GB Storage: 2-4TB NVMe Next steps: 1. Verify this file exists at /etc/archipelago/test-info.txt 2. Check hardware detection: cat /var/log/archipelago-hardware.log 3. View hardware config: cat /etc/archipelago/hardware.toml 4. Run a full production build: ./build-for-hardware.sh start9-pure iso EOF echo "๐Ÿ“ Test overlay created" echo "" # Show what will be built echo "๐Ÿ“ฆ Build Configuration:" echo " Target: Start9 Server Pure" echo " Type: ISO" echo " Test Mode: Yes (quick verification)" echo "" # Ask for confirmation read -p "Continue with test build? (y/n) " -n 1 -r echo "" if [[ ! $REPLY =~ ^[Yy]$ ]]; then echo "โŒ Build cancelled" exit 1 fi echo "" echo "โณ Building... This will take 5-10 minutes for a test build." echo "" # Set test mode environment export ARCHIPELAGO_VERSION="0.1.0-test" export ALPINE_VERSION="3.19" export TEST_MODE="true" # Run the build "$SCRIPT_DIR/build-for-hardware.sh" start9-pure iso # Check if build succeeded if [ -f "$SCRIPT_DIR/results/archipelago-0.1.0-test-start9-pure-x86_64.iso" ]; then echo "" echo "โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”" echo "โœ… Test Build Successful!" echo "โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”" echo "" echo "๐Ÿ“ฆ Output:" ls -lh "$SCRIPT_DIR/results/"*start9-pure*.iso echo "" echo "โœ… The build system is working correctly!" echo "" echo "๐ŸŽฏ Next Steps:" echo "" echo "1. Test in a VM (optional):" echo " qemu-system-x86_64 -m 4G -smp 2 -boot d \\" echo " -cdrom results/archipelago-0.1.0-test-start9-pure-x86_64.iso" echo "" echo "2. Run a full production build:" echo " ./build-for-hardware.sh start9-pure iso" echo "" echo "3. Flash to USB and install on Start9 Server Pure:" echo " sudo dd if=results/archipelago-0.1.0-start9-pure-x86_64.iso \\" echo " of=/dev/sdX bs=1M status=progress" echo "" else echo "" echo "โŒ Test build failed. Check the logs above for errors." exit 1 fi