GNU bug report logs - #30604
[PATCH 0/4] Load Linux module only when supported hardware is present.

Previous Next

Package: guix-patches;

Reported by: Danny Milosavljevic <dannym <at> scratchpost.org>

Date: Sun, 25 Feb 2018 11:47:02 UTC

Severity: important

Tags: patch

Full log


View this message in rfc822 format

From: ludo <at> gnu.org (Ludovic Courtès)
To: 30604 <at> debbugs.gnu.org
Cc: Danny Milosavljevic <dannym <at> scratchpost.org>
Subject: [bug#30604] Keyboard detection before ‘cryptsetup’ runs
Date: Sun, 18 Mar 2018 16:03:06 +0100
Hi Danny,

ludo <at> gnu.org (Ludovic Courtès) skribis:

> Something annoying is that my external USB keyboard doesn’t work while
> in the initrd (when I type my passphrase).  I can see that it’s detected
> early on, before I type my passphrase:

While experimenting with this on the bare metal, it became clear that
it’s a timing issue: the keyboard is detected right after the cryptsetup
is displayed, so ‘load-needed-linux-modules’ didn’t have a chance to
load the relevant modules.

Similarly, if I boot with ‘--repl’, and I manually type
(load-needed-linux-modules …) from there, then the keyboard’s module
gets loaded as expected.  That’s 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 “udevadm settle”.
Merely calling ‘load-needed-linux-modules’ once isn’t enough.

One way to do that would be to have a separate thread that calls
‘load-needed-linux-modules’ as appropriate.  Ideally it would use
inotify on /sys like udev does, but a poor programmer’s version could
simply call ‘load-needed-linux-modules’ every half a second or so.

Alternately, before passing control to user code (pre-mount actions,
etc.), we could do a “settle” kind of thing: call
‘load-linux-modules-from-directory’ every 0.5 seconds until its result
is the same as before.  There’s still a risk of missing devices, and
those devices will never show up later because nobody’s monitoring /sys.
But then again, “udevadm settle” must have the same problem: it can’t
really know whether things have settled, I guess.

WDYT?

Thanks,
Ludo’.




This bug report was last modified 5 years and 305 days ago.

Previous Next


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