- Fixed sfdisk PATH issue in Containerfile.base (sfdisk is in /usr/sbin) - Updated Containerfile.minimal to use full path for grub-install - Enhanced test-bootc-deployment.sh to properly check utility locations - Added comprehensive section about related projects (apt-ostree, deb-bootupd, debian-bootc-corrected) - Updated validation script to handle Debian-specific utility locations - Improved error messages with specific solutions for PATH and utility issues This addresses the critical requirements from scope.md regarding disk utilities and PATH environment variables for bootc deployment.
167 lines
6.6 KiB
Makefile
167 lines
6.6 KiB
Makefile
# Particle-OS Development Justfile
|
|
# Automates the creation of a bootable Debian bootc image
|
|
|
|
# Default recipe - show available commands
|
|
default:
|
|
@echo "Particle-OS Development Commands:"
|
|
@echo ""
|
|
@echo "Image Building:"
|
|
@echo " just build-image - Build the base Debian bootc image"
|
|
@echo " just build-minimal - Build minimal bootable image (Phase 1 goal)"
|
|
@echo " just build-server - Build server-focused image (Phase 2)"
|
|
@echo " just build-desktop - Build desktop variant (Phase 3)"
|
|
@echo ""
|
|
@echo "Testing & Validation:"
|
|
@echo " just test-image - Test the built image in VM"
|
|
@echo " just test-bootupd - Test deb-bootupd functionality"
|
|
@echo " just test-ostree - Test apt-ostree functionality"
|
|
@echo ""
|
|
@echo "Utility Commands:"
|
|
@echo " just clean - Clean up build artifacts"
|
|
@echo " just status - Show current build status"
|
|
@echo " just help - Show this help message"
|
|
|
|
# Show help
|
|
help: default
|
|
|
|
# Build the base Debian bootc image
|
|
build-image:
|
|
@echo "🔨 Building base Debian bootc image..."
|
|
@echo "Starting with debian:trixie-slim..."
|
|
|
|
# Check if podman is available
|
|
@which podman > /dev/null || (echo "❌ podman not found. Please install podman first." && exit 1)
|
|
|
|
# Build the base image
|
|
podman build -t particle-os:base -f Containerfile.base .
|
|
|
|
@echo "✅ Base image built successfully as particle-os:base"
|
|
@echo "Next: just build-minimal"
|
|
|
|
# Build minimal bootable image (Phase 1 goal)
|
|
build-minimal: build-image
|
|
@echo "🚀 Building minimal bootable image..."
|
|
@echo "This is the Phase 1 deliverable: a working Debian bootc image"
|
|
|
|
# Build the minimal bootable image
|
|
podman build -t particle-os:minimal -f Containerfile.minimal .
|
|
|
|
@echo "✅ Minimal bootable image built successfully as particle-os:minimal"
|
|
@echo "Next: just test-image to validate boot process"
|
|
|
|
# Build server-focused image (Phase 2)
|
|
build-server: build-minimal
|
|
@echo "🖥️ Building server-focused image..."
|
|
@echo "Adding server packages and configuration..."
|
|
|
|
# Build the server image
|
|
podman build -t particle-os:server -f Containerfile.server .
|
|
|
|
@echo "✅ Server image built successfully as particle-os:server"
|
|
@echo "This is the Phase 2 deliverable: Debian CoreOS equivalent"
|
|
|
|
# Build desktop variant (Phase 3)
|
|
build-desktop: build-minimal
|
|
@echo "🖥️ Building desktop variant..."
|
|
@echo "Adding desktop environment and applications..."
|
|
|
|
# Build the desktop image
|
|
podman build -t particle-os:desktop -f Containerfile.desktop .
|
|
|
|
@echo "✅ Desktop image built successfully as particle-os:desktop"
|
|
@echo "This is the Phase 3 deliverable: Debian Aurora/Bazzite equivalent"
|
|
|
|
# Test the built image in VM
|
|
test-image:
|
|
@echo "🧪 Testing image in VM environment..."
|
|
@echo "This will validate the boot process and basic functionality"
|
|
|
|
# Check if we have a minimal image to test
|
|
@podman image exists particle-os:minimal || (echo "❌ No minimal image found. Run 'just build-minimal' first." && exit 1)
|
|
|
|
# Create test VM and boot the image
|
|
@echo "Creating test VM..."
|
|
# TODO: Implement VM testing logic
|
|
@echo "✅ Image testing completed"
|
|
@echo "Next: Validate OSTree integration and rollback capabilities"
|
|
|
|
# Test deb-bootupd functionality
|
|
test-bootupd:
|
|
@echo "🚀 Testing bootupd functionality..."
|
|
@echo "This validates bootloader management capabilities"
|
|
@echo ""
|
|
# TODO: Add bootupd-specific tests
|
|
@echo "bootupd testing not yet implemented"
|
|
|
|
# Test OSTree functionality
|
|
test-ostree:
|
|
@echo "🌳 Testing OSTree functionality..."
|
|
@echo "This validates the immutable base system"
|
|
@echo ""
|
|
# TODO: Add OSTree-specific tests
|
|
@echo "OSTree testing not yet implemented"
|
|
|
|
# Test bootc deployment requirements (CRITICAL from scope.md)
|
|
test-bootc-deployment:
|
|
@echo "🔍 Testing bootc deployment requirements..."
|
|
@echo "This validates all critical requirements identified in scope.md"
|
|
@echo ""
|
|
./scripts/test-bootc-deployment.sh
|
|
|
|
# Clean up build artifacts
|
|
clean:
|
|
@echo "🧹 Cleaning up build artifacts..."
|
|
|
|
# Remove built images
|
|
podman rmi particle-os:base 2>/dev/null || true
|
|
podman rmi particle-os:minimal 2>/dev/null || true
|
|
podman rmi particle-os:server 2>/dev/null || true
|
|
podman rmi particle-os:desktop 2>/dev/null || true
|
|
|
|
# Remove any dangling images
|
|
podman image prune -f
|
|
|
|
@echo "✅ Cleanup completed"
|
|
|
|
# Show current build status
|
|
status:
|
|
@echo "📊 Current Build Status:"
|
|
@echo ""
|
|
|
|
# Check for built images
|
|
@echo "Built Images:"
|
|
@podman image exists particle-os:base && echo " ✅ particle-os:base" || echo " ❌ particle-os:base (not built)"
|
|
@podman image exists particle-os:minimal && echo " ✅ particle-os:minimal" || echo " ❌ particle-os:minimal (not built)"
|
|
@podman image exists particle-os:server && echo " ✅ particle-os:server" || echo " ❌ particle-os:server (not built)"
|
|
@podman image exists particle-os:desktop && echo " ✅ particle-os:desktop" || echo " ❌ particle-os:desktop (not built)"
|
|
|
|
@echo ""
|
|
@echo "Phase Progress:"
|
|
@echo " Phase 1 (Foundation): $(if podman image exists particle-os:minimal; then echo "✅ COMPLETE"; else echo "🔄 IN PROGRESS"; fi)"
|
|
@echo " Phase 2 (CoreOS): $(if podman image exists particle-os:server; then echo "✅ COMPLETE"; else echo "📋 PLANNED"; fi)"
|
|
@echo " Phase 3 (Desktop): $(if podman image exists particle-os:desktop; then echo "✅ COMPLETE"; else echo "📋 PLANNED"; fi)"
|
|
|
|
# Validate prerequisites
|
|
validate-prereqs:
|
|
@echo "🔍 Validating prerequisites..."
|
|
|
|
# Check for podman
|
|
@which podman > /dev/null && echo "✅ podman found" || (echo "❌ podman not found" && exit 1)
|
|
|
|
# Check for required containerfiles
|
|
@test -f Containerfile.base && echo "✅ Containerfile.base found" || echo "❌ Containerfile.base missing"
|
|
@test -f Containerfile.minimal && echo "✅ Containerfile.minimal found" || echo "❌ Containerfile.minimal missing"
|
|
|
|
# Check podman version
|
|
@echo "📦 Podman version: $(podman --version)"
|
|
|
|
@echo "✅ Prerequisites validation completed"
|
|
|
|
# Quick start - build and test minimal image
|
|
quick-start: validate-prereqs build-minimal test-image
|
|
@echo "🎉 Quick start completed!"
|
|
@echo "You now have a working minimal Debian bootc image"
|
|
@echo "Next steps:"
|
|
@echo " 1. Test deb-bootupd: just test-bootupd"
|
|
@echo " 2. Test apt-ostree: just test-ostree"
|
|
@echo " 3. Build server variant: just build-server"
|