简体   繁体   English

Android goldfish armv7内核模块编译

[英]Android goldfish armv7 kernel module compiling

I have compiled goldfish armv7 kernel for android. 我已经为Android编译了金鱼armv7内核。

everything works well, my compiled kernel works fine on the emulator. 一切正常,我的编译内核在模拟器上工作正常。 my problem is, I want to insert a kernel module(.ko) into my goldfish kernel. 我的问题是,我想在我的goldfish内核中插入一个内核模块(.ko)。 but cross compiling the 'hello world' kernel module gives me some error. 但是交叉编译“ hello world”内核模块给了我一些错误。 so I googled it and found out that I need to recompile my goldfish kernel with 所以我用谷歌搜索发现我需要用

'CONFIG_MODULES=y' 'CONFIG_MODULES = y'

option enabled. 选项已启用。 as I read on the Internet, I added the following lines to my .config script. 在Internet上阅读时,我在.config脚本中添加了以下几行。

CONFIG_MODULES=y
CONFIG_MODULES_FORCE_LOAD=y
CONFIG_MODULES_UNLOAD=y
CONFIG_MODULES_FORCE_UNLOAD=y

But if I recompile my goldfish kernel with these options, I get the following error. 但是,如果使用这些选项重新编译我的金鱼内核,则会收到以下错误。

  LD      net/built-in.o
  LD      vmlinux.o
  MODPOST vmlinux.o
  GEN     .version
  CHK     include/generated/compile.h
  UPD     include/generated/compile.h
  CC      init/version.o
  LD      init/built-in.o
  LD      .tmp_vmlinux1
net/built-in.o: In function `tcp_nuke_addr':
activity_stats.c:(.text+0x4e4b4): undefined reference to `rt6_lookup'
activity_stats.c:(.text+0x4e5c4): undefined reference to `in6addr_any'
make: *** [.tmp_vmlinux1] Error 1
root@ubuntu:/disk2/android/kernel/goldfish# 

some of the documentation says that I should remove the CONFIG_NETFILTER=y from the script. 一些文档说我应该从脚本中删除CONFIG_NETFILTER = y。 I did it but the result is same. 我做到了,但是结果是一样的。

I am stuck right now... can someone help me?? 我现在被困住了...有人可以帮助我吗? thank you in advance. 先感谢您。

https://source.android.com/devices/tech/kernel.html上有Linux配置选项的建议列表,包括CONFIG_NETFILTER

i removed all the configurations to do with IPV6, INET6 Remember to disable only IPV6 related modules and not the IPv4. 我删除了与IPV6,INET6有关的所有配置。请记住仅禁用与IPV6相关的模块,而不禁用IPv4。

# CONFIG_IPV6 is not set

After that I was able to build it. 之后,我得以构建它。

Also works 也可以

CONFIG_IPV6=y CONFIG_IPV6 = y

It seems that build try to configure IPv6 as a module, but there are functions used by kernel that not are available if IPv6 is not built-in in the kernel 似乎构建尝试将IPv6配置为模块,但是如果内核中未内置IPv6,则内核使用的功能将不可用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM