particle-os/02-installer-bootc/justfile
2025-08-05 04:14:29 +00:00

159 lines
No EOL
3.8 KiB
Makefile

# justfile for Debian Atomic Desktop Bootc Installer
# This creates a bootc-based installer with Calamares
# Variables
IMAGE_NAME := "debian-atomic-installer"
IMAGE_TAG := "latest"
# Default recipe
default: build-installer
# Build the installer container image
build-installer:
@echo "Building Debian Atomic Desktop installer..."
podman build -t {{IMAGE_NAME}}:{{IMAGE_TAG}} .
@echo "Installer image built successfully!"
# Build with a specific tag
build-installer-tag tag:
@echo "Building installer with tag: {{tag}}"
podman build -t {{IMAGE_NAME}}:{{tag}} .
@echo "Installer image built with tag {{tag}}!"
# Test the installer image interactively
test-installer:
@echo "Testing installer image..."
podman run -it --rm {{IMAGE_NAME}}:{{IMAGE_TAG}} /bin/bash
# Test the installer with systemd (for bootc compatibility)
test-installer-systemd:
@echo "Testing installer with systemd support..."
podman run -it --rm \
--privileged \
--systemd=always \
-v /sys/fs/cgroup:/sys/fs/cgroup:rw \
{{IMAGE_NAME}}:{{IMAGE_TAG}}
# Create a bootable ISO from the installer image
create-iso:
@echo "Creating bootable ISO from installer image..."
@echo "This would use bootc to create an ISO from the container"
@echo "bootc container build-iso {{IMAGE_NAME}}:{{IMAGE_TAG}} --output debian-atomic-installer.iso"
# Test the ISO in QEMU
test-iso:
@echo "Testing installer ISO in QEMU..."
qemu-system-x86_64 \
-enable-kvm \
-m 2G \
-cdrom debian-atomic-installer.iso \
-serial mon:stdio \
-nographic
# Build bootable ISO from installer container
build-iso:
@echo "Building bootable ISO from installer container..."
./test-vm.sh build-iso
# Create VM disk for testing
create-vm-disk:
@echo "Creating VM disk for testing..."
./test-vm.sh create-vm
# Start VM with VNC access
start-vm:
@echo "Starting VM with VNC access..."
./test-vm.sh start-vm
# Full VM test (build ISO, create VM, start VM)
test-vm:
@echo "Running full VM test..."
./test-vm.sh test
# Clean up VM files
clean-vm:
@echo "Cleaning up VM files..."
./test-vm.sh clean
# Container VM testing (simpler approach)
test-container:
@echo "Testing installer in container VM..."
./test-container-vm.sh test
# Start container VM
start-container:
@echo "Starting installer container VM..."
./test-container-vm.sh start
# Setup VNC in container
setup-vnc:
@echo "Setting up VNC in container..."
./test-container-vm.sh setup-vnc
# Show container status
container-status:
@echo "Showing container status..."
./test-container-vm.sh status
# Stop container VM
stop-container:
@echo "Stopping installer container VM..."
./test-container-vm.sh stop
# Access container shell
container-shell:
@echo "Accessing container shell..."
./test-container-vm.sh shell
# Real VM testing with QEMU
create-real-vm-disk:
@echo "Creating VM disk..."
./create-vm.sh create-disk
download-debian-iso:
@echo "Downloading Debian ISO..."
./create-vm.sh download-iso
start-real-vm:
@echo "Starting real VM with VNC..."
./create-vm.sh start-vm
vm-install-instructions:
@echo "Showing VM installation instructions..."
./create-vm.sh install
test-real-vm:
@echo "Testing real VM (create disk, download ISO, start VM)..."
./create-vm.sh test
clean-vm-files:
@echo "Cleaning up VM files..."
./create-vm.sh clean
# Clean up
clean:
@echo "Cleaning up installer images..."
podman rmi {{IMAGE_NAME}}:{{IMAGE_TAG}} 2>/dev/null || true
# Clean all related images (simplified)
clean-all:
@echo "Cleaning all installer images..."
@echo "Use 'podman images' and 'podman rmi' manually for now"
# List all installer images
list-images:
@echo "Installer images:"
podman images {{IMAGE_NAME}}
# Show detailed image information
inspect-image:
@echo "Inspecting installer image..."
podman inspect {{IMAGE_NAME}}:{{IMAGE_TAG}}
# Help
help:
@echo "Available commands:"
@just --list
# List all recipes
list: help