|
|
发表于 2006-11-17 07:01:48
|
显示全部楼层
Post by springwind426
你安装的系统的是什么类型?(stable、testing、sid)
aptitude search kernel-image|grep ^i
或者
aptitude search linux-image|grep ^i
由此可以知道你的系统中安装的是哪个内核,知道了内核后,就可以安装相应的内核头文件。
通常情况下,编译内核模块的时候,是不需要源码的,只要有头文件就可以了。 似乎普遍人都有一个误区,内核要对应相应的内核头文件。其实不然,系统真正要对应的头文件是系统编译 Glibc 那个时候的头文件。
引自 LFS 手册第 8 章编译内核的部份
http://www.linuxfromscratch.org/ ... apter08/kernel.html
Warning
Some kernel documentation recommends creating a symlink from /usr/src/linux pointing to the kernel source directory. This is specific to kernels prior to the 2.6 series and must not be created on an LFS system as it can cause problems for packages you may wish to build once your base LFS system is complete.
Also, the headers in the system's include directory should always be the ones against which Glibc was compiled, that is, the ones from the Linux-Libc-Headers package, and therefore, should never be replaced by the kernel headers.
以下是引自 CLFS x86_64 multilib 手册编译内核的部份,分别在 header 文件,Debian 仍采用 Linux-Libc-Headers,但 Linux-Libc-Headers project 其实已寿终正寝了!
http://cross-lfs.org/view/svn/x86_64/bootable/kernel.html
Warning
Some kernel documentation recommends creating a symlink from /usr/src/linux pointing to the kernel source directory. This is specific to kernels prior to the 2.6 series and must not be created on a CLFS system as it can cause problems for packages you may wish to build once your base CLFS system is complete.
Also, the headers in the system's include directory should always be the ones against which Glibc was compiled (from the Linux-Headers package) and should never be replaced by the kernel headers. |
|