Sunday, October 9, 2011

How to install Linux kernel source code

This is example of how to download linux kernel source code for study.
I downloaded on fedora 10. same should work in other versions of fedora.

1.  use the command

   yumdownloader --source kernel

this will download src.rpm for linux kernel. it will download something
similiar to kernel-2.6.27.41-170.2.117.fc10.src.rpm file.


2.  use

rpm -Uvh kernel-2.6.27.41-170.2.117.fc10.src.rpm

then

cd ~/rpmbuild/SPECS/

then

rpmbuild -bp --target=$(uname -m) kernel.spec

after this

u can see source code in the directory ~/rpmbuild/BUILD


this is a way to download source code for study,
but u cannot compile it because we have not download
depencies and relevant patches.





No comments:

Post a Comment