Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4611302
  • 博文数量: 385
  • 博客积分: 21208
  • 博客等级: 上将
  • 技术积分: 4393
  • 用 户 组: 普通用户
  • 注册时间: 2006-09-30 13:40
文章分类

全部博文(385)

文章存档

2015年(1)

2014年(3)

2012年(16)

2011年(42)

2010年(1)

2009年(2)

2008年(34)

2007年(188)

2006年(110)

分类: LINUX

2012-03-16 09:15:26

SLES 解决module: no symbol version for module_layout 方法


问题:

在SLES中/usr/src/linux-3.0.13-0.27-obj/x86_64/default/目录下 make XX.ko, 拷贝ko到相应目录,然后modprobe XX

出现:module: no symbol version for module_layout


根本原因:Unknown

解决方法:

两步:


1.确保/usr/src/linux-obj/x86_64/default/Modules.symvers文件是完整的,


如果以前在/usr/src/linux-3.0.13-0.27-obj/x86_64/default/目录下 make XX.ko 的话,该文件会重新生成这个模块所导出的符号。

所以要检查一个这个文件,如果很多行,那就对了。

 如果很少,就说明被覆盖了,需要重新安装kernel-default-devel rpm包。

Vsles11sp1 /mnt/Work/NOVELL/Product/SLES-11-SP1 #rpm -ivh kernel-default-devel-2.6.32.12-0.7.1.x86_64.rpm --force
Preparing... ########################################### [100%]
1:kernel-default-devel ########################################### [100%]

可在/usr/src/linux-2.6.32.12-0.7-obj/x86_64/default/看到Modules.symvers 文件

Vsles11sp1 /opt/igb #make -C /usr/src/linux-2.6.32.12-0.7-obj/x86_64/default/ M=$(pwd) clean
make: Entering directory `/usr/src/linux-2.6.32.12-0.7-obj/x86_64/default'
make -C ../../../linux-2.6.32.12-0.7 O=/usr/src/linux-2.6.32.12-0.7-obj/x86_64/default/. clean
make[3]: Warning: File `/opt/igb/Makefile' has modification time 3.7e+05 s in the future
make[3]: warning: Clock skew detected. Your build may be incomplete.
CLEAN /opt/igb/.tmp_versions
CLEAN /opt/igb/Module.symvers /opt/igb/modules.order

make: Leaving directory `/usr/src/linux-2.6.32.12-0.7-obj/x86_64/default'


2. 编译模块的方法:

Vsles11sp1 /opt/igb #make -C /usr/src/linux-2.6.32.12-0.7-obj/x86_64/default/ M=$(pwd) modules
make: Entering directory `/usr/src/linux-2.6.32.12-0.7-obj/x86_64/default'
make -C ../../../linux-2.6.32.12-0.7 O=/usr/src/linux-2.6.32.12-0.7-obj/x86_64/default/. modules
make[3]: Warning: File `/opt/igb/Makefile' has modification time 3.7e+05 s in the future
CC [M] /opt/igb/igb_main.o
/opt/igb/igb_main.c: In function a??igb_clean_rx_irq_adva??:
/opt/igb/igb_main.c:4915: warning: unused variable a??hwa??
CC [M] /opt/igb/igb_ethtool.o
CC [M] /opt/igb/e1000_82575.o
CC [M] /opt/igb/e1000_mac.o
CC [M] /opt/igb/e1000_nvm.o
CC [M] /opt/igb/e1000_phy.o
CC [M] /opt/igb/e1000_mbx.o
LD [M] /opt/igb/igb.o
make[3]: warning: Clock skew detected. Your build may be incomplete.
Building modules, stage 2.
make[3]: Warning: File `/opt/igb/Makefile' has modification time 3.7e+05 s in the future
MODPOST 1 modules
CC /opt/igb/igb.mod.o
LD [M] /opt/igb/igb.ko
make[3]: warning: Clock skew detected. Your build may be incomplete.
make: Leaving directory `/usr/src/linux-2.6.32.12-0.7-obj/x86_64/default'
Vsles11sp1 /opt/igb #insmod igb.ko
insmod: error inserting 'igb.ko': -1 Unknown symbol in module
Vsles11sp1 /opt/igb #dmesg | tail
[ 78.328723] eth2: no IPv6 routers present
[ 78.856043] eth1: no IPv6 routers present
[ 78.952761] eth0: no IPv6 routers present
[ 897.169888] Slow work thread pool: Starting up
[ 897.172642] Slow work thread pool: Ready
[ 1078.085444] igb: Unknown symbol dca_remove_requester
[ 1078.088667] igb: Unknown symbol dca_add_requester
[ 1078.089721] igb: Unknown symbol dca_unregister_notify
[ 1078.090061] igb: Unknown symbol dca_register_notify
[ 1078.090506] igb: Unknown symbol dca3_get_tag
Vsles11sp1 /opt/igb #modprobe dca
Vsles11sp1 /opt/igb #insmod igb.ko

Vsles11sp1 /opt/igb #

又一例: 在内核原目录中去编译。

xen-sles11sp2:/opt/i915 # make -C /usr/src/linux-obj/x86_64/default/   M=$(pwd) modules
make: Entering directory `/usr/src/linux-3.0.13-0.27-obj/x86_64/default'
make -C /usr/src/linux-3.0.13-0.27 O=/usr/src/linux-3.0.13-0.27-obj/x86_64/default/. modules
  CC [M]  /opt/i915/i915_dma.o
/opt/i915/i915_dma.c:37:45: error: ../../../platform/x86/intel_ips.h: No such file or directory
/opt/i915/i915_dma.c: In function ‘ips_ping_for_i915_load’:
/opt/i915/i915_dma.c:1888: error: ‘ips_link_to_i915_driver’ undeclared (first use in this function)
/opt/i915/i915_dma.c:1888: error: (Each undeclared identifier is reported only once
/opt/i915/i915_dma.c:1888: error: for each function it appears in.)
/opt/i915/i915_dma.c:1888: warning: type defaults to ‘int’ in declaration of ‘type name’
/opt/i915/i915_dma.c:1888: warning: cast from pointer to integer of different size
/opt/i915/i915_dma.c:1888: warning: assignment makes pointer from integer without a cast
make[3]: *** [/opt/i915/i915_dma.o] Error 1
make[2]: *** [_module_/opt/i915] Error 2
make[1]: *** [sub-make] Error 2
make: *** [all] Error 2
make: Leaving directory `/usr/src/linux-3.0.13-0.27-obj/x86_64/default'
xen-sles11sp2:/opt/i915 # cd /usr/src/linux/drivers/gpu/drm/i915/
xen-sles11sp2:/usr/src/linux/drivers/gpu/drm/i915 # ls
dvo_ch7017.c    i915_drv.c             i915_ioc32.c         intel_bios.c     intel_hdmi.c        intel_ringbuffer.h
dvo_ch7xxx.c    i915_drv.h             i915_irq.c           intel_bios.h     intel_i2c.c         intel_sdvo.c
dvo.h           i915_gem.c             i915_mem.c           intel_crt.c      intel_lvds.c        intel_sdvo_regs.h
dvo_ivch.c      i915_gem_debug.c       i915_reg.h           intel_display.c  intel_modes.c       intel_tv.c
dvo_sil164.c    i915_gem_evict.c       i915_suspend.c       intel_dp.c       intel_opregion.c    Makefile
dvo_tfp410.c    i915_gem_execbuffer.c  i915_trace.h         intel_drv.h      intel_overlay.c
i915_debugfs.c  i915_gem_gtt.c         i915_trace_points.c  intel_dvo.c      intel_panel.c
i915_dma.c      i915_gem_tiling.c      intel_acpi.c         intel_fb.c       intel_ringbuffer.c

xen-sles11sp2:/usr/src/linux/drivers/gpu/drm/i915 # make -C  /usr/src/linux-3.0.13-0.27-obj/x86_64/default/  M=$(pwd) modules make: Entering directory `/usr/src/linux-3.0.13-0.27-obj/x86_64/default'
make -C /usr/src/linux-3.0.13-0.27 O=/usr/src/linux-3.0.13-0.27-obj/x86_64/default/. modules
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/i915_drv.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/i915_dma.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/i915_irq.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/i915_mem.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/i915_debugfs.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/i915_suspend.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/i915_gem.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/i915_gem_debug.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/i915_gem_evict.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/i915_gem_execbuffer.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/i915_gem_gtt.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/i915_gem_tiling.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/i915_trace_points.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/intel_display.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/intel_crt.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/intel_lvds.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/intel_bios.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/intel_dp.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/intel_hdmi.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/intel_sdvo.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/intel_modes.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/intel_panel.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/intel_i2c.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/intel_fb.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/intel_tv.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/intel_dvo.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/intel_ringbuffer.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/intel_overlay.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/intel_opregion.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/dvo_ch7xxx.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/dvo_ch7017.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/dvo_ivch.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/dvo_tfp410.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/dvo_sil164.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/i915_ioc32.o
  CC [M]  /usr/src/linux/drivers/gpu/drm/i915/intel_acpi.o
  LD [M]  /usr/src/linux/drivers/gpu/drm/i915/i915.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /usr/src/linux/drivers/gpu/drm/i915/i915.mod.o
  LD [M]  /usr/src/linux/drivers/gpu/drm/i915/i915.ko
make: Leaving directory `/usr/src/linux-3.0.13-0.27-obj/x86_64/default'
insmod 正常。




阅读(9022) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~