欢迎来到天天文库
浏览记录
ID:8803917
大小:20.27 KB
页数:2页
时间:2018-04-08
《linux内核头文件(linuxheaders)》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、更新Linux内核头文件(linuxheaders)三8th,20132,474views
2、 发表评论
3、 Trackback一般来说,如果不是自己编译kernel,那么更新头文件是比较容易的事情,在Ubuntu/Fedora等操作系统上,可以直接安装相应的linux-headers软件包,下面就演示了在Ubuntu上安装内核头文件的过程。ViewCode BASH123456789master@jay-intel:~/workspace/c-study$uname-r3.2.0-33-genericmaster@jay-intel:~/workspace/c-study
4、$apt-getinstalllinux-headers-$(uname-r)Readingpackagelists...DoneBuildingdependencytreeReadingstateinformation...Donelinux-headers-3.2.0-33-genericisalreadythenewestversion.linux-headers-3.2.0-33-genericsettomanuallyinstalled.0upgraded,0newlyinstalled,0toremoveand331notupgraded.然而,如果自己编译L
5、inuxkernel并用它启动了系统,然后为了让本地程序基于当前kernel的headers来编译,就需要自己手动更新内核的头文件了。手动更新linuxheaders的步骤如下:1.在Linuxkernel目录中,执行“makeheaders_install”命令,将headers安装到当前目录的usr/include/下面。2.将以前的headers备份:包括/usr/include/目录下的asm,asm-generic,linux等目录。3.将刚才生成的当前编译内核目录下的usr/include/中的asm,asm-generic,linux等目录复制到/usr/i
6、nclude/目录下即可。(当然如果还需要更新其他的目录的头文件,也都可以一起复制过去。)操作演示如下:ViewCode BASH1234567891011121314151617[root@jay-linuxkvm.git]#makeheaders_installCHKinclude/generated/uapi/linux/version.hWRAParch/x86/include/generated/asm/clkdev.hSYSHDRarch/x86/syscalls/../include/generated/uapi/asm/unistd_32.hSYSHDRa
7、rch/x86/syscalls/../include/generated/uapi/asm/unistd_64.hSYSHDRarch/x86/syscalls/../include/generated/uapi/asm/unistd_x32.hSYSTBLarch/x86/syscalls/../include/generated/asm/syscalls_32.hSYSHDRarch/x86/syscalls/../include/generated/asm/unistd_32_ia32.hSYSHDRarch/x86/syscalls/../include/gen
8、erated/asm/unistd_64_x32.hSYSTBLarch/x86/syscalls/../include/generated/asm/syscalls_64.hHOSTCCarch/x86/tools/relocsHOSTCCscripts/unifdefINSTALLinclude/asm-generic(35files)INSTALLinclude/drm(15files)INSTALLinclude/linux/byteorder(2files)INSTALLinclude/linux/caif(2files)INSTALLinclude/linux
9、/can(5files)181920212223242526272829303132333435INSTALLinclude/linux/dvb(8files)INSTALLinclude/linux/hdlc(1file)INSTALLinclude/linux/hsi(1file)INSTALLinclude/linux/isdn(1file)<省略部分信息...>INSTALLinclude/asm(64files) [root@jay-linuxinclude]#pwd/usr/include[root@jay-lin
此文档下载收益归作者所有