2

I don't know if what I'm trying to do is even possible, and while it may be undesirable I'd like to know whether I can make this work.

I have a Linux kernel compiled for an Android tablet and I need to make some changes to one of the built-in modules. (Compiling a new kernel from source is not, in this particular case, an option for me).

I've gotten as far as compiling using my modified source and compiling the .ko files I need. However, when compiling these modules, I get a list of errors that look like the following:

WARNING: "alarm_start_range" [/modules/p3_battery.ko] undefined!

It seems as though my Makefile isn't correctly linking this header:

#include <linux/power/p3_battery.h>

Anyway, I tried to load those modules on the device, and when I try to do insmod p3_battery.ko, I get a failure message (which I expected). Looking at dmesg, I see messages that tell me the following:

p3_battery: Unknown symbol alarm_start_range (err 0)

As mentioned above, those functions do exist in the kallsyms table.

I can provide more detail by supplying my Makefile if that will help, but I wanted to offer a concise formulation of the problem to see if what I'm doing here makes any sense.

Fil
  • 2,016
  • 18
  • 29
  • 1
    I am by no means an expert in Android, but it looks like the appropriate `Module.symvers` files were not picked up by the build system. The answers to this question may be useful here: http://stackoverflow.com/questions/625685/ – Eugene Jun 15 '12 at 07:40
  • 1
    In short, if module **B** uses symbols exported by module **A**, `Module.symvers` file created when building **A** should be used when builing **B**. You can copy that file to the directory where your are building **B** or use something like KBUILD_EXTRA_SYMBOLS in the Kbuild file. – Eugene Jun 15 '12 at 07:45
  • 1
    What does it mean if a symbol doesn't appear in Module.symvers, but does appear in System.map? Is this effectively telling me that the symbol is inaccessible to external modules? – Fil Jun 15 '12 at 14:58
  • 3
    Yes, perhaps the symbol is not exported and therefore inaccessible to externel modules. If you have the source code of the module that defines this symbol, see if there is something like `EXPORT_SYMBOL()` for it there. Same if the symbol is defined in the kernel itself. – Eugene Jun 16 '12 at 11:43
  • That's exactly it. It's simply not being exported. Thanks for helping me isolate that. Much appreciated! – Fil Jun 18 '12 at 14:10

0 Answers0