From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 26 09:37:08 2018 Received: (at 30604) by debbugs.gnu.org; 26 Mar 2018 13:37:09 +0000 Received: from localhost ([127.0.0.1]:53748 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f0SJA-0006lr-O0 for submit@debbugs.gnu.org; Mon, 26 Mar 2018 09:37:08 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:41000) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f0SJ6-0006le-Gn; Mon, 26 Mar 2018 09:37:05 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 5C63812388; Mon, 26 Mar 2018 15:37:03 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sqtncgtjmxpE; Mon, 26 Mar 2018 15:37:02 +0200 (CEST) Received: from ribbon (unknown [193.50.110.93]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 1A24E1216A; Mon, 26 Mar 2018 15:37:02 +0200 (CEST) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Jan Nieuwenhuizen Subject: Re: bug#30922: LUKS-encrypted root fails using device numbering, needs luksUUID References: <87tvt5dgsa.fsf@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 6 Germinal an 226 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 26 Mar 2018 15:37:01 +0200 In-Reply-To: <87tvt5dgsa.fsf@gnu.org> (Jan Nieuwenhuizen's message of "Sat, 24 Mar 2018 09:22:29 +0100") Message-ID: <87efk7dkle.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 30604 Cc: 30922@debbugs.gnu.org, 30604@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) Hello, Jan Nieuwenhuizen skribis: > After booting I get > > Device /dev/nvme0n1p1 doesn't exist or access denied This message comes from =E2=80=98cryptsetup=E2=80=99. The =E2=80=98init=E2=80=99 script for the config you posted does this: --8<---------------cut here---------------start------------->8--- (boot-system #:mounts (map spec->file-system (quote (("/dev/mapper/guix" device "/" "ext4" () #f #t)))) #:pre-mount (lambda () (and (let ((source "/dev/nvme0n1p1")) (use-modules (rnrs bytevectors) ((gnu build file-systems) #:select (find-partition-by-luks-uui= d))) (zero? (system* "/gnu/store/v5r0dx5v08847rcy033ky= ish6m3b3621-cryptsetup-static-1.7.5/sbin/cryptsetup" "open" "--type" "luks" (if (bytevector? source) (or (let loop ((tries-left 10= )) (and (positive? tries-l= eft) (or (find-partitio= n-by-luks-uuid source) (begin (sleep 1) (loop (- tri= es-left 1)))))) (error "LUKS partition no= t found" source)) source) "guix"))))) =E2=80=A6 --8<---------------cut here---------------end--------------->8--- IOW, it does the right thing whether or not you=E2=80=99re using a UUID. However, when using a UUID, it waits for the device to show up, whereas otherwise it assumes the /dev node is already there and invokes =E2=80=98cryptsetup=E2=80=99 right away. We should fix that and generalize the wait-for-device loop, which already exists in a couple of instances. There are connections with . Ludo=E2=80=99.