Module.symvers and make modules

本文介绍了解决myuvc.ko模块在Ubuntu系统中安装失败的问题,包括检查符号定义、编译内核模块及使用modprobe等命令进行调试的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

when making a myuvc.c to generate a myuvc.ko module or ins, some warnings reported of some funcs not defined(they are defined in drivers/media/video/uvc/*.c and there are references of them in myuvc.c).

check they whether appear in Module.symvers in linux dir, as a result, they don't().

run the below command to make they be presented in Module.symvers:

'make modules'// no such command run before for this kernel

drivers/media/video/uvc is configured as compiled as uvcvideo.ko module.

when 'make modules', all funcs symbols defined in uvc/*.c to be added to Module.symvers.

if compiling successfully, /lib/modules/[linux_ver]/build/drivers/media/video/uvc/uvcvideo.ko generated.


when making myuvc.c, it will check symbols defined out of myuvc.c whether present in linux_src/Module.symvers or Module.symvers in the current dir, if don't, throwing out warning like above described.


error unable to install myuvc.ko after reboot Ubuntu

dmesg:

[  288.035856] myuvc: Unknown symbol video_ioctl2
[  288.036067] myuvc: Unknown symbol video_unregister_device
[  288.036135] myuvc: Unknown symbol video_device_alloc
[  288.036185] myuvc: Unknown symbol video_register_device
[  288.036292] myuvc: Unknown symbol video_device_release

but video_ioctl2 and the rest are present in Module.symvers in linux src dir.

solution:

sudo modprobe uvcvideo

sudo rmmod uvcvideo

sudo insmod myuvc.ko

installation is successful:

[  391.616770] usbcore: registered new interface driver myuvc






评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值