I have an old internet router running OpenWRT 14 and kernel 4. Recently, I received a 5G USB dongle that I would like to add to my box as a WAN redundancy link. The driver for the dongle is only supported on kernel 5, so I built a new image with kernel out of source and the driver for the USB.
I can boot the new image, but unfortunately, no module is not loaded, and there is no trace of it in dmesg when I insmod my module. It also looks like all of the insmod, lsmod commands are broken.
Is it possible that OpenWRT 14 cannot be used with kernel 5?
Contrary to your off-the-mill general purpose linux distribution, OpenWrt only needs to support a narrow overlap of kernel versions - and to save space and optimize the software, it only does so.
OpenWrt 14.07 shipped with kernel v3.10.49 - and that's the only kernel it needs to support. Apart from 14.07 being EOL and unsupported for almost a decade, 14.07 + kernel 5.x has never been supported. Maybe it's is easy to support it, maybe it isn't - we don't know and frankly we don't really care either (22.03.x is on v5.10, 23.05.x is on v5.15 and main is on v6.1, why would anyone bother). No changes will be done to the openwrt-14.07 branch anymore, no bugfixes, no fixes for glaring security issues (of which there are quite a few by now) and certainly no new features.
If you want to add OpenWrt support for your device, you will need to get it working with kernel v6.1 in the main branch (device support or new features are only merged through main) - and with OpenWrt's own kernel (and the minimum of SOC specific patches reasonably possible); pull requests are welcome.
If you are working on some proprietary SDK, that's up to you and not the project at large:
It appears you are using firmware that is not from the official OpenWrt project.
When using forks/offshoots/vendor-specific builds that are "based on OpenWrt", there may be many differences compared to the official versions (hosted by OpenWrt.org). Some of these customizations may fundamentally change the way that OpenWrt works. You might need help from people with specific/specialized knowledge about the firmware you are using, so it is possible that advice you get here may not be useful.
Ask for help from the maintainer(s) or user community of the specific firmware that you are using.
Provide the source code for the firmware so that users on this forum can understand how your firmware works (OpenWrt forum users are volunteers, so somebody might look at the code if they have time and are interested in your issue).
If you believe that this specific issue is common to generic/official OpenWrt and/or the maintainers of your build have indicated as such, please feel free to clarify.
Disclaimer: I'm not an OpenWrt developer and can't/ won't speak for the project, the above is only my personal opinion.