• 编译内核模块找不到内核头文件解决办法


    在常用的Linux发行版中,很多(CentOS、Fedora)已经不再默认提供头文件,以CentOS 5.1为例,一般的头文件链接地址为/lib/modules/2.6.18-53.el5/build,但是默认安装的系统此链接并没有链接到任何文件。

    解决方法是yum install kernel-devel,安装成功后在/usr/src/kernel/下有个对应版本的文件夹,将此文件夹链接到build即可:

    rm /lib/modules/2.6.18-53.el5/build

    ln -s /usr/src/kernel/2.6.18-53.el5 /lib/modules/2.6.18-53.el5/build



    [root@localhost test]# ll  /lib/modules/
    总用量 8                                
    drwxr-xr-x. 7 root root 4096  8月  8 10:09 2.6.32-71.29.1.el6.i686
    drwxr-xr-x. 7 root root 4096  8月  8 2011 2.6.32-71.el6.i686      
    [root@localhost test]# ls
    dmesg.list  hellworld.c  Makefile
    [root@localhost test]# clear
    [root@localhost test]# ll  /lib/modules/
    总用量 8
    drwxr-xr-x. 7 root root 4096  8月  8 10:09 2.6.32-71.29.1.el6.i686
    drwxr-xr-x. 7 root root 4096  8月  8 2011 2.6.32-71.el6.i686
    [root@localhost test]# ll /usr/src/kernels/
    总用量 4
    drwxr-xr-x. 22 root root 4096  8月  8 12:02 2.6.32-71.29.1.el6.i686
    [root@localhost test]#





  • 相关阅读:
    error occurred during initialization of vm
    Service Discovery protocol(SDP)
    nRF51822EK_PRO
    Binder
    android samsung note3  device not found
    BLE pairing vs. bonding
    remote link Centos6.6 Horrible Slow
    depmod -a
    start and end call use itelephony and how to pick up a call
    WebService
  • 原文地址:https://www.cnblogs.com/yuzaipiaofei/p/4124409.html
Copyright © 2020-2023  润新知