GNU bug report logs - #27242
Fail to load LUKS encrypted rootfs, attempts to open luks device before it's ready.

Previous Next

Package: guix;

Reported by: Adam Van Ymeren <adam <at> vany.ca>

Date: Sun, 4 Jun 2017 22:11:01 UTC

Severity: normal

Done: Mark H Weaver <mhw <at> netris.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 27242 in the body.
You can then email your comments to 27242 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#27242; Package guix. (Sun, 04 Jun 2017 22:11:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Adam Van Ymeren <adam <at> vany.ca>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sun, 04 Jun 2017 22:11:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Adam Van Ymeren <adam <at> vany.ca>
To: bug-guix <at> gnu.org
Subject: Fail to load LUKS encrypted rootfs,
 attempts to open luks device before it's ready.
Date: Sun, 04 Jun 2017 18:06:15 -0400
On my machine when booting GuixSD, it fails to find the rootfs from the
initramfs.  It errors out attempting to find the luks device node.
Shortly after it errors is when I see the kernel dmesg output of the
nvme0 device becomining ready.

It looks like we need to wait for the device node to become ready, or
poll/sleep a few times if we fail to locate the device.

Thanks!
-Adam




Information forwarded to bug-guix <at> gnu.org:
bug#27242; Package guix. (Mon, 05 Jun 2017 10:09:02 GMT) Full text and rfc822 format available.

Message #8 received at 27242 <at> debbugs.gnu.org (full text, mbox):

From: Mark H Weaver <mhw <at> netris.org>
To: Adam Van Ymeren <adam <at> vany.ca>
Cc: 27242 <at> debbugs.gnu.org
Subject: Re: bug#27242: Fail to load LUKS encrypted rootfs,
 attempts to open luks device before it's ready.
Date: Mon, 05 Jun 2017 06:07:52 -0400
Adam Van Ymeren <adam <at> vany.ca> writes:

> On my machine when booting GuixSD, it fails to find the rootfs from the
> initramfs.  It errors out attempting to find the luks device node.
> Shortly after it errors is when I see the kernel dmesg output of the
> nvme0 device becomining ready.
>
> It looks like we need to wait for the device node to become ready, or
> poll/sleep a few times if we fail to locate the device.

I ran into the same problem at one point, and have applied the following
patch to my private branch of Guix.  Perhaps it should be applied to
master.

      Mark


From b7c1947d050a944937b983532d940491821fa75f Mon Sep 17 00:00:00 2001
From: Mark H Weaver <mhw <at> netris.org>
Date: Tue, 28 Mar 2017 05:52:28 -0400
Subject: [PATCH] DRAFT: Cope with delayed appearance of LUKS source.

---
 gnu/system/mapped-devices.scm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gnu/system/mapped-devices.scm b/gnu/system/mapped-devices.scm
index 2959802c9..3659ac2d6 100644
--- a/gnu/system/mapped-devices.scm
+++ b/gnu/system/mapped-devices.scm
@@ -101,6 +101,7 @@
     #~(let ((source #$source))
         ;; XXX: 'use-modules' should be at the top level.
         (use-modules (rnrs bytevectors)           ;bytevector?
+                     (srfi srfi-1)
                      ((gnu build file-systems)
                       #:select (find-partition-by-luks-uuid)))
 
@@ -114,7 +115,11 @@
                         ;; udev-populated /dev/disk/by-id directory but udev may
                         ;; be unavailable at the time we run this.
                         (if (bytevector? source)
-                            (or (find-partition-by-luks-uuid source)
+                            (or (let loop ((tries-left 10))
+                                  (and (positive? tries-left)
+                                       (or (find-partition-by-luks-uuid source)
+                                           (begin (sleep 1)
+                                                  (loop (- tries-left 1))))))
                                 (error "LUKS partition not found" source))
                             source)
 
-- 
2.13.0





Information forwarded to bug-guix <at> gnu.org:
bug#27242; Package guix. (Mon, 05 Jun 2017 16:35:02 GMT) Full text and rfc822 format available.

Message #11 received at 27242 <at> debbugs.gnu.org (full text, mbox):

From: Adam Van Ymeren <adam <at> vany.ca>
To: Mark H Weaver <mhw <at> netris.org>
Cc: 27242 <at> debbugs.gnu.org
Subject: Re: bug#27242: Fail to load LUKS encrypted rootfs,
 attempts to open luks device before it's ready.
Date: Mon, 05 Jun 2017 12:10:58 -0400
Mark H Weaver <mhw <at> netris.org> writes:
>
> I ran into the same problem at one point, and have applied the following
> patch to my private branch of Guix.  Perhaps it should be applied to
> master.

Thanks, this patch works for me.  Something like this upstream would be
nice :)

This can probably be unified with the resolve function defined in build/file-systems.scm




Reply sent to Mark H Weaver <mhw <at> netris.org>:
You have taken responsibility. (Wed, 07 Jun 2017 23:11:02 GMT) Full text and rfc822 format available.

Notification sent to Adam Van Ymeren <adam <at> vany.ca>:
bug acknowledged by developer. (Wed, 07 Jun 2017 23:11:02 GMT) Full text and rfc822 format available.

Message #16 received at 27242-done <at> debbugs.gnu.org (full text, mbox):

From: Mark H Weaver <mhw <at> netris.org>
To: Adam Van Ymeren <adam <at> vany.ca>
Cc: 27242-done <at> debbugs.gnu.org
Subject: Re: bug#27242: Fail to load LUKS encrypted rootfs,
 attempts to open luks device before it's ready.
Date: Wed, 07 Jun 2017 19:10:27 -0400
Adam Van Ymeren <adam <at> vany.ca> writes:

> Mark H Weaver <mhw <at> netris.org> writes:
>>
>> I ran into the same problem at one point, and have applied the following
>> patch to my private branch of Guix.  Perhaps it should be applied to
>> master.
>
> Thanks, this patch works for me.  Something like this upstream would be
> nice :)

I pushed a similar patch to master as commit
f45878a80d412dd79c95e9274c3ee5dd24e1cec9.

> This can probably be unified with the resolve function defined in
> build/file-systems.scm

Thanks for pointing this out.  I don't currently have the spare time to
think about it, but feel free to propose a patch to rework this in a
nicer way :)

I'm closing this bug for now.

     Thanks!
       Mark




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 06 Jul 2017 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 294 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.