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
committerLudovic Courtès <ludo@gnu.org>2017-05-20 10:16:23 +0200
commita6c642ef63012508f755a1329aa66e4b09da72b5 (patch)
treedbdaa2f173a62bbbb889c878bf96cc93fe2939a3 /Makefile.am
parent56a03975eb287796128e80feb6799bc07f4b8185 (diff)
downloadguix-a6c642ef63012508f755a1329aa66e4b09da72b5.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 b90f419b14..c2fc2642a7 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)
 
@@ -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