How to fix symbols and version of module binary?
有沒有遇過像這樣的訊息呢?
[root@localhost net]# insmod acx100sta_cs.o
acx100sta_cs.o: kernel-module version mismatch
acx100sta_cs.o was compiled for kernel version 2.4.21-0.13mdk
while this kernel is version 2.4.21-0.18mdk.
有時候我們從一些網站上下載回某個 linux driver, 有些含 source, 有些僅是
module binary 若該 module binary 編譯的環境(kernel 版本)和目前正在用的
kernel 版本不符時, 往往就會出現 kernel-module version mismatch 的錯誤.
有個方法是利用 insmod -f 來強迫載入 module.
還有個法子, 請下載 fixscript
fixscript 可直接修改 module binary 裡的符號表和版本資訊以符合目前
運行中的 kernel 版本和環境. fixscript 處理過後即可不用 insmod -f
來強迫載入. 只是這樣的 module 可能帶來一些風險, 要自行斟酌使用之.
使用範例:
[root@localhost root]# ./fixscript acx100sta_cs.o newacx100sta_cs.o
Fixscript V1.7
doing eth_type_trans trunc=eth_type_trans new=eth_type_trans_R729edb6c
doing __wake_up trunc=__wake_up new=__wake_up_Rb76c5f1e
doing __kfree_skb trunc=__kfree_skb new=__kfree_skb_Rc45b82d1
doing alloc_skb trunc=alloc_skb new=alloc_skb_Rdc2b24bd
doing pci_register_driver trunc=pci_register_driver new=pci_register_driver_R1e536d21
doing __generic_copy_from_user trunc=__generic_copy_from_user new=__generic_copy_from_user_R116166aa
doing __release_region trunc=__release_region new=__release_region_Rd49501d4
doing kmalloc trunc=kmalloc new=kmalloc_R93d4cfe6
doing pci_free_consistent trunc=pci_free_consistent new=pci_free_consistent_R1bfc1908
doing pci_enable_device trunc=pci_enable_device new=pci_enable_device_R1bc741d2
doing alloc_etherdev trunc=alloc_etherdev new=alloc_etherdev_R6520b46c
doing vfree trunc=vfree new=vfree_R2fd1d81c
doing pci_disable_device trunc=pci_disable_device new=pci_disable_device_R958460
05
doing boot_cpu_data trunc=boot_cpu_data new=boot_cpu_data_R0657d037
doing cpu_raise_softirq trunc=cpu_raise_softirq new=cpu_raise_softirq_Rd01f3ee8
doing free_irq trunc=free_irq new=free_irq_Rf20dabd8
doing unregister_netdev trunc=unregister_netdev new=unregister_netdev_Rd372bc38
doing __out_of_line_bug trunc=__out_of_line_bug new=__out_of_line_bug_R8b0fd3c5
doing iounmap trunc=iounmap new=iounmap_R5fb196d4
doing pci_alloc_consistent trunc=pci_alloc_consistent new=pci_alloc_consistent_Rca1c24c8
doing __ioremap trunc=__ioremap new=__ioremap_R9eac042a
doing del_timer trunc=del_timer new=del_timer_Rfc62f16d
doing register_netdev trunc=register_netdev new=register_netdev_Rc85ab262
doing iomem_resource trunc=iomem_resource new=iomem_resource_R9efed5af
doing kfree trunc=kfree new=kfree_R037a0cba
doing request_irq trunc=request_irq new=request_irq_R0c60f2e0
doing netif_rx trunc=netif_rx new=netif_rx_Rd1546c1c
doing __verify_write trunc=__verify_write new=__verify_write_R203afbeb
doing pci_unregister_driver trunc=pci_unregister_driver new=pci_unregister_driver_Re8061e13
doing skb_over_panic trunc=skb_over_panic new=skb_over_panic_R5ced0794
doing pci_set_master trunc=pci_set_master new=pci_set_master_R99cc7ae2
doing sleep_on_timeout trunc=sleep_on_timeout new=sleep_on_timeout_R75c8e394
doing sprintf trunc=sprintf new=sprintf_R1d26aa98
doing jiffies trunc=jiffies new=jiffies_R0da02d67
doing __vmalloc trunc=__vmalloc new=__vmalloc_R79995c5b
doing softnet_data trunc=softnet_data new=softnet_data_R338e35b2
doing __request_region trunc=__request_region new=__request_region_R1a1a4f09
doing printk trunc=printk new=printk_R1b7d4074
doing add_timer trunc=add_timer new=add_timer_Ra19eacf8
doing __generic_copy_to_user trunc=__generic_copy_to_user new=__generic_copy_to_
user_Rd523fdd3
[root@localhost root]# insmod newacx100sta_cs.o
Warning: loading newacx100sta_cs.o will taint the kernel: no license
See http://www.tux.org/lkml/#export-tainted for information about tainted modu
les
newacx100sta_cs.o: init_module: No such device
Hint: insmod errors can be caused by incorrect module parameters, including inva
lid IO or IRQ parameters.
You may find more information in syslog or the output from dmesg
沒有留言:
張貼留言