archy/image-recipe/test-start9-build.sh
Dorian ba1a7bd3f6 Enhance README and build scripts for hardware-specific optimizations
- Updated README.md to clarify development setup for macOS/Docker and added production build instructions for specific hardware.
- Introduced new build scripts for optimized OS images targeting Start9 Server Pure, HP ProDesk 400 G4 DM, and Dell OptiPlex.
- Enhanced Dockerfile to specify platform compatibility and improved Alpine profile for Archipelago builds.
- Updated configuration files and init scripts to support new hardware profiles and ensure proper service management.
2026-01-31 19:47:52 +00:00

133 lines
4.2 KiB
Bash
Executable File

#!/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