freelyrunner 发表于 2004-7-27 11:16:54

求教:关于安装新模块中遇到的问题

我装的是红帽13内核版本是2.4.21-9.EL,因为需要一个系统上没有的网络设备模块tun.o所以决定重新编译内核生成.
编译基于安装系统时留下的/usr/src/Linux-2.4.21-9.EL下的源码,读了kernel howto ,modules howto,和网上一些大虾的
文章后开始make xconfig,其中我选择了tun.o那个模块,并且根据modules howto中的提示:
if you have a base kernel that was compiled with symbol versioning, then you must have all your LKMs compiled
likewise, and vice versa. Otherwise, you're guaranteed to get those "unresolved symbol reference" errors.
我选了CONFIG_MODVERSIONS因为我在/boot下找到一个config-2.4.21-9.EL(感觉应该是我当前内核的编译配置文件)
其中CONFIG_MODVERSIONS=y,接着我就开始make dep; make clean; make bzImage;(我只想得到一个modele,这步应该可以跳过是吧) make modules;这些都通过了,最后,我找到了生成的tun.o,改了属性后便把它弄到/lib/modules/2.4.21-9.EL/kernel/drivers/net
目录下,然后就运行下面的命令,之后就是一堆错误了:<
# depmod -e -n tun.o
depmod: *** Unresolved symbols in tun.o
depmod:         __dev_get_by_name_Rsmp_f2760a7e   
............                                             
depmod:         register_netdevice_Rsmp_b1d4c6db
depmod:         add_wait_queue_Rsmp_738f1769
depmod:         __out_of_line_bug_Rsmp_8b0fd3c5
.............................
tun.o:
# module             id=string
# pci module         vendor   device   subvendorsubdeviceclass      class_mask driver_data
# isapnp module      cardvendor carddevice driver_data vendor   function   ...
# usb module         match_flags idVendor idProduct bcdDevice_lo bcdDevice_hi bDeviceClass bDeviceSubClass bDeviceProtocol bInterfaceClass bInterfaceSubClass bInterfaceProtocol driver_info
# module             pattern
# ieee1394 module    match_flags vendor_id model_id specifier_id version
# module             id

******************************************
我在内核的导出符号中发现了和上面这些所谓的Unresolved symboles几乎一样的东西比如 c020a9a0 __dev_get_by_name_R11bb1bd0(对比于__dev_get_by_name_Rsmp_f2760a7e. Rsmp是什么东东???)
感觉我先前的设置应该不会出现这类错误了,也不存在什么版本匹配问题啊(源码树顶层的makefile中那个版本设置和我当前内核的一样),狂不解,这个问题困扰我三天了,接触Linux两个星期了,这是遇到的最恼火的问题,请大家帮忙看看b
万分感激!
页: [1]
查看完整版本: 求教:关于安装新模块中遇到的问题