From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Cannot boot GuixSD after system reconfigure Date: Fri, 22 Sep 2017 16:03:47 +0200 Message-ID: <87a81msud8.fsf@gnu.org> References: <87bmm3kh47.fsf@gnu.org> <87fubf4s77.fsf@gnu.org> <87vakbmvgb.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54242) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvOZ0-0007ej-DC for help-guix@gnu.org; Fri, 22 Sep 2017 10:04:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dvOYu-0001rE-Bt for help-guix@gnu.org; Fri, 22 Sep 2017 10:04:18 -0400 In-Reply-To: <87vakbmvgb.fsf@gnu.org> (Roel Janssen's message of "Fri, 22 Sep 2017 02:24:36 +0200") List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: Roel Janssen Cc: 28445@debbugs.gnu.org, Danny Milosavljevic , help-guix --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Roel Janssen skribis: > Ludovic Court=C3=A8s 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 >> >> I believe this is fixed with db4e8fd5d4a07d3be8ce68fb96722ef7077c0eee. >> >> Could you please let me know if everything=E2=80=99s 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 "")) > (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 "")) > (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=E2=80=99s one thing I=E2=80=99d like to double-check with Da= nny, which is the word order. With this patch, I have: (fat32-uuid->string (string->fat32-uuid "aabb-ccdd")) $7 =3D "CCDD-AABB" Danny: are you sure the most-significant 16-bit word comes last? Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline 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 --=-=-=--