Skip to content

Commit

Permalink
add *_vmdk + *_zerofree (compact) targets
Browse files Browse the repository at this point in the history
  • Loading branch information
niflostancu committed Nov 9, 2023
1 parent 14a8952 commit ed82e83
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion framework
Submodule framework updated 2 files
+8 −0 framework.mk
+41 −0 utils/zerofree.sh

0 comments on commit ed82e83

Please sign in to comment.