From a6c642ef63012508f755a1329aa66e4b09da72b5 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Sat, 13 May 2017 20:44:36 -0400 Subject: maint: The 'release' target builds a VM image. * gnu/system/examples/vm-image.tmpl: New file. * Makefile.am (GUIXSD_VM_SYSTEMS, GUIXSD_VM_IMAGE_BASE, GUIXSD_VM_IMAGE_SIZE): New variables. (release): Add logic to build a VM image. (EXAMPLES): Add 'gnu/system/examples/vm-image.tmpl'. * doc/guix.texi (Running GuixSD in a VM, Installing GuixSD in a VM): Mention the pre-built VM image. --- Makefile.am | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index b90f419b14..c2fc2642a7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,6 +5,7 @@ # Copyright © 2016 Mathieu Lirzin # Copyright © 2016, 2017 Mark H Weaver # Copyright © 2017 Mathieu Othacehe +# Copyright © 2017 Leo Famulari # # This file is part of GNU Guix. # @@ -224,7 +225,8 @@ AUX_FILES = \ EXAMPLES = \ gnu/system/examples/bare-bones.tmpl \ gnu/system/examples/desktop.tmpl \ - gnu/system/examples/lightweight-desktop.tmpl + gnu/system/examples/lightweight-desktop.tmpl \ + gnu/system/examples/vm-image.tmpl GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go $(dist_noinst_DATA:%.scm=%.go) @@ -572,12 +574,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. @@ -632,6 +643,20 @@ release: dist 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 \ + --system=$$system \ + --image-size=$(GUIXSD_VM_IMAGE_SIZE) \ + gnu/system/examples/vm-image.tmpl` ; \ + 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 -- cgit v1.2.3