ubuntu linux

Every thing on ubuntu linux

&
 

Jan 04 2009

kernel-source for your distro?

Published by linuxubuntu at 10:43 am under Uncategorized Edit This

These steps should save you some time, trouble and many headaches. In the even that you neglected to read the release notes for FC3…eh-hem…the FC project has decided not to supply the kernel-source in order to prevent redundancy. You see, the kernel-source tree can be extracted from the kernel-*.src.rpm if you absolutely need it. In my case, I needed to supply the –kernel-source-path when (re)installing the latest NVIDIA drivers (more on NVIDIA drivers below…) after rebooting with a new kernel. So, here are the steps that you should follow in order to extract the kernel-source tree from the kernel-*.src.rpm:
Step (1). Go find the kernel-*.src.rpm (#> locate kernel-*.src.rpm) or download it from the Internets. For instance, you could get it from here .
Step (2). Now you must install the rpm. As root, execute
#> rpm -Uvh kernel-*.src.rpm
Step (3). The previous step should have created a kernel-2.6.spec (or similarly kernel-2.4.spec if you’re still on that kernel) file in the /usr/src/redhat/SPECS/ directory. You must build the rpm against this .spec file to get the binaries and source.
As root, execute
#> rpmbuild -bp –target=noarch /usr/src/redhat/SPECS/kernel-2.6.spec
Step (4). Create the necessary symbolic links for your directory tree:
#> cd /usr/src
#> ln -s redhat/BUILD/kernel-2.6.10/linux-2.6.10/ linux
#> ln -s redhat/BUILD/kernel-2.6.10/linux-2.6.10/ linux-2.6.10
Step (5). Now we need to make the new .config files:
#> cd /usr/src/linux-2.6.10
#> make mrproper
#> cp /usr/src/linux-2.6.10/configs/kernel-2.6.10-i686.config /usr/src/linux-2.6.10/.config
#> make oldconfig
#> make menuconfig
#> make
Now, you have a kernel-source tree under /usr/src/linux-2.6.10 just like you would if you had been supplied the kernel-source in the first place. Note that the kernel numbers (i.e. 2.6, 2.6.10, etc.) and system architecture numbers (i.e. i686) may be different for your situation. Replace with correct numbers/information where necessary. I was able to install the new NVIDIA drivers by executing:

#> sh NVIDIA-Linux-x86-1.0-###-pkg1.run –kernel-source-path /usr/src/linux-2.6.10

Possibly-related Articles:                                        (auto-generated)

Trackback URI | Comments RSS

Leave a Reply