LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 846|回复: 1

从Redhat官方看的,关于RHEL4不再提供内核源码包的文章

[复制链接]
发表于 2006-11-23 17:09:06 | 显示全部楼层 |阅读模式
Redhat认为提供一个内核的源码包是多余的,他只提供kernel-devel的包来解决编译第三方模块的问题,在这个包中包含了所需的头文件。

不知道在比RHEL4级别更高的FC5与FC6上,是否也一样采用了这种方法,只提供头文件,不再提供完整的源码包?

Issue:
Where is the kernel-source package for Red Hat Enterprise Linux 4?
Resolution:

    The following information has been provided by Red Hat, but is outside the scope of our posted Service Level Agreements (https://www.redhat.com/support/service/sla/) and support procedures. The information is provided as-is and any configuration settings or installed applications made from the information in this article could make your Operating System unsupported by Red Hat Support Services. The intent of this article is to provide you with information to accomplish your system needs. Use the information in this article at your own risk.

Unlike Red Hat Enterprise Linux versions 2.1 and 3, there is no kernel-source package in the Red Hat Enterprise Linux 4 distribution. It was deemed redundant to provide a kernel-source package and a kernel .src.rpm package at the same time. Users that require access to the kernel sources can find them in the kernel.src.rpm file.

In Red Hat Enterprise Linux 4, The kernel-devel package includes the kernel headers files and you no longer require the kernel source package to build a third party kernel module. To install the kernel-devel package run the following command as root user in a terminal:
  1. #up2date kernel-devel
复制代码

A full source tree is not required in order to build modules against the current kernel you are using. You can simply point your Makefile to /lib/modules/`uname -r`/build. A more detailed explanation can also be found in the Release Notes.

If you require the kernel source package for reasons other than building a kernel module, you can obtain it in Red Hat Enterprise Linux 4 by typing the following as root user in a terminal:
  1. # up2date redhat-rpm-config rpm-build
  2. # up2date --get-source kernel
  3. # rpm -ivh /var/spool/up2date/kernel*.src.rpm
  4. # cd /usr/src/redhat/SPECS
  5. # rpmbuild -bp --target=i686 kernel-2.6.spec
  6. # cp -a /usr/src/redhat/BUILD/kernel-2.6.9/linux-2.6.9 /usr/src
  7. # ln -s /usr/src/linux-2.6.9 /usr/src/linux
  8.       
复制代码

Note: This will build the source tree for a x86 based architecture. For different architectures, (i.e. x86_64) pass the appropriate target variable (i.e. rpmbuild -bp --target=x86_64 kernel-2.6.spec )

Once completed, a symlinked directory pointing to the latest Linux 2.6 kernel source should be available:
  1. # ls -lt /usr/src
  2. total 28
  3. lrwxrwxrwx   1 root root   12 Mar  2 16:36 linux -> linux-2.6.9/
  4. drwxr-xr-x  20 root root 4096 Mar  2 16:21 linux-2.6.9
复制代码
发表于 2006-11-23 23:15:49 | 显示全部楼层
老,自己去主页FTP下kernel-source包就可以了
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表