As of Linux kernel 5 and above, you can compile a generic module and then load it with multiple instances. This section guides on on how to perform such loading.
You first need to create a .conf file and then place it into /etc/modprobe.d. Inside this script, you describe your custom modules. You can do the following works.
You can create multiple module instances using the alias and options definition. By default they are:
alias - nickname your module against a kernel module.options - adding parameters to an alias/module that defines its specialty.Here is the syntax:
# This is a commentalias <yourModName> moduleNameoptions <yourModName> param1=value1 param2=value2 ...Here is an example of creating audio loopback named mysoft-aloop:
# mysoft audio loopback to create 4 channels audio outputalias mysoft-aloop snd-aloopoptions mysoft-aloop index=2 pcm_substreams=4 id=mysoft-aloopYou can also blacklist a module, preventing it from loading. However, module can still be loaded if it is a dependency or loaded manually. To fully blacklist a module, you need to use install keyword to override the loading results and ultimately denied the module codes from actually loaded.
Here is the syntax:
blacklist <someBadModName>install <yourModName> /bin/trueHere is an example of blacklisting a test module named test-samura:
blacklist test-samurainstall test-samura /bin/trueThat's all for configuring modules in operating system.