summary refs log tree commit diff
path: root/gnu/system/vm.scm
diff options
context:
space:
mode:
authorLeo Famulari <leo@famulari.name>2018-01-11 14:22:50 -0800
committerLeo Famulari <leo@famulari.name>2018-01-11 14:22:50 -0800
commit4adb40bffc0dda8871878283887a0e0cd88d9578 (patch)
tree74d5fb686116002da72de4a1075d0ed8f307cec1 /gnu/system/vm.scm
parent4610ab7c9a5327df0d475262817bc081a5891aa8 (diff)
parent138c08899ba73049de8afd2b74a8cf6845a1d9e1 (diff)
downloadguix-4adb40bffc0dda8871878283887a0e0cd88d9578.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/system/vm.scm')
-rw-r--r--gnu/system/vm.scm18
1 files changed, 15 insertions, 3 deletions
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 53629daa90..496f2ac4e1 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
 ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
@@ -503,6 +503,14 @@ of the GNU system as described by OS."
                     (string-prefix? "/dev/" source))))
             (operating-system-file-systems os)))
 
+  (define root-uuid
+    ;; UUID of the root file system.
+    (operating-system-uuid os
+                           (if (string=? file-system-type "iso9660")
+                               'iso9660
+                               'dce)))
+
+
   (let ((os (operating-system (inherit os)
               ;; Use an initrd with the whole QEMU shebang.
               (initrd (lambda (file-systems . rest)
@@ -511,10 +519,13 @@ of the GNU system as described by OS."
                                #:virtio? #t
                                rest)))
 
-              ;; Force our own root file system.
+              ;; Force our own root file system.  Refer to it by UUID so that
+              ;; it works regardless of how the image is used ("qemu -hda",
+              ;; Xen, etc.).
               (file-systems (cons (file-system
                                     (mount-point "/")
-                                    (device "/dev/sda1")
+                                    (device root-uuid)
+                                    (title 'uuid)
                                     (type file-system-type))
                                   file-systems-to-keep)))))
     (mlet* %store-monad
@@ -526,6 +537,7 @@ of the GNU system as described by OS."
                                  (operating-system-bootloader os))
                    #:disk-image-size disk-image-size
                    #:file-system-type file-system-type
+                   #:file-system-uuid root-uuid
                    #:inputs `(("system" ,os-drv)
                               ("bootcfg" ,bootcfg))
                    #:copy-inputs? #t))))