View Full Version : Mini-HOWTO : Compile 2.5.66+ kernel


OneOfOne
well i have had lotsa troubles with that and when i finally made it i felt like i should share that.

1. grap the latest 2.5.x kernel from http://www.kernel.org/pub/linux/kernel/v2.5/
2a. move/copy it to /usr/src (well you can put it wherever) then unbz2/tar :
if you have bzip2 installed and you downloaded the .tar.bz2 then you should do this :
tar -xjvf linux-2.5.x.tar.bz2 you will have the src tree under linux-2.5.x/
else you can do it the old style with gzip.

2b. if you have any patchs and you want to apply it to the 2.5.x kernel you should cd to linux-2.5.x/ then do this command : patch -p1 <patch-2.5.x
3. cd to the linux-2.5.x folder then type : make menuconfig OR make xconfig (KDE2.2+) OR make gconfig (GNome)
4. after you save your config type this command to compile the kernel: make bzImage
5. if you chose any modules then type:
make modules modules_install
6a. to make it auto install the kernel type : make install
6b. if you use lilo you should rerun it : /sbin/lilo
7. reboot and enjoy.

NOTES (IMPORTANT) :
A. if it won't boot for some reason try to do this : make clean defconfig bzImage modules modules_install install
if it still won't boot then its something with your hardware.
B. it have some broken deps with the v4l & audio drivers
C. well that's about all what i did and it works like a charm here

Ref. :
http://www.kernel.org/pub/linux/kernel/v2.5/
http://www.codemonkey.org.uk/post-halloween-2.5.txt

i'm a newbie myself so i wrote this so anyone can understand it, a newbie or not. if you feel i should add/change anything please let me know.
please post what you think, oh would someone please make it sticky? thanks :)

peace
-Ahmed F.

uniball
Nice try, just to add somethen
after cd linux-2.5.x do:
make mrproper
make menuconfig "or xconfig which requires X, not kde. First time to hear about make gconfig ;)"
save your configuration
make dep
make clean
make bzImage
make modules
make modules_install

make install:
be carefull
you have to edit the toplevel Makefile and set your images directory "/ or /boot"
/sbin/lilo -v
shutdown -r now ;)

i'd like /usr/src/linux to be a symlink to the actual kernel directory just to help me compile ALSA ;-)

OneOfOne
Alternate configuration commands are:
"make menuconfig" Text based color menus, radiolists & dialogs.
"make xconfig" X windows (Qt) based configuration tool.
"make gconfig" X windows (Gtk) based configuration tool.
"make oldconfig" Default all questions based on the contents of your existing ./.config file.

"make mrproper" isnt need unless you already compiled it before and i believe even if you did you better use "make clean" unless you wanna remove the .config file as well.
the very short compiling guide would be :

tar -xvjf linux-2.5.x.tar.bz2
(optional but needed to compile other modules) ln -s linux-2.5.x /usr/src/linux
cd linux-2.5.x
(optional) patch -p1 <patch-2.5.x
(if you compiled it before) make mrproper OR make clean
make menuconfig (OR xconfig OR gconfig)
make bzImage
<if you enabled modules>
make modules
make modules_install
</if you enabled modules>
make install
lilo
shutdown -r now
echo enjoy ;)

uniball
From where did you get the Alternate configuration commands?
make mrproper is recommended, even if you are using a fresh unpacked tarball.
make menuconfig
make dep
make clean
make bzImage

OneOfOne
hmm have you compiled a recent 2.5.x kernel lately? check the the Makefile..
also "make dep" doesnt work anymore, if you try it'll say *** Warning : make dep is unnecessary now. then exits.

are you sure you're not talking about 2.4.x?

peace
-Ahmed F.

whirlpool
Originally posted by uniball

i'd like /usr/src/linux to be a symlink to the actual kernel directory just to help me compile ALSA ;-)

also to compile Connexant modem drivers.

You also should check your /boot with ls -l. And make sure that symbolic links are pointing to the right stuff.

uniball
Ok OneOfOne, You win.
i've compiled one of the very early 2.5.x
but it was so damn slow.
Is there something special about the latest 2.5 ? "apart from the low latency & preempetible stuff ?"

whirlpool: No conexant modem here :D
and 2 monthes before, I wasn't using ALSA too ;)

OneOfOne
oh man i stayed awake for like 26hrs yesterday and i feel like a truck ran over my head..

well i know this is gonna sound stupid but i compiled it just for the fun of using something new lol.
i like the native xfs support & the updated ntfs driver (i have 120gb on 2 harddisks on ntfs partitions so... i really dont wanna convert that to xfs/reiserfs) alsa & v4l never compiles as modules but should work if you add them to the kernel.

Peace
-Ahmed F.

uniball
We do many things for fun ;)
i did try an early 2.5.x version just for fun too !