From: ludo@gnu.org (Ludovic Courtès)
To: Roel Janssen <roel@gnu.org>
Cc: 28445@debbugs.gnu.org,
Danny Milosavljevic <dannym@scratchpost.org>,
help-guix <help-guix@gnu.org>
Subject: Re: Cannot boot GuixSD after system reconfigure
Date: Fri, 22 Sep 2017 16:03:47 +0200 [thread overview]
Message-ID: <87a81msud8.fsf@gnu.org> (raw)
In-Reply-To: <87vakbmvgb.fsf@gnu.org> (Roel Janssen's message of "Fri, 22 Sep 2017 02:24:36 +0200")
[-- Attachment #1: Type: text/plain, Size: 2548 bytes --]
Roel Janssen <roel@gnu.org> 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’.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1408 bytes --]
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))))
+
\f
;;;
;;; 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
next prev parent reply other threads:[~2017-09-22 14:04 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-21 12:21 Cannot boot GuixSD after system reconfigure Roel Janssen
2017-09-21 19:04 ` Roel Janssen
2017-09-21 20:28 ` Ricardo Wurmus
2017-09-21 22:12 ` Ludovic Courtès
2017-09-22 0:24 ` bug#28445: " Roel Janssen
2017-09-22 14:03 ` Ludovic Courtès [this message]
2017-09-22 14:23 ` Danny Milosavljevic
2017-09-22 16:41 ` Ludovic Courtès
2017-09-22 19:53 ` Roel Janssen
2017-09-25 7:33 ` Ludovic Courtès
2017-09-26 19:24 ` bug#28445: " Roel Janssen
2017-09-26 2:27 ` Danny Milosavljevic
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a81msud8.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=28445@debbugs.gnu.org \
--cc=dannym@scratchpost.org \
--cc=help-guix@gnu.org \
--cc=roel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).