From 30effa15369a1707755d134e37e63e2df135422e Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Sat, 13 May 2017 18:07:01 -0400 Subject: [PATCH 2/2] maint: The 'release' target builds a VM image. * Makefile.am (GUIXSD_VM_SYSTEMS, GUIXSD_VM_IMAGE_BASE, GUIXSD_VM_IMAGE_SIZE): New variables. (release): Add logic to build a VM image. --- Makefile.am | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Makefile.am b/Makefile.am index 4b5a29a72..8663de3ba 100644 --- a/Makefile.am +++ b/Makefile.am @@ -571,12 +571,21 @@ BINARY_TARBALLS = \ # Systems supported by GuixSD. GUIXSD_SUPPORTED_SYSTEMS ?= x86_64-linux i686-linux +# Systems for which we build GuixSD VMs. +GUIXSD_VM_SYSTEMS ?= x86_64-linux + # Prefix of the GuixSD installation image file name. GUIXSD_IMAGE_BASE = guixsd-usb-install-$(PACKAGE_VERSION) +# Prefix of the GuixSD VM image file name. +GUIXSD_VM_IMAGE_BASE = guixsd-vm-image-$(PACKAGE_VERSION) + # Size of the installation image (for x86_64 typically). GUIXSD_INSTALLATION_IMAGE_SIZE ?= 950MiB +# Size of the VM image (for x86_64 typically). +GUIXSD_VM_IMAGE_SIZE ?= 2GiB + # The release process works in several phases: # # 0. We assume the developer created a 'vX.Y' tag. @@ -627,6 +636,19 @@ release: distcheck mv "$(releasedir)/$(GUIXSD_IMAGE_BASE).$$system.xz.tmp" \ "$(releasedir)/$(GUIXSD_IMAGE_BASE).$$system.xz" ; \ done + for system in $(GUIXSD_VM_SYSTEMS) ; do \ + image=`$(top_builddir)/pre-inst-env \ + guix system vm-image \ + --image-size=$(GUIXSD_VM_IMAGE_SIZE) \ + gnu/system/install.scm` ; \ + if [ ! -f "$$image" ] ; then \ + echo "failed to produced GuixSD VM image for $$system" >&2 ; \ + exit 1 ; \ + fi ; \ + xz < "$$image" > "$(releasedir)/$(GUIXSD_VM_IMAGE_BASE).$$system.xz.tmp" ; \ + mv "$(releasedir)/$(GUIXSD_VM_IMAGE_BASE).$$system.xz.tmp" \ + "$(releasedir)/$(GUIXSD_VM_IMAGE_BASE).$$system.xz" ; \ + done @echo @echo "Congratulations! All the release files are now in $(releasedir)." @echo -- 2.13.0