2

I want to load kernel modules, ip_gre.ko and gre.ko, on a embedded-device running embedded-linux to make that device to support GRE protocol. Since I do not want to change Embedded-linux device's kernel, I try to load kernel modules instead of re-installing device kernel.

Fortunately, I have that device's kernel source code, thus I could compile ip_gre.ko and gre.ko modules. However, loading modules using insmod on the device failed with following messsages:

$ insmod gre.ko
insmod: can't insert 'gre.ko': Resource temporarily unavailable
$ insmod ip_gre.ko
ip_gre: Unknown symbol gre_del_protocol
ip_gre: Unknown symbol gre_add_protocol
insmod: can't insert 'ip_gre.ko': unknown symbol in module, or unknown parameter
$ dmesg
GRE over IPv4 demultiplexor drvier
gre: can't add protocol
ip_gre: Unknown symbol gre_del_protocol
ip_gre: Unknown symbol gre_add_protocol

My device has enough memeory to load modules (free showed 190700/239760 are free).

Could you please let me know why this happens and its possible solutions?

UPDATE:

These are differences between .config of running kernel (on device) and that of kernel compiled for above two modules.

$ diff config_for_running_kernel config_for_kernel_compiled_for_modules
299c299, 301
< # CONFIG_NET_IPGRE_DEMUX is not set
---
> CONFIG_NET_IPGRE_DEMUX=m
> CONFIG_NET_IPGRE=m
> CONFIG_NET_IPGRE_BROADCAST=y
963c965
< CONFIG_PPTP=y
---
> CONFIG_PPTP=m

Since CONFIG_PPTP depends on CONFIG_NET_IPGRE_DEMUX, I had to make it as a module to compile the kernel without error message.

Do the differences cause above error messages? If it is, could you let me know how can I solve it...? (and if you have additional references that can teach me about these problems & solutions, I would be very thankful)

6
  • SO the kernel which is booted is the built from the sources which you are using to build the module? Mar 12, 2015 at 8:08
  • Yes! FYI, the version of kernel source code I used to compile the modules is 2.6.22.19 and the device's installed kernel version is also 2.6.22.19.
    – kolar
    Mar 12, 2015 at 8:13
  • Are you compiling on the same architecture as the embedded device, same chip? If not, you need to cross compile.
    – bsd
    Mar 12, 2015 at 9:00
  • 2
    It's not enough to use the same kernel version: you also need to use sufficiently compatible options. Did you use the same .config file? The errors you're getting are consistent with having used incompatible options. Finding the right options isn't always easy if you don't have the running kernel's .config somewhere (check /proc/config.gz, but it's an optional feature so you may not have it). Mar 12, 2015 at 22:14
  • @Gilles I agree that's very probably exactly the issue the OP is facing and I think you should make it an answer.
    – Celada
    Mar 13, 2015 at 0:24

1 Answer 1

1

I solved the problem by analyzing & modifying kernel module. Analyzing kernel module source code indicates that compatible kernel options should be concerned to load kernel modules as Gilles commented. Loading gre kernel module caused the problem because existing pptp module uses protocol ID IPGRE_PROTO that is equal to gre protocol ID. Kernel without gre module enabled uses IPGRE_PROTO as pptp protocol ID.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .