How to recompile just a single kernel module?

前端 未结 5 731
-上瘾入骨i
-上瘾入骨i 2021-01-29 22:42

Usually kernel source are stored in /usr/src/linux-2.6.x/. To avoid to recompile the entire kernel if I modify a module\'s source, how can I recompile just that mod

5条回答
  •  面向向阳花
    2021-01-29 23:04

    Switch to the root directory of your source tree and run the following command:

    $ make modules SUBDIRS=drivers/the_module_directory
    

    And to install the compiled module:

    $ make modules_install SUBDIRS=drivers/the_module_directory
    

    Note: As lunakid mentions, the latter command might not build the module first, so be careful.

提交回复
热议问题