# 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-phase2 - Build Phase 2 CoreOS with OSTree management" @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-phase2 - Test Phase 2 CoreOS functionality" @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 Phase 2 CoreOS image with OSTree management build-phase2: build-minimal @echo "๐Ÿš€ Building Phase 2 CoreOS image..." @echo "Implementing OSTree repository setup and management" @echo "This is the Phase 2 deliverable: Working CoreOS with update capabilities" # Build the Phase 2 image podman build -t particle-os:phase2 -f Containerfile.phase2 . @echo "โœ… Phase 2 CoreOS image built successfully as particle-os:phase2" @echo "Next: just test-phase2 to validate OSTree functionality" # 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 # Test bootable image creation and QEMU boot test-boot: @echo "๐Ÿš€ Testing bootable image creation and QEMU boot..." @echo "This validates the complete boot process from disk image to system" @echo "" ./scripts/test-boot.sh # Test Phase 2 CoreOS functionality test-phase2: @echo "๐ŸŒณ Testing Phase 2 CoreOS functionality..." @echo "This validates OSTree repository setup and management capabilities" @echo "" # Check if we have a Phase 2 image to test @podman image exists particle-os:phase2 || (echo "โŒ No Phase 2 image found. Run 'just build-phase2' first." && exit 1) # Test OSTree repository functionality @echo "Testing OSTree repository..." podman run --rm particle-os:phase2 /bin/bash -c "ostree --repo=/ostree/repo log 2>/dev/null || echo 'Repository ready for first commit'" # Test deployment structure @echo "Testing deployment structure..." podman run --rm particle-os:phase2 /bin/bash -c "ls -la /sysroot/ostree/deploy/particle-os/minimal/" # Test Phase 2 management tools @echo "Testing Phase 2 management tools..." podman run --rm particle-os:phase2 /bin/bash -c "/usr/local/bin/particle-ostree-update" @echo "โœ… Phase 2 testing completed" @echo "Next: Validate system updates and rollback mechanisms" # 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:phase2 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:phase2 && echo " โœ… particle-os:phase2" || echo " โŒ particle-os:phase2 (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:phase2; 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"