From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 18 11:03:14 2018 Received: (at 30604) by debbugs.gnu.org; 18 Mar 2018 15:03:14 +0000 Received: from localhost ([127.0.0.1]:40272 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1exZq4-0007az-7r for submit@debbugs.gnu.org; Sun, 18 Mar 2018 11:03:12 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:54062) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1exZq1-0007aq-1c for 30604@debbugs.gnu.org; Sun, 18 Mar 2018 11:03:09 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 14B7712144; Sun, 18 Mar 2018 16:03:08 +0100 (CET) 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 LgJO4LfYHAja; Sun, 18 Mar 2018 16:03:07 +0100 (CET) Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id D644E1210F; Sun, 18 Mar 2018 16:03:06 +0100 (CET) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: 30604@debbugs.gnu.org Subject: Keyboard detection before =?utf-8?B?4oCYY3J5cHRzZXR1cOKAmQ==?= runs References: <87h8plkkkc.fsf@gnu.org> <20180312221541.1886-1-ludo@gnu.org> <20180312221541.1886-5-ludo@gnu.org> <87fu54fjfj.fsf@gnu.org> Date: Sun, 18 Mar 2018 16:03:06 +0100 Message-ID: <87o9jlo28l.fsf@inria.fr> 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: Danny Milosavljevic 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 (+) Hi Danny, ludo@gnu.org (Ludovic Court=C3=A8s) skribis: > Something annoying is that my external USB keyboard doesn=E2=80=99t work = while > in the initrd (when I type my passphrase). I can see that it=E2=80=99s d= etected > early on, before I type my passphrase: While experimenting with this on the bare metal, it became clear that it=E2=80=99s a timing issue: the keyboard is detected right after the crypt= setup is displayed, so =E2=80=98load-needed-linux-modules=E2=80=99 didn=E2=80=99t= have a chance to load the relevant modules. Similarly, if I boot with =E2=80=98--repl=E2=80=99, and I manually type (load-needed-linux-modules =E2=80=A6) from there, then the keyboard=E2=80= =99s module gets loaded as expected. That=E2=80=99s because the device showed up in the meantime and the kernel created a /sys entry for it. In essence, we want a mini-udev and something akin to =E2=80=9Cudevadm sett= le=E2=80=9D. Merely calling =E2=80=98load-needed-linux-modules=E2=80=99 once isn=E2=80= =99t enough. One way to do that would be to have a separate thread that calls =E2=80=98load-needed-linux-modules=E2=80=99 as appropriate. Ideally it wou= ld use inotify on /sys like udev does, but a poor programmer=E2=80=99s version cou= ld simply call =E2=80=98load-needed-linux-modules=E2=80=99 every half a second= or so. Alternately, before passing control to user code (pre-mount actions, etc.), we could do a =E2=80=9Csettle=E2=80=9D kind of thing: call =E2=80=98load-linux-modules-from-directory=E2=80=99 every 0.5 seconds until= its result is the same as before. There=E2=80=99s still a risk of missing devices, and those devices will never show up later because nobody=E2=80=99s monitoring = /sys. But then again, =E2=80=9Cudevadm settle=E2=80=9D must have the same problem= : it can=E2=80=99t really know whether things have settled, I guess. WDYT? Thanks, Ludo=E2=80=99.