226 lines
7.7 KiB
Makefile
226 lines
7.7 KiB
Makefile
# Justfile for bootc image creation
|
|
# Provides user-friendly commands for creating bootable images
|
|
|
|
# Default configuration
|
|
default:
|
|
@just --list
|
|
|
|
# Create QCOW2 image from container (default)
|
|
qcow2:
|
|
@echo "Creating QCOW2 image from container..."
|
|
./create-bootc-image.sh -t container -f qcow2
|
|
|
|
# Create QCOW2 image from chroot
|
|
qcow2-chroot:
|
|
@echo "Creating QCOW2 image from chroot..."
|
|
./create-bootc-image.sh -t chroot -f qcow2
|
|
|
|
# Create QCOW2 image from chroot with specific Debian release
|
|
qcow2-chroot-release release="trixie":
|
|
@echo "Creating QCOW2 image from chroot using Debian {{release}}..."
|
|
DEBIAN_RELEASE={{release}} ./create-bootc-image.sh -t chroot -f qcow2
|
|
|
|
# Create ISO image from container
|
|
iso:
|
|
@echo "Creating ISO image from container..."
|
|
./create-bootc-image.sh -t container -f iso
|
|
|
|
# Create ISO image from chroot
|
|
iso-chroot:
|
|
@echo "Creating ISO image from chroot..."
|
|
./create-bootc-image.sh -t chroot -f iso
|
|
|
|
# Create IMG (raw) image from container
|
|
img:
|
|
@echo "Creating IMG image from container..."
|
|
./create-bootc-image.sh -t container -f img
|
|
|
|
# Create IMG (raw) image from chroot
|
|
img-chroot:
|
|
@echo "Creating IMG image from chroot..."
|
|
./create-bootc-image.sh -t chroot -f img
|
|
|
|
# Create all formats from container
|
|
all:
|
|
@echo "Creating all formats from container..."
|
|
./create-bootc-image.sh -t container -f all
|
|
|
|
# Create all formats from chroot
|
|
all-chroot:
|
|
@echo "Creating all formats from chroot..."
|
|
./create-bootc-image.sh -t chroot -f all
|
|
|
|
# Create VMDK image from container
|
|
vmdk:
|
|
@echo "Creating VMDK image from container..."
|
|
./create-bootc-image.sh -t container -f vmdk
|
|
|
|
# Create VDI image from container
|
|
vdi:
|
|
@echo "Creating VDI image from container..."
|
|
./create-bootc-image.sh -t container -f vdi
|
|
|
|
# Create custom image with specific size
|
|
custom size="20" format="qcow2":
|
|
@echo "Creating {{format}} image with size {{size}}GB from container..."
|
|
./create-bootc-image.sh -t container -f {{format}} -s {{size}}
|
|
|
|
# Create custom image from chroot with specific size
|
|
custom-chroot size="20" format="qcow2":
|
|
@echo "Creating {{format}} image with size {{size}}GB from chroot..."
|
|
./create-bootc-image.sh -t chroot -f {{format}} -s {{size}}
|
|
|
|
# Create custom image from chroot with specific size and Debian release
|
|
custom-chroot-release size="20" format="qcow2" release="trixie":
|
|
@echo "Creating {{format}} image with size {{size}}GB from chroot using Debian {{release}}..."
|
|
DEBIAN_RELEASE={{release}} ./create-bootc-image.sh -t chroot -f {{format}} -s {{size}}
|
|
|
|
# Build container only
|
|
build:
|
|
@echo "Building container image..."
|
|
./build-with-cache.sh
|
|
|
|
# Build container without cache
|
|
build-no-cache:
|
|
@echo "Building container image without cache..."
|
|
BUILD_TYPE=container USE_APT_CACHER=false ./create-bootc-image.sh -t container -f qcow2
|
|
|
|
# Setup apt-cacher-ng
|
|
setup-cache:
|
|
@echo "Setting up apt-cacher-ng..."
|
|
./setup-apt-cacher-ng.sh
|
|
|
|
# Test container
|
|
test:
|
|
@echo "Testing container..."
|
|
./test-bootc-container.sh
|
|
|
|
# Create and boot VM
|
|
vm:
|
|
@echo "Creating and booting VM..."
|
|
./create-and-boot-vm.sh
|
|
|
|
# Clean output directory
|
|
clean:
|
|
@echo "Cleaning output directory..."
|
|
rm -rf output/*
|
|
|
|
# Clean work directories
|
|
clean-work:
|
|
@echo "Cleaning work directories..."
|
|
rm -rf work-* simple-work-* ostree-work-*
|
|
|
|
# Clean everything
|
|
clean-all: clean clean-work
|
|
@echo "All cleanup completed"
|
|
|
|
# Show cleanup examples
|
|
cleanup-examples:
|
|
@echo "Cleanup Examples:"
|
|
@echo " # After successful build, clean work files"
|
|
@echo " just clean-work"
|
|
@echo ""
|
|
@echo " # Before new build, clean everything"
|
|
@echo " just clean-all"
|
|
@echo ""
|
|
@echo " # Quick cleanup of just output files"
|
|
@echo " just clean"
|
|
|
|
# Show configuration
|
|
config:
|
|
@echo "Current configuration:"
|
|
@echo "Configuration can be viewed by running:"
|
|
@echo " ./create-bootc-image.sh --help"
|
|
@echo ""
|
|
@echo "Or check the defaults file:"
|
|
@echo " cat config/defaults.sh"
|
|
|
|
# Show available formats
|
|
formats:
|
|
@echo "Available output formats:"
|
|
@echo " qcow2 - QEMU Copy-On-Write (default)"
|
|
@echo " iso - Bootable ISO image"
|
|
@echo " img - Raw disk image"
|
|
@echo " vmdk - VMware disk format"
|
|
@echo " vdi - VirtualBox disk format"
|
|
@echo " all - All formats"
|
|
|
|
# Show build types
|
|
types:
|
|
@echo "Available build types:"
|
|
@echo " container - Extract from container image (default)"
|
|
@echo " chroot - Build from chroot environment"
|
|
|
|
# Show available Debian releases
|
|
releases:
|
|
@echo "Available Debian releases:"
|
|
@echo " trixie - Debian 13 (Testing) - DEFAULT"
|
|
@echo " forky - Debian 14 (Unstable)"
|
|
@echo " sid - Debian Sid (Always Unstable)"
|
|
|
|
# Show examples
|
|
examples:
|
|
@echo "Example commands:"
|
|
@echo " just qcow2 # Create QCOW2 from container"
|
|
@echo " just iso-chroot # Create ISO from chroot"
|
|
@echo " just custom 15 iso # Create 15GB ISO from container"
|
|
@echo " just all # Create all formats from container"
|
|
@echo " just vm # Create and boot VM"
|
|
@echo ""
|
|
@echo "Debian release examples:"
|
|
@echo " just qcow2-chroot-release forky # Create QCOW2 from chroot using Debian 14"
|
|
@echo " just custom-chroot-release 25 iso trixie # Create 25GB ISO from chroot using Debian 13"
|
|
@echo " DEBIAN_RELEASE=sid just qcow2-chroot # Use Debian Sid via environment variable"
|
|
|
|
# Show help
|
|
help:
|
|
@echo "Bootc Image Creation Commands"
|
|
@echo "============================="
|
|
@echo ""
|
|
@echo "Basic Commands:"
|
|
@echo " just qcow2 # Create QCOW2 image (default)"
|
|
@echo " just iso # Create ISO image"
|
|
@echo " just img # Create IMG image"
|
|
@echo " just all # Create all formats"
|
|
@echo ""
|
|
@echo "Chroot Commands:"
|
|
@echo " just qcow2-chroot # Create QCOW2 from chroot"
|
|
@echo " just iso-chroot # Create ISO from chroot"
|
|
@echo " just img-chroot # Create IMG from chroot"
|
|
@echo " just all-chroot # Create all formats from chroot"
|
|
@echo ""
|
|
@echo "Debian Release Commands:"
|
|
@echo " just qcow2-chroot-release forky # Create QCOW2 from chroot using Debian 14"
|
|
@echo " just qcow2-chroot-release sid # Create QCOW2 from chroot using Debian Sid"
|
|
@echo " just custom-chroot-release 25 iso trixie # Create 25GB ISO from chroot using Debian 13"
|
|
@echo ""
|
|
@echo "Custom Commands:"
|
|
@echo " just custom 20 iso # Create 20GB ISO from container"
|
|
@echo " just custom-chroot 15 qcow2 # Create 15GB QCOW2 from chroot"
|
|
@echo ""
|
|
@echo "Utility Commands:"
|
|
@echo " just build # Build container only"
|
|
@echo " just vm # Create and boot VM"
|
|
@echo " just clean # Clean output files"
|
|
@echo " just clean-work # Clean work directories"
|
|
@echo " just clean-all # Clean everything"
|
|
@echo " just cleanup-examples # Show cleanup examples"
|
|
@echo " just config # Show configuration"
|
|
@echo " just formats # Show available formats"
|
|
@echo " just types # Show build types"
|
|
@echo " just releases # Show available Debian releases"
|
|
@echo " just examples # Show examples"
|
|
@echo ""
|
|
@echo "Environment Variables:"
|
|
@echo " DEBIAN_RELEASE # Set Debian release (trixie, forky, sid)"
|
|
@echo " BUILD_TYPE # Set build type (container, chroot)"
|
|
@echo " OUTPUT_FORMATS # Set output format (qcow2, iso, img, vmdk, vdi, all)"
|
|
@echo ""
|
|
@echo "For more options, run: ./create-bootc-image.sh --help"
|
|
|
|
# List all available commands
|
|
list:
|
|
@echo "Available commands:"
|
|
@just --list
|
|
|
|
|