summary refs log tree commit diff
path: root/Makefile.am
diff options
context:
space:
mode:
authorLeo Famulari <leo@famulari.name>2017-05-13 20:44:36 -0400
committerLeo Famulari <leo@famulari.name>2017-05-17 14:12:51 -0400
commit4b236c88eaa690a045bc57b9c4d2acf44ae91f17 (patch)
tree8421913d27e375c76deafd7c451f0fb7d4530906 /Makefile.am
parent872a6fd98868d345443f04efdfd974d148c57f9d (diff)
downloadguix-4b236c88eaa690a045bc57b9c4d2acf44ae91f17.tar.gz
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.
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am27
1 files changed, 26 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index 2dfb627239..7c07d1b2b9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,6 +5,7 @@
 # Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
 # Copyright © 2016, 2017 Mark H Weaver <mhw@netris.org>
 # Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
+# Copyright © 2017 Leo Famulari <leo@famulari.name>
 #
 # 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)
 
@@ -571,12 +573,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.
@@ -631,6 +642,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