help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cannot boot GuixSD after system reconfigure


From: Ludovic Courtès
Subject: Re: Cannot boot GuixSD after system reconfigure
Date: Fri, 22 Sep 2017 16:03:47 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Roel Janssen <address@hidden> skribis:

> Ludovic Courtès writes:

[...]

>>> So, I was able to fix GRUB by manually modifying /boot/grub/grub.cfg:
>>>
>>> -search --label --set /dev/sda3
>>> +search --no-floppy --fs-uuid --set <blkid uuid output>
>>
>> I believe this is fixed with db4e8fd5d4a07d3be8ce68fb96722ef7077c0eee.
>>
>> Could you please let me know if everything’s OK?
>
> I changed the following pieces of my config:
>
>   (bootloader (bootloader-configuration
>                (bootloader grub-efi-bootloader)
>                (target "/boot/efi")))
>
>   (file-systems (cons*
>                  (file-system
>                   (title 'uuid)
>                   (device (uuid "<uuid>"))
>                   (mount-point "/boot")
>                   (needed-for-boot? #t)
>                   (type "ext4"))
>                (file-system
>                   (title 'device)
>                   (device "/dev/sda1")
>                   (mount-point "/boot/efi")
>                   (needed-for-boot? #t)
>                   (type "vfat"))
>                  (file-system
>                   (mount-point "/")
>                   (options "ssd")
>                   (title 'uuid)
>                   (device (uuid "<uuid>"))
>                   (options "ssd")
>                   (type "btrfs"))
>                  (file-system
>                   (title 'device)
>                   (device "tmpfs")
>                   (mount-point "/var/guix/temproots")
>                   (type "tmpfs"))
>                  (file-system
>                   (title 'device)
>                   (device "tmpfs")
>                   (mount-point "/tmp")
>                   (type "tmpfs"))
>                  %base-file-systems))
>
> And with these changes, I can boot GuixSD again.

You mean the fix was insufficient?

> The vfat partitions have a shorter UUID, which are not accepted by
> Guix.  Is this on purpose?  As you can see in the snippet above, I use
> 'device for the vfat partition and 'uuid for the other disk-based
> partitions.  It would be nice to use UUIDs for every partition.

The attached patch almost gets us there: it would allow you to write

  (uuid "aaaa-bbbb" 'fat32)

in your config.

However, there’s one thing I’d like to double-check with Danny, which is
the word order.  With this patch, I have:

  (fat32-uuid->string (string->fat32-uuid "aabb-ccdd"))
  $7 = "CCDD-AABB"

Danny: are you sure the most-significant 16-bit word comes last?

Ludo’.

diff --git a/gnu/system/uuid.scm b/gnu/system/uuid.scm
index 1dd6a1133..dea2083c4 100644
--- a/gnu/system/uuid.scm
+++ b/gnu/system/uuid.scm
@@ -41,6 +41,7 @@
             string->ext3-uuid
             string->ext4-uuid
             string->btrfs-uuid
+            string->fat32-uuid
             iso9660-uuid->string
 
             ;; XXX: For lack of a better place.
@@ -175,6 +176,22 @@ ISO9660 UUID representation."
         (low (bytevector-uint-ref uuid 2 %fat32-endianness 2)))
     (format #f "~:@(~x-~x~)" low high)))
 
+(define %fat32-uuid-rx
+  (make-regexp "^([[:xdigit:]]{4})-([[:xdigit:]]{4})$"))
+
+(define (string->fat32-uuid str)
+  "Parse STR, which is in FAT32 format, and return a bytevector or #f."
+  (match (regexp-exec %fat32-uuid-rx str)
+    (#f
+     #f)
+    (rx-match
+     (uint-list->bytevector (list (string->number
+                                   (match:substring rx-match 1) 16)
+                                  (string->number
+                                   (match:substring rx-match 2) 16))
+                            %fat32-endianness
+                            2))))
+
 
 ;;;
 ;;; Generic interface.
@@ -198,6 +215,7 @@ ISO9660 UUID representation."
 (define %uuid-parsers
   (vhashq
    ('dce 'ext2 'ext3 'ext4 'btrfs 'luks => string->dce-uuid)
+   ('fat32 'fat => string->fat32-uuid)
    ('iso9660 => string->iso9660-uuid)))
 
 (define %uuid-printers

reply via email to

[Prev in Thread] Current Thread [Next in Thread]