Hello, I followed this guide to load my module at boot time and it worked
In my module I an using the wait_for_random_bytes() function from linux/random.h, so my module can have some delay in loading.
The modules are loaded sequentially? This module of mine can delay the loading of other modules?
Thank you for your answer!
Maybe I don’t get it, but my purpose is not to use a function to delay some modules.
My question is if, by loading my module at boot time, and calling wait_for_random_bytes(), am I actually delaying the loading of other modules?
I don’t think so (as I am not the Linux kernel dev). But, one can control order of loading from config file using /etc/modprobe.d/ directory. For example, create a new config file called /etc/modprobe.d/demo.conf :
softdep c pre: a b post: d e
So when system boots or root usr run sudo modprobe c command, first system loads a and b module, next it would load c module, and finally d and e modules. It is like as follows but using config file
modprobe a b c d e
This is only way to control sequentially loading modules as per your need. Another option might work as follows:
## many system services uses numbers 0,1,2,3 and so on to load config
## options sequentially. So load foo first and next load bar module config