summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-04-24 21:56:03 +0200
committerLudovic Courtès <ludo@gnu.org>2019-04-25 00:45:35 +0200
commit5be7aecd1443cdb60fe0252e62767cf1193bf6bd (patch)
treea2553fc930fe99bc1fe7f4b6171c4bae50999139
parent91a7c4998fe4f5a2a63f2ddb4bfeeef81c68b6d7 (diff)
vm: 'system-disk-image' no longer requires the OS to define the "/" file system.
Previously 'guix system disk-image' would fail if the OS didn't define a "/" file system, even though it actually overrides that file system. * gnu/system/vm.scm (system-disk-image)[root-uuid]: Turn into a procedure. Call 'root-uuid' on a variant of OS with a "/" file system and inherit from that.
-rw-r--r--gnu/system/vm.scm19
1 files changed, 14 insertions, 5 deletions
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 22e3fcc5223..92b03b01ad2 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -617,7 +617,7 @@ to USB sticks meant to be read-only."
617 ;; Volume name of the root file system. 617 ;; Volume name of the root file system.
618 (normalize-label "Guix_image")) 618 (normalize-label "Guix_image"))
619 619
620 (define root-uuid 620 (define (root-uuid os)
621 ;; UUID of the root file system, computed in a deterministic fashion. 621 ;; UUID of the root file system, computed in a deterministic fashion.
622 ;; This is what we use to locate the root file system so it has to be 622 ;; This is what we use to locate the root file system so it has to be
623 ;; different from the user's own file system UUIDs. 623 ;; different from the user's own file system UUIDs.
@@ -647,17 +647,26 @@ to USB sticks meant to be read-only."
647 (bootloader grub-mkrescue-bootloader)) 647 (bootloader grub-mkrescue-bootloader))
648 (operating-system-bootloader os))) 648 (operating-system-bootloader os)))
649 649
650 ;; Force our own root file system. 650 ;; Force our own root file system. (We need a "/" file system
651 ;; to call 'root-uuid'.)
651 (file-systems (cons (file-system 652 (file-systems (cons (file-system
652 (mount-point "/") 653 (mount-point "/")
653 (device root-uuid) 654 (device "/dev/placeholder")
655 (type file-system-type))
656 file-systems-to-keep))))
657 (uuid (root-uuid os))
658 (os (operating-system
659 (inherit os)
660 (file-systems (cons (file-system
661 (mount-point "/")
662 (device uuid)
654 (type file-system-type)) 663 (type file-system-type))
655 file-systems-to-keep)))) 664 file-systems-to-keep))))
656 (bootcfg (operating-system-bootcfg os))) 665 (bootcfg (operating-system-bootcfg os)))
657 (if (string=? "iso9660" file-system-type) 666 (if (string=? "iso9660" file-system-type)
658 (iso9660-image #:name name 667 (iso9660-image #:name name
659 #:file-system-label root-label 668 #:file-system-label root-label
660 #:file-system-uuid root-uuid 669 #:file-system-uuid uuid
661 #:os os 670 #:os os
662 #:register-closures? #t 671 #:register-closures? #t
663 #:bootcfg-drv bootcfg 672 #:bootcfg-drv bootcfg
@@ -674,7 +683,7 @@ to USB sticks meant to be read-only."
674 #:disk-image-format "raw" 683 #:disk-image-format "raw"
675 #:file-system-type file-system-type 684 #:file-system-type file-system-type
676 #:file-system-label root-label 685 #:file-system-label root-label
677 #:file-system-uuid root-uuid 686 #:file-system-uuid uuid
678 #:copy-inputs? #t 687 #:copy-inputs? #t
679 #:register-closures? #t 688 #:register-closures? #t
680 #:inputs `(("system" ,os) 689 #:inputs `(("system" ,os)