How to “make” existing Linux kernel module driver after modifying the driver source code

后端 未结 1 1849
忘掉有多难
忘掉有多难 2020-12-10 22:42

I have made some trivial modifications to a Linux USB Wi-Fi card driver to insert some logging (printk statements). I am loosely following a guide on how to re

相关标签:
1条回答
  • 2020-12-10 23:04

    You must run make from the top directory of the Linux source (/usr/src/linux/). Be sure that your driver is included in your /usr/src/linux/.config file. So, build the kernel with your driver. If you don't want to rebuild the entire kernel, read more :)

    If you want to re-build all modules inside the directory:

    make M=drivers/net/wireless/rtl818x/rtl8187/
    

    If you want to re-build a single module inside the directory:

    make M=drivers/net/wireless/rtl818x/ CONFIG_RTL8187=m
    

    The *CONFIG_RTL8187* name can be found in drivers/net/wireless/rtl818x/Kconfig (CONFIG_ + RTL8187)

    It should works also this:

    make drivers/net/wireless/rtl818x/rtl8187/rtl8187.ko
    
    0 讨论(0)
提交回复
热议问题