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.
Edit:
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.
How are you referencing it to get it built? did you add it to a target or selected it from menu/defconfig?
(button-hotplug is referenced in target/linux/x86/generic/target.mk for example).
Its a normal KernelPackage from a feed created by me. All other modules which are created the same way with the same origin work fine and are installed. But this particular one wont get installed.
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.
maybe not the Kconfig file, try to remove CONFIG_TARGETFSCTL from KCONFIG and only leave it in EXTRA_KCONFIG (see your button-hotplug reference Makefile)