强制将 Linux 内核模块编译为模块而不是内置模块

强制将 Linux 内核模块编译为模块而不是内置模块

我有嵌入式 Linux 内核源代码(特别是 QNAP NAS)运行 64 位 v3.12.6 Linux 内核以及内核配置文件。

我正在尝试通过添加内核模块来向该内核添加 DVB 支持,然后我可以使用修改。但是,使用此版本,我无法编译dvb-core.ko仅内置可用(即配置DVB_CORE=y代替配置DVB_CORE=m)。

我查看了与我的盒子模型相关的配置文件,没有设置 DVB 配置开关:

# cat ../../kernel_cfg/TS-X53/linux-3.12.6-x86_64-hal.cfg | grep DVB
# CONFIG_DVB_DUMMY_FE is not set

所以我把这个文件复制为.配置在内核源目录中并运行制作菜单配置。我检查了选项:

Device Drivers -> Multimedia Support -> Digital TV Support

不可能击中在那条线上所以我打;启用它之后,如果我搜索数字视频广播核心(使用/键),我得到:

---------------------------- Search Results -----------------------------
| Symbol: DVB_CORE [=y]                                                 |  
| Type  : tristate                                                      |  
|   Defined at drivers/media/Kconfig:117                                |  
|   Depends on: MEDIA_SUPPORT [=y] && MEDIA_DIGITAL_TV_SUPPORT [=y]     |  
|   Selects: CRC32 [=y]                                                 |
-------------------------------------------------------------------------

因此,如果我将各种调谐器驱动程序作为一个模块启用(例如dvb-usb-dib0700.ko),保存,退出,然后运行制作模块,我得到了所有的调谐器.ko文件,但没有dvb-core.ko这对于我的系统加载其他依赖项是必需的.ko文件。退出后,配置开关如下:

# cat .config | grep DVB
CONFIG_DVB_CORE=y
CONFIG_DVB_NET=y
CONFIG_DVB_MAX_ADAPTERS=8
# CONFIG_DVB_DYNAMIC_MINORS is not set
CONFIG_DVB_USB=m
# CONFIG_DVB_USB_DEBUG is not set
# CONFIG_DVB_USB_A800 is not set
# CONFIG_DVB_USB_DIBUSB_MB is not set
# CONFIG_DVB_USB_DIBUSB_MC is not set
CONFIG_DVB_USB_DIB0700=m
# CONFIG_DVB_USB_UMT_010 is not set
# CONFIG_DVB_USB_CXUSB is not set
# CONFIG_DVB_USB_M920X is not set
# CONFIG_DVB_USB_DIGITV is not set
# CONFIG_DVB_USB_VP7045 is not set
# CONFIG_DVB_USB_VP702X is not set
# CONFIG_DVB_USB_GP8PSK is not set
# CONFIG_DVB_USB_NOVA_T_USB2 is not set
# CONFIG_DVB_USB_TTUSB2 is not set
# CONFIG_DVB_USB_DTT200U is not set
# CONFIG_DVB_USB_OPERA1 is not set
# CONFIG_DVB_USB_AF9005 is not set
# CONFIG_DVB_USB_PCTV452E is not set
# CONFIG_DVB_USB_DW2102 is not set
# CONFIG_DVB_USB_CINERGY_T2 is not set
# CONFIG_DVB_USB_DTV5100 is not set
# CONFIG_DVB_USB_FRIIO is not set
# CONFIG_DVB_USB_AZ6027 is not set
# CONFIG_DVB_USB_TECHNISAT_USB2 is not set
# CONFIG_DVB_USB_V2 is not set
# CONFIG_DVB_TTUSB_BUDGET is not set
# CONFIG_DVB_TTUSB_DEC is not set
# CONFIG_DVB_B2C2_FLEXCOP_USB is not set
# DVB-S (satellite) frontends
# DVB-T (terrestrial) frontends
CONFIG_DVB_DIB3000MC=m
CONFIG_DVB_DIB7000M=m
CONFIG_DVB_DIB7000P=m
# DVB-C (cable) frontends
CONFIG_DVB_LGDT3305=m
CONFIG_DVB_S5H1411=m
CONFIG_DVB_DIB8000=m
CONFIG_DVB_TUNER_DIB0070=m
CONFIG_DVB_TUNER_DIB0090=m
# SEC control devices for DVB-S
# CONFIG_DVB_DUMMY_FE is not set

如果我编辑.配置手动归档并放入配置DVB_CORE=m保存然后制作模块没有什么变化:

# make modules
scripts/kconfig/conf --silentoldconfig Kconfig
#
# configuration written to .config
#
make[1]: Nothing to be done for `relocs'.
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CALL    scripts/checksyscalls.sh
  Building modules, stage 2.
  MODPOST 195 modules

dvb-core.ko仍然没有编译,并且设置也被恢复:

# cat .config | grep DVB_CORE
CONFIG_DVB_CORE=y

所以我的问题是:我该如何编译dvb-core.ko作为内核模块?

请注意,使用以前的内核源代码,使用的是内核 3.4.6,我可以轻松地用制作菜单配置因为我可以设置在 DVB 设置上。但是菜单有所不同,因为 DVB 在这里:

Device Drivers -> Multimedia Support -> DVB for Linux

这是寻找的结果数字视频广播核心

---------------------------- Search Results -----------------------------
| Symbol: DVB_CORE [=m]                                                 |  
| Type  : tristate                                                      |  
| Prompt: DVB for Linux                                                 |  
|   Defined at drivers/media/Kconfig:69                                 |  
|   Depends on: MEDIA_SUPPORT [=y]                                      |  
|   Location:                                                           |  
|     -> Device Drivers                                                 |  
|       -> Multimedia support (MEDIA_SUPPORT [=y])                      |  
|   Selects: CRC32 [=y]                                                 |  
-------------------------------------------------------------------------

并且(旧)配置开关:

# cat .config | grep DVB
CONFIG_DVB_CORE=m
CONFIG_DVB_NET=y
CONFIG_VIDEO_BT848_DVB=y
CONFIG_DVB_MAX_ADAPTERS=8
# CONFIG_DVB_DYNAMIC_MINORS is not set
CONFIG_DVB_CAPTURE_DRIVERS=y
CONFIG_DVB_AV7110=m
# CONFIG_DVB_AV7110_OSD is not set
CONFIG_DVB_BUDGET_CORE=m
CONFIG_DVB_BUDGET=m
CONFIG_DVB_BUDGET_CI=m
CONFIG_DVB_BUDGET_AV=m
CONFIG_DVB_BUDGET_PATCH=m
CONFIG_DVB_USB=m
# CONFIG_DVB_USB_DEBUG is not set
CONFIG_DVB_USB_A800=m
CONFIG_DVB_USB_DIBUSB_MB=m
CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y
CONFIG_DVB_USB_DIBUSB_MC=m
CONFIG_DVB_USB_DIB0700=m
... cut ...

答案1

显然,这个解决方案很容易应用,但不太容易猜到。要构建dvb-core.ko作为一个模块,我必须回到菜单上:

Device Drivers -> Multimedia support

那里,多媒体支持已被标记为通过内核配置文件:

<*> Multimedia Support --->

解决方案是选择多媒体支持并按下将其标记为模块:

<M> Multimedia Support --->

因此基本上必须进行模块选择在父菜单上,虽然我最初以为它是数字电视支持。然后在搜索数字视频广播核心我正确得到:

---------------------------- Search Results -----------------------------
| Symbol: DVB_CORE [=m]                                                 |  
| Type  : tristate                                                      |  
|   Defined at drivers/media/Kconfig:117                                |  
|   Depends on: MEDIA_SUPPORT [=m] && MEDIA_DIGITAL_TV_SUPPORT [=y]     |  
|   Selects: CRC32 [=y]                                                 |
-------------------------------------------------------------------------

相关内容