Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I need to install another kernel(2.6.34) into my fedora/ubuntu machine(x86) and I need to show the old and new boot up options in the boot menu(both new and old kernel)

I have downloaded the new kernel and I need to compile it and need to build it.

How can I complete this from start to finish?

share|improve this question

3 Answers 3

Ok here we go on how to compile and install a new kernel :

First the dependencies for all of this :

sudo apt-get install build-essential makedumpfile

Plus the dependencies for the specific kernel, for a kernel which is in a repository you can do this :

sudo apt-get build-dep linux-image-"kernel number"

For your kernel, I don't know, maybe they are the same maybe they are differents you should search info on Google for that, it may depend on how you configure your kernel.

After this I suggest you create a place to work in your home folder :

mkdir src
cd src

You can unzip your kernel here or get a kernel from a repository with :

apt-get source linux-image-"kernel number"

Now we want to work in the unzipped folder :

cd linux-"kernel number"

After this you will need a tool to edit your kernel configuration, there are two different tools and to use them you will have to install their dependencies :

For xconfig = sudo apt-get install qt3-dev-tools libqt3-mt-dev
For menuconfig = sudo apt-get install libncurses5 libncurses5-dev

I suggest you use xconfig, which is easier to use. To use it you type :

xconfig = make xconfig
menuconfig = make menuconfig

Configure your kernel as you like and save your configuration. If you don't need it you should disable "Kernel debugging (DEBUG_KERNEL)" under "Kernel hacking" since that will make the compilation less long.

To compile, you type :

CONCURRENCY_LEVEL=3 sudo make-kpkg --initrd --append-to-version=-something kernel-image kernel-headers

Replace "CONCURRENCY_LEVEL=3" by the number of core your processor have +1 that will make the compilation much faster. Replace "--append-to-version=-something" by what you want to append to the name of the kernel.

Wait for a very long time, several hours depending on your computer.

When it is finished and if nothing bad happened you will have two beautiful debian packages created in the parent folder, install them :

cd ..
sudo dpkg -i linux-image-"kernel number".deb
sudo dpkg -i linux-headers-"kernel number".deb

Don't forget to update grub :

sudo dpkg-reconfigure grub-pc

Reboot on your new kernel and, if everything is fine, you're done.

share|improve this answer

Do you really need to compile it yourself? There are mainline kernel builds for Ubuntu. There is also info about building your own kernel.

share|improve this answer
    
yes. I would like to start from scratch ! –  Renjith G Oct 15 '10 at 8:46
    
Then you want the second link! :) –  JanC Oct 15 '10 at 10:38
    
Thx JanC, the second link worked for me. It works like a charm... –  user10533 Feb 14 '11 at 12:59

There are following steps to install new kernel. I m also getting some problem but I want to share how to build new kernel.

  1. Download the latest kernel

  2. Unzip it in any directory.It is usefull to unzip it in ur home folder.

  3. Go to that folder like cd /home/linux/linux-{version}/

  4. Now make a new configuration file. For that use 1 of these commands:

    • make config, this will give u config file

    • make defconfig, this will give u default config file

  5. After that check whether the config file is suitable or not for your kernel by this command:

    make oldconfig
    

    If any option is not there in your config file then it will give you options to select the option <Y/n/m>. The capital letter shows that this is the default option. You can select that option by pressing Enter only.

  6. make or make -jn where n is 2* no of core processors

  7. make modules_install

  8. make install

Restart your system and select your new kernel option.

share|improve this answer
    
thanks for editing.. –  goodies Apr 23 '13 at 10:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.