~ruther/guix-local

10ace2c49eb68b55f8ef0d79d8a408798d99c207 — Ludovic Courtès 11 years ago 85a83ed
vm: disk-image: Specify the root file system using a label.

* gnu/system/vm.scm (system-disk-image)[root-label]: New variable.
  Use it for the root file system, and pass it as #:file-system-label to
  'qemu-image'.
1 files changed, 8 insertions(+), 1 deletions(-)

M gnu/system/vm.scm
M gnu/system/vm.scm => gnu/system/vm.scm +8 -1
@@ 268,6 268,12 @@ the image."
system described by OS.  Said image can be copied on a USB stick as is.  When
VOLATILE? is true, the root file system is made volatile; this is useful
to USB sticks meant to be read-only."
  (define root-label
    ;; Volume name of the root file system.  Since we don't know which device
    ;; will hold it, we use the volume name to find it (using the UUID would
    ;; be even better, but somewhat less convenient.)
    "gnu-disk-image")

  (define file-systems-to-keep
    (remove (lambda (fs)
              (string=? (file-system-mount-point fs) "/"))


@@ 283,7 289,7 @@ to USB sticks meant to be read-only."
              ;; Force our own root file system.
              (file-systems (cons (file-system
                                    (mount-point "/")
                                    (device "/dev/sda1")
                                    (device root-label)
                                    (type file-system-type))
                                  file-systems-to-keep)))))



@@ 293,6 299,7 @@ to USB sticks meant to be read-only."
                  #:disk-image-size disk-image-size
                  #:disk-image-format "raw"
                  #:file-system-type file-system-type
                  #:file-system-label root-label
                  #:copy-inputs? #t
                  #:register-closures? #t
                  #:inputs `(("system" ,os-drv)