What's new

Compiling kernel module

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

K

krabs

Guest
So I have downloaded the entware openwrt buildroot environment and was trying to compile the ipt_owner.ko module which is available in the kmod-ipt-extra package.

I have enabled the packages in the openwrt_trunk .config file.
After compiling I have installed this packets in entware
Code:
kernel_2.6.22-1-unknown_entware.ipk
kmod-ipt-conntrack_2.6.22-1_entware.ipk
kmod-ipt-core_2.6.22-1_entware.ipk
kmod-ipt-extra_2.6.22-1_entware.ipk
kmod-ipt-nathelper_2.6.22-1_entware.ipk -> this won't install because kmod-ipt-nat is needed

But it insn't working when doing insmod ipt-owner.ko and I think this is also not right way to do it. Also I find no separate module *.ko in the build_dir. And kmod-ipt-nat is not compiled because of these warnings I think

Code:
WARNING: module '/home/pieter-jan/openwrt/linux-2.6.22.19/net/netfilter/xt_multiport.ko' missing and modules.builtin not available, assuming built-in.
WARNING: module '/home/pieter-jan/openwrt/linux-2.6.22.19/net/netfilter/xt_multiport.ko' missing and modules.builtin not available, assuming built-in.
WARNING: module '/home/pieter-jan/openwrt/linux-2.6.22.19/net/ipv4/netfilter/iptable_raw.ko' missing and modules.builtin not available, assuming built-in.
WARNING: module '/home/pieter-jan/openwrt/linux-2.6.22.19/net/netfilter/xt_NOTRACK.ko' missing and modules.builtin not available, assuming built-in.
WARNING: module '/home/pieter-jan/openwrt/linux-2.6.22.19/net/ipv4/netfilter/iptable_raw.ko' missing and modules.builtin not available, assuming built-in.
WARNING: module '/home/pieter-jan/openwrt/linux-2.6.22.19/net/netfilter/xt_NOTRACK.ko' missing and modules.builtin not available, assuming built-in.
WARNING: skipping kmod-pcmcia-au1000 -- package not selected

what's the correct way of compiling just one module that can be insmodded without having to install all these packages which also doens't work in my example?
 
Never use Entware to compile kernel modules. Entware is firmware-independent project.
You need toolchain and kernel used for your firmware.
 
Never use Entware to compile kernel modules. Entware is firmware-independent project.
You need toolchain and kernel used for your firmware.

Hi, I have found a solution.
Since entware and asuswrt-merlin use both the linux 2.6.22.19 kernel I have edited the one with comes with entware. I have done this because in the kernel configuration under Core Netfilter Configuration there's no such option in the asuswrt kernel to enable "owner" match support as module. I'm still new into doing this and I have no idea howto enable this in asuswrt. In the entware one's is was already supported I only had to set the M flag to compile as module.

Instead I just told the entware's one to use the toolchain from the asuswrt one's
Code:
export PATH=$PATH:/opt/brcm/hndtools-mipsel-linux/bin:/opt/brcm/hndtools-mipsel-uclibc/bin

Then I compiled everything in the kernel/net/filter following this tutorial http://www.g-loaded.eu/2005/12/20/build-a-single-native-kernel-module/

Code:
make CONFIG_NETFILTER_XT_MATCH_OWNER=m M=net/netfilter

(It's probably not the correct and neatest way but it works)
It isn't working still get iptables v1.3.8: Couldn't load match `owner':File not found
 
Last edited by a moderator:
Since entware and asuswrt-merlin use both the linux 2.6.22.19 kernel I have edited the one with comes with entware.
And here is a mistake. This is _very_ different kernels.
  • Asuswrt\Asuswrt-Merlin kernel is a part of Broadcom's SDK with 2-3 fixes.
  • Entware's "kernel" is a part of wl500g toolchain where fixes and backports comes almost everyday!

Entware's "kernel" has long been different from vanilla 2.6.22.19. In fact, there is not much from vanilla kernel.

As always, please follow old rule: compile modules from current kernel sources. Any other options leads to problems which difficult to debug.
 
It's working now.
Owner match was available under IP:netfilter configuration
I just had to edit the iptables extensions makefile to also compile the extension libxt_owner.c. I have copied these from iptables 1.4.x extensions and include the necessary header files.
So compiled the firmware with these new settings and it is working !
 
Last edited by a moderator:

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top