What's the difference between insmod and modprobe?

前端 未结 4 1460
栀梦
栀梦 2021-02-19 21:20

I know insmod and modprobe are used to insert module into the kernel. But, what\'s the difference between them?

And, why is it dangerous to ins

4条回答
  •  春和景丽
    2021-02-19 21:41

    modprobe is the intelligent version of insmod. insmod simply adds a module where modprobe looks for any dependency (if that particular module is dependent on any other module) and loads them.

    Regarding --force option, here is the quote from the man page:

       Try to strip any versioning information from the module which might otherwise
       stop it from loading: this is the same as using both --force-vermagic and
       --force-modversion. Naturally, these checks are there for your protection,
       so using this option is dangerous unless you know what you are doing.
    

    Which indicates it's been used to skip the kernel module version checking. Shouldn't be any problem if you do your own kernel module or from any trusted party. But you should know what you are doing.

提交回复
热议问题