Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Some modules not loading on boot after kernel reconfigure
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
equaeghe
l33t
l33t


Joined: 22 Feb 2005
Posts: 637

PostPosted: Sat Sep 11, 2021 9:18 pm    Post subject: Some modules not loading on boot after kernel reconfigure Reply with quote

I have been creating a ‘clean’, well-documented kernel config for my system. When booting, it does not load some modules (such as ext4 for a partition automounted at boot). This leaves me with a crippled system if I use that kernel. (I have other kernels that do boot nicely.)
When I modprobe these modules that should have been loaded at boot, they load fine. With my existing kernels, they are loaded automatically at boot.

I am at a loss for what the reason may be: autoloading works for a decent number of modules, but not for all en apparently the ones that do not autoload can be modprobed correctly. In my logs (journalctl -b), I see some consequences of non-loaded modules, but no error or warning messages about failure to load modules. Any help diagnosing and fixing this is much appreciated.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4146
Location: Bavaria

PostPosted: Sat Sep 11, 2021 10:13 pm    Post subject: Reply with quote

equaeghe wrote:
When booting, it does not load some modules (such as ext4 for a partition automounted at boot). This leaves me with a crippled system if I use that kernel. (I have other kernels that do boot nicely.)

Has your root-partition an ext4 filesystem ?
If yes, you MUST build the ext4-module fixed into the kernel - OR - you have to use an initramfs.

(dont forget: Anything (fs, scsi, ...) the kernel needs to find its root-partition must be built-in, NOT as module)
Back to top
View user's profile Send private message
equaeghe
l33t
l33t


Joined: 22 Feb 2005
Posts: 637

PostPosted: Sun Sep 12, 2021 8:54 am    Post subject: Reply with quote

pietinger wrote:
Has your root-partition an ext4 filesystem ?

No. My root is btrfs and that is built-in. The crippled system I mentioned does get to my GUI, but it just that (nex to the ext4 thing) things like bluetooth and wifi do not work because the required modules are not loading.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4146
Location: Bavaria

PostPosted: Sun Sep 12, 2021 9:23 am    Post subject: Reply with quote

If you have no errors in your dmesg, then I would be interested in your kernel version and your selectings in your kernel configuration - section: "Enable loadable module support".
Back to top
View user's profile Send private message
Goverp
Advocate
Advocate


Joined: 07 Mar 2007
Posts: 2003

PostPosted: Sun Sep 12, 2021 11:54 am    Post subject: Reply with quote

Apologies if this is screwy but, I thought there were approx. 4 ways to load modules:
  • initramfs/initrd config or script;
  • /etc/modules.d and its imitations;
  • udev; and
  • something explicit calling modprobe during init.
IIUC there's no kernel function that automatically loads a module just 'cos the system won't work without it
_________________
Greybeard
Back to top
View user's profile Send private message
equaeghe
l33t
l33t


Joined: 22 Feb 2005
Posts: 637

PostPosted: Sun Sep 12, 2021 12:56 pm    Post subject: Reply with quote

pietinger wrote:
If you have no errors in your dmesg, then I would be interested in your kernel version and your selectings in your kernel configuration - section: "Enable loadable module support".
  • 5.10.61-gentoo
  • MODULE and MODULE_UNLOAD are selected there

I've reverted to building on a working config and stepwise working towards the desired one. So I think this issue may remain a mystery.
Back to top
View user's profile Send private message
equaeghe
l33t
l33t


Joined: 22 Feb 2005
Posts: 637

PostPosted: Sun Sep 12, 2021 1:03 pm    Post subject: Reply with quote

Goverp wrote:
  • initramfs/initrd config or script;
  • /etc/modules.d and its imitations;
  • udev; and
  • something explicit calling modprobe during init.
IIUC there's no kernel function that automatically loads a module just 'cos the system won't work without it
  • I do not use an initrd
  • /etc/modules works as it should, i.e., listed modules are loaded
  • udev is fine I guess (userspace was not modified)
  • systemd may do this, I don't know, but also some of the things it wants are not loaded
There is a kernel function that automatically loads a module when it's needed by userspace: __request_module, and that may indeed be something I should investigate further. It may be that the modules that didn't load got requested this way, but that that functionality got disabled in some way.

Thanks for the lead!
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4146
Location: Bavaria

PostPosted: Sun Sep 12, 2021 2:39 pm    Post subject: Reply with quote

equaeghe wrote:
  • 5.10.61-gentoo
  • MODULE and MODULE_UNLOAD are selected there

I've reverted to building on a working config and stepwise working towards the desired one. So I think this issue may remain a mystery.

Maybe you have a version mismatch. Kernel says: A module will not be loaded if the "vermagic" string contained within the kernel module does not match the value of the currently running kernel. If it is known that the module is compatible with the current running kernel the "vermagic" check can be ignored with modprobe --force-vermagic.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4146
Location: Bavaria

PostPosted: Sun Sep 12, 2021 2:43 pm    Post subject: Reply with quote

equaeghe wrote:
There is a kernel function that automatically loads a module when it's needed by userspace: __request_module, and that may indeed be something I should investigate further. It may be that the modules that didn't load got requested this way, but that that functionality got disabled in some way.

Thanks for the lead!


Yes, the kernel is able to load modules automatically. Here is an (old) article about: https://lwn.net/Articles/740455/

P.S.: I dont know until which kernel version it was, but before some time there was a kernel config entry you could select, which decided whether the kernel is doing automatically module loading or not.

Here is an example whats going on: https://duasynt.com/blog/linux-kernel-module-autoloading
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum