I have written several kernel modules and successfully added them to OpenWrt. They are all building nicely. There is the corresponding .ko-file in every $(BUILD_DIR). However one of them is build but the buildsystem does not install it to the image. The kernel module is build fine and if I manually copy the .ko file to the target it works as intended.
However, OpenWrt won't install it to the image. Its always missing in the sysupgrade images as well in the staging_dir root-folder.
Another module that I have written (which uses an identical makefile-template) is compiled and installed fine.
I've checked the configuration twice. Its enabled (CONFIG_PACKAGE_kmod-targetfsctl-module=y) in my config and all dependencies are fulfilled.
I've appended my makefile, maybe anyone can spot what is wrong.
I already tried to debug something. First I changed FILES:=$(PKG_BUILD_DIR)/targetfsctl.ko to FILES:=$(PKG_BUILD_DIR)/nonexisting.ko and surprisingly OpenWrt does not complain about the absence of this file.
Sorry again, I re-read your question and I had missed the part where you mention enabling it using CONFIG_PACKAGE_kmod-targetfsctl-module=y
Are you sure that this is getting picked up? The default for this package is =m aka build the ipk but don't install. Maybe you could try temporarily changing to =y and see if that changes anything (clutching at straws once more). I'll give it a run with bogus files later this evening on my environment otherwise to see if I can reproduce.
Last one for today (and far fetched) as I was trying to find conditions for which the KernelPackage wouldn't install in kernel.mk. I wonder if the name of the package is to blame because it already contains "mod" and that trips up a grep somewhere or something like that. I'd give it a shot and rename it targetfsctl. If that's not helping, we'll bring in a new set of eyes.