How do I define dependency among kernel modules?

guru th

How one can define a dependency for modules in kernel,

Example:

got module1 and module2.

How do I say say kernel module2 should be loaded after module1 or module2 is dependent of module1?

Note : module2 is not using any symbol from module1, but still order is important in my use case. so don't relate with moddep in kernel.

jjm

For easy solution, you can add symbol in first module and check that symbol in second module init. If symbol is not exported using

EXPORT_SYMBOL 

you can return from second module initialization itself.

For details, from header

      Linux kernel modules can provide services (called "symbols") for other
   modules to use (using one of the EXPORT_SYMBOL variants in the code).
   If a second module uses this symbol, that second module clearly depends
   on the first module. These dependencies can get quite complex.

   depmod creates a list of module dependencies by reading each module
   under /lib/modules/version and determining what symbols it exports and
   what symbols it needs. By default, this list is written to modules.dep,
   and a binary hashed version named modules.dep.bin, in the same
   directory. If filenames are given on the command line, only those
   modules are examined (which is rarely useful unless all modules are
   listed).  depmod also creates a list of symbols provided by modules in
   the file named modules.symbols and its binary hashed version,
   modules.symbols.bin. Finally, depmod will output a file named
   modules.devname if modules supply special device names (devname) that
   should be populated in /dev on boot (by a utility such as udev).

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How do I define a variable for the dependency version in Gradle

From Dev

How Do I Manage Multiple Kernel Modules by the Same Name?

From Dev

How do I define cyclical structs across modules and files in Rust?

From Dev

Using css modules how do I define a global class

From Dev

How do you define constants in Elixir modules?

From Dev

How do I update my nvidia modules after updating my kernel?

From Dev

using css modules how do I define more than one style name

From Dev

How do I recompile the kernel?

From Dev

How do I define a function?

From Dev

How do I wire modules?

From Dev

How do I best share behavior among Akka actors?

From Dev

How do I find where a symbol is defined among static libraries

From Dev

How do I manage UI state among subcomponents?

From Dev

How do I share a single computer among different users?

From Dev

How to blacklist kernel modules?

From Dev

How do proprietary modules work for majority of kernel versions?

From Dev

How to void name conflicts among modules in Rascal?

From Dev

How can I know/list available options for kernel modules?

From Dev

How can I know/list available options for kernel modules?

From Dev

How can I install kernel modules on a mounted file system?

From Dev

Why do I need to re-load kernel modules for virtualbox after a kernel update?

From Dev

Why do I need to re-load kernel modules for virtualbox after a kernel update?

From Dev

How do you define node_modules as externs in Closure Compiler?

From Dev

How do I build the iptables kernel module for a loaded kernel?

From Dev

How do I use GMock with dependency injection?

From Dev

How do I fix this dependency issue in Clojure?

From Dev

How do I flatten a nested promise dependency?

From Dev

How do I read a Maven dependency tree

From Dev

How do i use dependency injection correct?

Related Related

  1. 1

    How do I define a variable for the dependency version in Gradle

  2. 2

    How Do I Manage Multiple Kernel Modules by the Same Name?

  3. 3

    How do I define cyclical structs across modules and files in Rust?

  4. 4

    Using css modules how do I define a global class

  5. 5

    How do you define constants in Elixir modules?

  6. 6

    How do I update my nvidia modules after updating my kernel?

  7. 7

    using css modules how do I define more than one style name

  8. 8

    How do I recompile the kernel?

  9. 9

    How do I define a function?

  10. 10

    How do I wire modules?

  11. 11

    How do I best share behavior among Akka actors?

  12. 12

    How do I find where a symbol is defined among static libraries

  13. 13

    How do I manage UI state among subcomponents?

  14. 14

    How do I share a single computer among different users?

  15. 15

    How to blacklist kernel modules?

  16. 16

    How do proprietary modules work for majority of kernel versions?

  17. 17

    How to void name conflicts among modules in Rascal?

  18. 18

    How can I know/list available options for kernel modules?

  19. 19

    How can I know/list available options for kernel modules?

  20. 20

    How can I install kernel modules on a mounted file system?

  21. 21

    Why do I need to re-load kernel modules for virtualbox after a kernel update?

  22. 22

    Why do I need to re-load kernel modules for virtualbox after a kernel update?

  23. 23

    How do you define node_modules as externs in Closure Compiler?

  24. 24

    How do I build the iptables kernel module for a loaded kernel?

  25. 25

    How do I use GMock with dependency injection?

  26. 26

    How do I fix this dependency issue in Clojure?

  27. 27

    How do I flatten a nested promise dependency?

  28. 28

    How do I read a Maven dependency tree

  29. 29

    How do i use dependency injection correct?

HotTag

Archive