diff options
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 26 |
1 files changed, 20 insertions, 6 deletions
@@ -7,6 +7,17 @@ .PHONY: help deps test-unit test test-keep test-vm-base package-diff +# Filesystem profile for the VM harness: btrfs (default) or zfs. Selects the +# base image the scripts build/use; exported so create-base-vm.sh + run-test.sh +# pick the matching archangel config and image. e.g. make test FS_PROFILE=zfs +FS_PROFILE ?= btrfs +export FS_PROFILE +ifeq ($(FS_PROFILE),btrfs) +BASE_IMAGE := vm-images/archsetup-base.qcow2 +else +BASE_IMAGE := vm-images/archsetup-base-$(FS_PROFILE).qcow2 +endif + # Default target - show help help: @echo "archsetup - install and test" @@ -19,6 +30,9 @@ help: @echo " test-vm-base Create base VM only (runs archangel)" @echo " package-diff Compare archsetup's declared packages vs this system" @echo "" + @echo "Filesystem profile (test, test-keep, test-vm-base):" + @echo " FS_PROFILE=btrfs (default) or zfs, e.g. make test FS_PROFILE=zfs" + @echo "" @echo "Dotfile stow operations now live in the dotfiles repo:" @echo " cd ~/.dotfiles && make stow|restow|reset|unstow|import <de>" @echo "" @@ -51,18 +65,18 @@ test-vm-base: # Test - run full VM integration test suite (creates base VM if needed) test: - @if [ ! -f vm-images/archsetup-base.qcow2 ] || \ - ! qemu-img snapshot -l vm-images/archsetup-base.qcow2 2>/dev/null | grep -q "clean-install"; then \ - echo "Base VM not found or missing snapshot, creating..."; \ + @if [ ! -f $(BASE_IMAGE) ] || \ + ! qemu-img snapshot -l $(BASE_IMAGE) 2>/dev/null | grep -q "clean-install"; then \ + echo "Base VM not found or missing snapshot, creating ($(FS_PROFILE))..."; \ bash scripts/testing/create-base-vm.sh; \ fi @bash scripts/testing/run-test.sh # Test and keep VM running (for manual testing after archsetup) test-keep: - @if [ ! -f vm-images/archsetup-base.qcow2 ] || \ - ! qemu-img snapshot -l vm-images/archsetup-base.qcow2 2>/dev/null | grep -q "clean-install"; then \ - echo "Base VM not found or missing snapshot, creating..."; \ + @if [ ! -f $(BASE_IMAGE) ] || \ + ! qemu-img snapshot -l $(BASE_IMAGE) 2>/dev/null | grep -q "clean-install"; then \ + echo "Base VM not found or missing snapshot, creating ($(FS_PROFILE))..."; \ bash scripts/testing/create-base-vm.sh; \ fi @bash scripts/testing/run-test.sh --keep |
