Subject: Re: [bug#30604] [PATCH v8 3/7] linux-boot: Load kernel modules only when the hardware is present.

From: Danny Milosavljevic <[email-masked]>
Date: Fri, 9 Mar 2018 23:13:20 +0100

Hi Ludo,

On Fri, 09 Mar 2018 23:06:50 +0100
[email-masked] (Ludovic Courtès) wrote:

> When than happens, our modprobe gets called with the “netdev-eth0”
> alias, which it cannot handle, leading to this error.
> 
> By explicitly loading “virtio_net” and

> sleeping a bit, 

Uhhhhh no please don't.

> point, but fail later on:
...
> --8<---------------cut here---------------end--------------->8---
> 
> Here the nls_iso8859-1 module doesn’t get loaded and modprobe isn’t even
> invoked, although my understanding is that it should (per ‘load_nls’ in
> nls_base.c in the kernel, called from vfat/inode.c).
> 
> Similarly, it seems that virtio_blk has to be loaded explicitly: is not
> reported by ‘needed-modules’ (i.e., not listed in /sys/…/modalias), nor
> do we get a modprobe query for it.
> 
> All in all on-demand loading seems more complicated that it seemed.
> 
> What are we missing here?

As I said, modprobe mutates /sys - you cannot use find-files.  I haven't used
ftw just to be contrarian.  There's even a warning comment :-)

In order to find that out, try to print how /sys looked before modprobe - then
in the early guile recovery REPL print how /sys looks again - the alias it
was juuust complaining about will be there just fine.

My patch series works fine lazy-loading the IO charset, virtio_blk, virtio_net.

It took about 30 h to work out the correct minimal combination - just saying :-)