linux kernel 6.1: make -f ./Makefile syncconfig deleting a Kconfig option

54 Views Asked by At

I get the following errors when trying to compile the kernel

ld: drivers/media/platform/mxc/capture/mx6s_capture.o: in function `mx6s_csi_open':
mx6s_capture.c:(.text+0x1ccd): undefined reference to `vb2_dma_contig_memops'
make[1]: *** [scripts/Makefile.vmlinux:34: vmlinux] Error 1
make: *** [Makefile:1255: vmlinux] Error 2

I've added CONFIG_VIDEOBUF2_DMA_CONTIG=y to my .config file, but after running make, that config option is deleted

After some digging, I've narrowed it down to the make -f ./Makefile syncconfig command that gets run very early on in the make process

I believe there must be some dependency issues that are resulting in this being excluded

If I manually change the Makefile at drivers/media/v4l2-core/Makefile to obj-y += videobuf-dma-contig.o it compiles just fine

1

There are 1 best solutions below

0
k1r1t0 On

I've added CONFIG_VIDEOBUF2_DMA_CONTIG=y to my .config file, but after running make, that config option is deleted

First, make sure that you included all dependencies for this option, because even though you can compile that driver by hands it hardly worth the risk to break your hardware.

enter image description here

Looking at the picture above (make menuconfig -> / -> VIDEOBUF2_DMA_CONTIG) you can see that VIDEOBUF2_DMA_CONTIG depends on MEDIA_SUPPORT, so you should enable that first of all and all its dependencies (you can search for them the same way as for VIDEOBUF2_DMA_CONTIG).

Once you enabled MEDIA_SUPPORT you can see that VIDEOBUF2_DMA_CONTIG is still disabled. That is because it is not menuconfig option, it is just a config (you can check that in drivers/media/common/videobuf2/Kconfig), that means it must be selected by something else and it cannot be enabled just for free, because it will look like you have food (feature), but don't have something (driver/user) to take it.

If you see your option (VIDEOBUF2_DMA_CONTIG) disabled -- enable something that will use it (enumerated by Selected by [y]: list). In my case this can be VIDEO_SOLO6X10 and maybe in your case too, (not sure what your driver is) or VIDEO_TW5864, etc.

Once, you resolved all those dependencies you will see your config option enabled. I'm not sure if there's some useful tool that can do all this work, anyway I haven't found that yet :(