Load the module named example together with its dependencies using normal configuration.
Specify the module name rather than a module file path.
Which command should be used?
modprobe accepts a module name and uses dependency data and configuration to load required modules in order.
Detailed explanation
modprobe exampleCorrect. modprobe example loads example and any required dependencies by name.
Correct. modprobe example loads example and any required dependencies by name.
insmod exampleIncorrect. insmod expects a module file and does not resolve dependencies automatically.
Incorrect. insmod expects a module file and does not resolve dependencies automatically.
lsmod exampleIncorrect. lsmod lists loaded modules and does not load one.
Incorrect. lsmod lists loaded modules and does not load one.
depmod exampleIncorrect. depmod builds dependency files rather than loading the module.
Incorrect. depmod builds dependency files rather than loading the module.
Try it yourself
An example you can run in a temporary verification environment.
modprobe --show-depends exampleExpected result
存在するモジュール名へ置き換えると、ロード予定のinsmod行を表示するKey points
- modprobe resolves dependencies
- insmod loads one file directly
- Loading normally requires privilege
Notes
- Environment: Linux / kmod 30以降
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.