Hi all, I am running CentOS 5.3 under xen on a VPS machine (so I have a limited control on the machine) I am playing with openswan and KLIPS and I need to build the ipsec.ko kernel module. I would need to download kernel source but I am really confused about what source I have to get. uname -r tells: 2.6.18-128.7.1.el5xen ls /lib/modules tells: ls /lib/modules 2.6.18-128.7.1.el5xen 2.6.18-164.2.1.el5 2.6.18-164.6.1.el5 2.6.18-53.1.13.el5xen I have no sources in /usr/src/kernels Is there a source code named "2.6.18-128.7.1.el5xen" which I can download or should I install kernel-devel source using yum? If I used yum I would download 2.6.30.9... yum info kernel-devel Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile Available Packages Name : kernel-devel Arch : i686 Version : 2.6.18 Release : 164.6.1.el5 Size : 5.2 M Repo : updates Summary : Development package for building kernel modules to match the kernel. URL : http://www.kernel.org/ License : GPLv2 Description: This package provides kernel headers and makefiles sufficient to build modules : against the kernel package. and kernel.org has only source code from 2.6.18.1 to 2.6.18.8 Thanks Mauro -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos-virt/attachments/20091126/cc399bc8/attachment-0004.html>
Hi Mauro, My understanding of the situation is that the kernel-devel package has the source code the kernel is compiled against. If you look at the output of the yum info you posted the package shows version 2.6.18 which is the kernel version that CentOS is compiled against. kernel.org is only referenced because they are the upstream creator of the source code for that package. So all you need to do to get the CentOS kernel source code is yum install kernel-devel. You'll get 2.6.18 with the CentOS/RHEL patches. -- Drew "Nothing in life is to be feared. It is only to be understood." --Marie Curie
Manuel Wolfshant
2009-Nov-27 10:58 UTC
[CentOS-virt] What kernel source and how to download it
Mauro Gatti wrote:> Hi all, > I am running CentOS 5.3 under xen on a VPS machine (so I have a > limited control on the machine) > I am playing with openswan and KLIPS and I need to build the ipsec.ko > kernel module. > I would need to download kernel source but I am really confused about > what source I have to get. > > uname -r tells: > 2.6.18-128.7.1.el5xenJust for the record, that is the kernel from Centos 5.4/ updates ( and it is a good thing that you use it)> > ls /lib/modules tells: > ls /lib/modules > 2.6.18-128.7.1.el5xen 2.6.18-164.2.1.el5 2.6.18-164.6.1.el5 > 2.6.18-53.1.13.el5xen > > I have no sources in /usr/src/kernels > > Is there a source code named "2.6.18-128.7.1.el5xen" which I can > download or should I install kernel-devel source using yum?the package is called kernel-xen-devel (to be in sync with kernel-xen which you are using)> If I used yum I would download 2.6.30.9...You would not. There is no 2.6.30 in the Centos repositories> yum info kernel-devel > Loaded plugins: fastestmirror > Loading mirror speeds from cached hostfile > Available Packages > Name : kernel-devel > Arch : i686 > Version : 2.6.18 > Release : 164.6.1.el5 > Size : 5.2 M > Repo : updates > Summary : Development package for building kernel modules to match > the kernel. > URL : http://www.kernel.org/ > License : GPLv2 > Description: This package provides kernel headers and makefiles > sufficient to build modules > : against the kernel package. > > and kernel.org has only source code from 2.6.18.1 to 2.6.18.8 >you should not look at the stock kernels when using centos.