guix_mirror_bot pushed a commit to branch master
in repository guix.

commit 42d2543dd2985a904ab5f16a1c8b2abb354aa923
Author: Ludovic Courtès <[email protected]>
AuthorDate: Sat Nov 7 19:08:25 2026 +0100

    vm: Refer to a single operating system in ‘guix system vm’.
    
    This fixes a bug whereby ‘guix system vm’ would actually build two slightly
    different system derivations: one with its root device having a UUID 
assigned
    by ‘operating-system-for-image’, and the second one without this UUID
    assignment.  As a result, /run/current-system would point to the “wrong”
    one—i.e., not the registered as a valid store item in the image.
    
    * gnu/system/vm.scm (system-qemu-image/shared-store-script): Define ‘os’ to
    match what’s in ‘base-image’.
    
    Signed-off-by: Ludovic Courtès <[email protected]>
---
 gnu/system/vm.scm | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 677e0132203..c77234cd39f 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -297,15 +297,19 @@ useful when FULL-BOOT?  is true."
               #:volatile? volatile?
               #:system system
               #:target target))
-         (base-image (system-image
-                      (image
-                        (inherit
-                         (raw-with-offset-disk-image))
-                        (operating-system os)
-                        (size disk-image-size)
-                        (shared-store?
-                         (and (not full-boot?) volatile?))
-                        (volatile-root? volatile?)))))
+         (raw-image (image
+                      (inherit (raw-with-offset-disk-image))
+                      (operating-system os)
+                      (size disk-image-size)
+                      (shared-store?
+                       (and (not full-boot?) volatile?))
+                      (volatile-root? volatile?)))
+         (base-image (system-image raw-image))
+
+         ;; Make sure the code below refers to the operating system as it
+         ;; exists in the image, following transformations such as UUID
+         ;; assignment for its root device.
+         (os (operating-system-for-image raw-image)))
     (define kernel-arguments
       #~(list #$@(if graphic? #~() #~("console=ttyS0"))
               #$@(operating-system-kernel-arguments os "/dev/vda1")))

Reply via email to