本文介绍了在编译内核模块时需要有关启用配置的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用3.10.x内核树.我的内核模块需要配置VIDEOBUF2.

I am using 3.10.x kernel tree. My kernel module needs config VIDEOBUF2.

在drivers/media/v4l2-core/Kconfig中定义:

That is defined in drivers/media/v4l2-core/Kconfig:

# Used by drivers that need Videobuf2 modules
config VIDEOBUF2_CORE
    select DMA_SHARED_BUFFER
    tristate

因此我将"CONFIG_VIDEOBUF2_CORE = y"放入内核配置文件中,编译.从Kconfig它有CONFIG_VIDEOBUF2_CORE没有依赖关系,我认为向我的内核添加CONFIG_VIDEOBUF2_CORE = y配置应该工作.我修改了正确的内核配置文件,因为我设置其他标志,例如CONFIG_VIDEO_DEV = y,就可以了.

So I put 'CONFIG_VIDEOBUF2_CORE=y' in my Kernel config file andcompile. From the Kconfig it has CONFIG_VIDEOBUF2_CORE has nodependency and I think adding CONFIG_VIDEOBUF2_CORE=y to my kernelconfig should work. I am modify the right kernel config file since Iset other flags like CONFIG_VIDEO_DEV=y and that works.

生成的.config不包含'CONFIG_VIDEOBUF2_CORE = y'

The generated .config does not contain 'CONFIG_VIDEOBUF2_CORE=y'

编译失败,并显示一堆

undefined reference to `vb2_buffer_done'
undefined reference to `vb2_buffer_done'
undefined reference to `vb2_buffer_done'
undefined reference to `vb2_buffer_done'

如果有人可以帮助我,我真的很感激.

I really appreciate if someone can help me with this.

谢谢.

推荐答案

我不能直接对此主题发表评论,因为要获得此特权,它需要50个声望.您可以执行:make ARCH = target_architecture CROSS_COMPILE = toolchain defconfig_file.该命令执行将在内核源的主目录中创建一个.config文件.该文件将包含目标SOC上外围设备的默认配置(我假设您具有有关defconfig文件的知识).现在,如果您想操作它并希望添加设备支持,请执行:make menuconfig,您可以通过选择配置(例如VIDEOBUF2_CORE)来添加设备支持,然后准备编译/交叉编译内核代码.编译. PS:避免手动编辑.config文件.

I cant directly comment on the subject as it requires 50 reputations to have this privilege. You can do : make ARCH = target_architecture CROSS_COMPILE = toolchain defconfig_file. This command execution will create a .config file in home directory of your kernel source. This file would contain default configuration for the peripherals on your target SOC ( I assume you have knowledge pertaining to defconfig files). Now if you wish to manipulate it and want to add your device support to it do : make menuconfig and you could add your device support by selecting configuration say like VIDEOBUF2_CORE in your case and then your kernel soure is ready to be compiled/cross-compiled. PS: Avoid editing .config file manually.

这篇关于在编译内核模块时需要有关启用配置的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-17 00:22