diff --git a/Makefile b/Makefile index f65ba19..01614d9 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ INIT_GOAL = labvm # custom variables NOINSTALL ?= PACKER_ARGS_EXTRA = $(call _packer_var,vm_noinstall,$(NOINSTALL)) +SUDO ?= sudo # Fresh Ubuntu Server base VM ubuntu-ver = 22 @@ -24,11 +25,23 @@ labvm-ver = 2023 labvm-name = RL_$(labvm-ver) labvm-packer-src = ./labvm labvm-src-image = $(basevm-dest-image) +define labvm-extra-rules= +.PHONY: labvm_compact labvm_zerofree +labvm_zerofree: labvm_compact +labvm_compact: + $(SUDO) "$(FRAMEWORK_DIR)/utils/zerofree.sh" "$$(labvm-dest-image)" +endef # Cloud-init image cloudvm-name = RL_$(labvm-ver)_cloud cloudvm-packer-src = $(FRAMEWORK_DIR)/cloudvm cloudvm-src-image = $(labvm-dest-image) +define cloudvm-extra-rules= +.PHONY: cloudvm_compact cloudvm_zerofree +cloudvm_zerofree: cloudvm_compact +cloudvm_compact: + $(SUDO) "$(FRAMEWORK_DIR)/utils/zerofree.sh" "$$(cloudvm-dest-image)" +endef # list with all VMs to generate rules for (note: use dependency ordering!) build-vms += basevm labvm cloudvm diff --git a/framework b/framework index 8a4ad3d..61a0270 160000 --- a/framework +++ b/framework @@ -1 +1 @@ -Subproject commit 8a4ad3df17ab4efa87747f47e2486e9e75a53a11 +Subproject commit 61a02707e3cc24fb126f55650c02b397d34770c4