Compiling a 2.6 Kernel
Results 1 to 9 of 9

Thread: Compiling a 2.6 Kernel

  1. #1
    Trumpet-Eared Gentoo Freak
    Join Date
    Jan 2003
    Posts
    992

    Lightbulb Compiling a 2.6 Kernel

    Hey all,

    I didn’t find a kernel guide for the 2.6 range kernels, so after googling and rtfm-ing I managed to compile my own 2.6.0-test9 kernel.
    This will be the kernel we will be compiling. My OS is Gentoo. I replaced every Gentoo-specific lines to common ones, so this should work for most distro’s.

    It's very important to know this kernel isn't yet announced stable, so this is on your own risk.

    So let’s begin.

    First make sure you know your system.
    $ su ( get in root)

    #lsmod
    This will give you a list of the modules loaded in your old good functioning kernel. Here you also get the good modules you need to probe if you might have problems later. So you might want to write these down.

    Now, we need to get the kernel so,

    #cd /usr/src
    #wget –c ftp://ftp.kernel.org/pub/linux/kerne...-test9.tar.bz2

    #tar –xvjf linux-2.6.0-test9.tar.bz2
    With the tar command you’ll extract the compressed kernel

    #ls –la
    If ok you’ll see a present symlink from /usr/src/linux -> /usr/src/old-kernel

    #rm –d linux
    With this command you remove this symlink, because we will make one to the new kernel. We will do this with the next line.

    #ln –s linux-2.6.0-test9 /usr/src/linux
    If you do an ls –la you should see the new symlink to the new kernel dir.

    Here, take your time to config the new kernel and make sure you have your specs of your box aside you or in your head
    #pwd
    If not /usr/src/linux, then #cd /usr/src/linux

    #make menuconfig
    You will now see the kernelconfig menu. In the top of that screen you can see the version of the kernel. If you don’t see here something like linux 2.6.0 – test 9 kernel, you should look what you have missed. Maybe only a symlink problem.

    If you’re ready with the kernel config, than its time to compile the kernel.

    On the 2.4 kernels it was like this :
    # make dep && make clean bzImage modules modules_install

    On the 2.6 kernel its like this :
    #make && make modules_install

    This is because in this version ‘make’ is an alias for ‘make bzImage modules vmlinux’
    If you’re not sure about this , then get a manual or type
    #make help (I know it worked for me)

    OK. Kernel done. Now is another important part in case you did something wrong.

    #mount /boot
    #cd /boot

    Now you're in the boot section and you can move the old image to a new namm
    #mv bzImage bzImage.old

    #cp /usr/src/linux/arch/i386/boot/bzImage /boot

    This will move the old kernel to bzImage.old and copy the new kernel to /boot/bzImage
    To make it easy on yourself, edit your bootloader-conf-file, and change the existing line
    for the old kernel to the bzImage.old and add a new section pointing towards the new kernel (bzImage).

    Also if you need modules to be loaded, edit your /etc/modules.autoload if you want them loaded on boot.

    If you’re using Grub saving the conf file will do, but if you’re using LILO make sure you rebuild LILO like this.

    #/sbin/lilo

    So, lets finish up ,

    #umount /boot
    #shutdown –r now

    If everything goes well you should see your bootloader giving a new option (aka kernel) to be tried out.
    Don’t panic if something goes wrong on boot, just reboot , launch the old kernel and review what you might have done wrong.

    Good luck !

    *** EDIT : Did a minor fix .
    Come and check out our wargame-site @ http://www.rootcontest.org
    We chat @ irc.smdc-network.org #lobby

  2. #2
    Senior Member
    Join Date
    Aug 2003
    Posts
    1,019
    Woohoo!! I've been looking for something like this......at least I now have a starting point.

  3. #3
    Now, RFC Compliant! Noia's Avatar
    Join Date
    Jan 2002
    Posts
    1,210
    Weeeee! Been looking for one of these! Now I'm off to b0rk my kernel!

    - Noia
    With all the subtlety of an artillery barrage / Follow blindly, for the true path is sketchy at best. .:Bring OS X to x86!:.
    Og ingen kan minnast dei linne drag i dronningas andlet den fagre dag Då landet her kvilte i heilag fred og alle hadde kjærleik å elske med.

  4. #4
    Banned
    Join Date
    Jul 2003
    Posts
    325
    You must spread your AntiPoints around before giving it to .: Shrekkie :. again.
    bah.

  5. #5
    Trumpet-Eared Gentoo Freak
    Join Date
    Jan 2003
    Posts
    992
    Yesterday I tried the "make dep && make clean bzImage modules modules_install".

    This works too, but he automatically tells the "make dep" is not necessary, so that would make it pretty much the same

    Greetz,
    Come and check out our wargame-site @ http://www.rootcontest.org
    We chat @ irc.smdc-network.org #lobby

  6. #6
    Antionline's Security Dude instronics's Avatar
    Join Date
    Dec 2002
    Posts
    901
    Excellent. I love it. Keep it up ogre
    Ubuntu-: Means in African : "Im too dumb to use Slackware"

  7. #7
    Senior Member
    Join Date
    Jul 2003
    Posts
    634
    cool tut, I wrote one a while back about general kernel compilation (not specfic to any release number)

    prefer your layout and its up to date with the brand new shinny kernel

    i2c

  8. #8
    Banned
    Join Date
    Jul 2003
    Posts
    325
    Thanks Shrekkie baby

  9. #9
    AO Antique pwaring's Avatar
    Join Date
    Aug 2001
    Posts
    1,409
    I was amazed how easy it was to upgrade from 2.4 to 2.6 - everything worked perfectly and this is the first time I have compiled the kernel (usually I just use the one the vendor provides). Cheers Shrekkie!
    Paul Waring - Web site design and development.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •