Build kernel modules on OpenWrt itself?

Hi there!

I would like to build my own kernel-module driver for openwrt.

So is it possible to build them (e.g. with gnu c++ compiler) on OpenWRT itself? (Verison 18.06.x)

Or do i need to cross-compile them on a x86/x64 linux system?

I didn't found any tutorial which describes how to build them on OpenWRT itself. Is that possible or not? If yes, is it fast enough on a router like the Western Digital N750?

Thank you for your feedbacks.

With best regards,

OpenWrt is not self-hosting in this respect, even just installing the necessary development packages wouldn't be possible on most target devices (so they exist in the first place, and aside from some very basic packages they don't), actually compiling anything wouldn't be sensible (or even possible, due to the RAM size) on most devices (aside from high-end ARM, x86, eventually some ppc) either.

If you want to (cross-)compile (just about) anything, including kernel modules, you'll need to turn to the SDK (shipped alongside the binary firmware images) or the full build root (as in building OpenWrt from source).

Thank you for your fast feedback!

(The reason i asked this question is that: How to solve the problem with CH341 USB/RS-232 adapter? )

With best regards,