Posts

Showing posts with the label insmod vs modprobe

insmod vs modprobe

Both utilities are used to load the given module insmod modprobe Loads the module given insmod /path/to/module.ko Loads the module only in /lib/modules/$(uname -r) modprobe /home/test/hello.ko will not work Dependencies if present are not loaded modprobe calculates dependencies , loads the dependencies and then the main module How modprobe calculates dependencies? Modprobe depends on depmod tool to calculate dependencies. depmod calculates dependencies of all the  modules present in /lib/modules/$(uname -r) folder, and places the dependency information in /lib/modules/$(uname -r)/modules.dep file E.g. kernel/drivers/net/wireless/admtek/adm8211.ko: kernel/net/mac80211/mac80211.ko kernel/net/wireless/cfg80211.ko      kernel/drivers/misc/eeprom/eeprom_93cx6.ko In this case, eeprom_93cx6.ko, cfg80211.ko is loaded first and then adm8211.ko Modules are...