Tips and tricks: Where is the kernel-source package for Red Hat Enterprise Linux 4?

20 August 2008, 4:00 pm

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: #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: # up2date redhat-rpm-config rpm-build # up2date --get-source kernel # rpm -ivh /var/spool/up2date/kernel*.src.rpm # cd /usr/src/redhat/SPECS # rpmbuild -bp --target=i686 kernel-2.6.spec # cp -a /usr/src/redhat/BUILD/kernel-2.6.9/linux-2.6.9 /usr/src # ln -s /usr/src/linux-2.6.9 /usr/src/linux 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: # ls -lt /usr/src total 28 lrwxrwxrwx 1 root root 12 Mar 2 16:36 linux -> linux-2.6.9/ drwxr-xr-x 20 root root 4096 Mar 2 16:21 linux-2.6.9 Note:The steps are also provided in the Red Hat Enterprise Linux 4 Release Notes: http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/release-notes/as-x86/ This 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. Red Hat’s customer service and support teams receive technical support questions from users all over the world. Red Hat technicians add the questions and answers to Red Hat Knowledgebase on a daily basis. Access to Red Hat Knowledgebase is free. Red Hat Magazine offers a preview into the Red Hat Knowledgebase by highlighting some of the most recent entries. The information provided in this article is for your information only. The origin of this information may be internal or external to Red Hat. While Red Hat attempts to verify the validity of this information before it is posted, Red Hat makes no express or implied claims to its validity. ... read more

More Topics from "News"


Featured Video

Featured Video