I have selected a kernel module after running make menuconfig, and run these two commands to compile it:
make target/linux/compile
make package/kernel/linux/compile
I got the .ipk file but I need its source code and .ko. How do I get them?
For example, I've selected kmod-nf-nathelper-extra from kernel Modules -> Netfilter Extensions. I got its .ipk by compiling it. Can anyone please tell me how can I get its source code and .ko file?
Reference: https://openwrt.org/docs/guide-developer/toolchain/single.package#kernel_modules
Edit:
I need to edit the above-mentioned kernel module, for this I need its source code and other stuff so that I can generate the .ipk/.ko after making the changes.
-rw-r--r-- nf_nat_helper.c 5900
Actually, I need nf_nat_helper_extra.c. I would edit the source code and generate the .ipk/.ko file. So that I need the source code in the OpenWrt build system so that after making the changes I can run some commands to generate the .ipk/.ko file with the changes.
If you cannot work out the Makefiles, you can always check what is packaged: ls -R build_dir/*/linux-*/packages/*/kmod-nf-nathelper-extra/ or opkg files kmod-nf-nathelper-extra
Although, I didn't get 100% of what you said. Maybe, I need to study each point you mentioned. So, far I'd like to ask, nf_nat_helper_extra.c is not just standalone file, it's just composed of these-