I'm trying to add a new module into the linux kernel of Openwrt. This module is a custom driver for my own peripheral device. The source files are located in openwrt/build_dir/target.../linux-.../compat-wireless-2016-05-13/drivers/mymodule after my patch file is applied. The mymodule.ko file can be found in the same directory. Below are my questions:
After I install the built image into my router (Atheros 93XX), I can not find mymodule.ko in /lib/modules/4.4.14/. However, (1) I can see ath9k.ko file which is also compiled from compat-wireless-2016-05-13 in that directory; (2) My .ko file works well after I scp it into the router and insmod it manually.
What I expect is that after I compile openwrt and install it into my router, I can see my module (mymodule.ko) added into /lib/module/4.4.13/ and automatically loaded when system starts. This behavior is just like the Atheros driver ath9k.
So what should I do to achieve what I want?