Search This Blog

Loading...

Popular Posts

Monday, 3 May 2010

How to compile a kernel on Ubuntu 10.04

The Ubuntu wiki does provide the necessary documentation to allow users to build their own Linux kernel but in a rather disorganised way.

They should restructure it and provide clear detailed steps for each release and not the current mish-mash of old and new.

How about giving each release their own dedicated wiki page?

Original Ubuntu wiki: https://help.ubuntu.com/community/Kernel/Compile

First steps

Install the required tools and packages.

Open a terminal and type the following,

sudo apt-get install fakeroot kernel-wedge build-essential makedumpfile kernel-package libncurses5 libncurses5-dev

Then run the following command,

sudo apt-get build-dep --no-install-recommends linux-image-$(uname -r)

And finally type,

mkdir ~/src
cd ~/src
apt-get source linux-image-$(uname -r)
cd linux-2.6.32

At the time of writing 2.6.32 was the current kernel source, it should remain at this version throughout the life of Ubuntu 10.04

It is a good idea to start with the same .config as the currently running kernel, so type the following,

cp -vi /boot/config-`uname -r` .config

Now we are ready to customize the build and kernel options.

make menuconfig

Once you have finished, save and exit. It is now time to compile. However to speed up the build if you have a dual core processor type,

export CONCURRENCY_LEVEL=3

The general rule is 1 + the number of processor cores.

make-kpkg clean
fakeroot make-kpkg --initrd --append-to-version=-some-string-here kernel-image kernel-headers

Remember to substitute the writing in green for something else, for example -alpha

After a few minutes or hours your kernel compile will be complete. The next step is to install it.

The kernel package will be created in the parent directory of ~/src/linux-2.6.32 (i.e. ~/src)

cd ~/src
sudo dpkg -i linux-image-2.6.32.11+drm33.2-alpha_2.6.32.11+drm33.2-alpha-10.00.Custom_amd64.deb
sudo dpkg -i linux-headers-2.6.32.11+drm33.2-alpha_2.6.32.11+drm33.2-alpha-10.00.Custom_amd64.deb

Please note the text in green must be changed to reflect your version.

We are almost ready, prior to 10.04 the initramfs kernel image was automatically created. The Ubuntu wiki suggests using the scripts to create the image but I have been unsuccessful in using this method, hence the manual approach.

sudo update-initramfs -c -k all

BUG:  Please use the alternate method described below as this command fails to create an image for your new kernel. Special thanks to Helios38. - 16/06/2010


Alternatively if you know the kernel version, substitute the word all with the kernel version.

Example, sudo update-initramfs -c -k 2.6.32.11+drm33.2-alpha

Finally we need to add the initramfs image to the grub.cfg file located at /boot/grub/grub.cfg.

For the easy and automatic method as oppose to manually editing the grub.cfg file, just type the following,

sudo update-grub

Now just reboot and your new kernel should automatically load.

How to remove your  kernel

sudo dpkg -r linux-headers-2.6.32.11+drm33.2-alpha
sudo dpkg -r linux-image-2.6.32.11+drm33.2-alpha
sudo rm /boot/initrd.img-2.6.32.11+drm33.2-alpha

Enjoy compiling your own kernels.

76 comments:

  1. Great tutorial! I sucessfully rolled an Ubuntu Kernel geared towards my MacBook with this, thanks!

    One thing I've found

    "sudo update-initramfs -c -k all"

    This does not detect the new kernel, it only updates the others. Use the second command, tailored towards what you named the kernel.

    ReplyDelete
  2. Thanks for letting me know, I can confirm your observations. I had not picked up on this since I always type the kernel name.

    I have updated the guide to reflect your findings.

    ReplyDelete
  3. The guide is awesome! A lot clear and simple to do than the Ubuntu page mentioned above. I still have a question about recompiling newer kernel than the one in git repository. Since 2.6.34 there's switcheroo support and I have an Asus m51tr notebook with dual integrated/discrete graphic chips on it. When I try:
    "apt-get source linux-image-$(uname -r)"
    says:
    "Picking 'linux' as source package instead of 'linux-image-2.6.35-020635rc3-generic'
    NOTICE: 'linux' packaging is maintained in the 'Git' version control system at:
    http://kernel.ubuntu.com/git-repos/ubuntu/ubuntu-lucid.git"
    Thanks for any suggestions in advance :)

    ReplyDelete
  4. Looks like you installed a kernel from http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.35-rc3-maverick/

    If you want the source, you will have to download it from the git maverick tree.

    https://wiki.ubuntu.com/KernelTeam/KernelGitGuide

    First get the git-core stuff.

    sudo apt-get install git-core

    Now instead of issuing “apt-get source linux-image-$(uname -r)” type the following,

    git clone git://kernel.ubuntu.com/ubuntu/ubuntu-maverick.git

    This will download the source files for 2.6.35.

    Once it has completed,

    cd ubuntu-maverick

    Then proceed as normal.

    Note: If your current running kernel is a different version then it would be best not to run the command,

    cp -vi /boot/config-`uname -r` .config

    Skip this and continue with 'make menuconfig'

    A quick tip for everyone, rather than manually adding the initrd.img to the grub.cfg, you can run the command 'sudo update-grub' after you have created the initramfs. It will add the line automatically.

    And if your custom kernel does not load by default, edit the option in the grub.cfg

    set default="0"

    To correspond to your kernel entry.

    In any event I would always advise you check your grub.cfg

    Perhaps I need to revise and tweak the guide a bit more :)

    ReplyDelete
  5. Thanks for the fast reply :)
    I found the source in here:
    https://launchpad.net/ubuntu/+source/linux/2.6.35-5.6
    but after compiling something went wrong and I wasn't able to boot into the recompiled kernel, firstly. Secondly when I checked the "vga_switcheroo" function in the menuconfig script it was already enabled in Device Drivers -> graphics support -> Laptop Hybrid Grapics - GPU switching support...
    I'm trying to implement the script in this guide:
    http://asusm51ta-with-linux.blogspot.com/2010/05/07052010-fedora-13-beta-kernel-2.html
    for Ubuntu Lucid and since there's switcheroo support in 2.6.34 and above after recompile there should be a folder in /sys/kernel/debug called vga_switcheroo, which I haven't so far.
    I remembered that yesterday I have copied the 2.6.35-rc3 config and that might happened to be the problem. About 'sudo update-grub', Lucid Lynx have Grub2 installed by default so it should be 'sudo update-grub2' if it is default.
    I'll try to recompile with the git code from 2.6.35 in your comment, but now it says:
    "fatal: The remote end hung up unexpectedly"
    May be I have to try later again.
    I'll put some efforts to complete this, because there was no support for such functionality in any operating system /until Airlied made it for Fedora/. It would be nice to have cooler computer, with less noise from the cooling fan, as the fan dissipates heat from both the CPU and GPU. Battery time doubles as well since the integrated GPU is more than twice effective than the discrete one.
    Thanks again for the help! Will write here soon with results I hope :)

    ReplyDelete
  6. Recompiled it successfully! But... still no vgaswitcheroo folder in /sys/kernel/debug. Maybe I have to apply the patches from David Airlied mentioned here:
    http://airlied.livejournal.com/71434.html
    http://people.freedesktop.org/~airlied/vgaswitcheroo/

    BTW when executing 'sudo update-initramfs -c -k ...' in the dots should be the 'exact' name of the kernel. Here failed a lot of times before I look at the "+" sign that was missing at the end. :)

    ReplyDelete
  7. Hi there,

    Great guide.

    I think you have just one slip-up which is in the editing of grub.cfg: Don't bother.

    Simply generate the initrd as described and then sudo update-grub.

    update-grub will find the initrd image and include it automatically. Quicker and cleaner than editing grub.cfg directly.

    ReplyDelete
  8. Thanks Anonymous. With reference to my last comment, I agree.

    ReplyDelete
  9. Thank you for this!
    Just finished compiling my own and worked great (using only "sudo update-grub" as was already noticed).

    Only one question. Any difference between "apt-get source linux-image" and installing the "linux-source" package?

    Thank you!

    ReplyDelete
  10. Oh, one more comment.
    I find it better to run "make oldconfig" before "make menuconfig", rather than copying the .config file.

    ReplyDelete
  11. joni, either way will download the linux source, however if you wanted to use a specific kernel version then installing the relevant linux-source package is the way to go.

    ReplyDelete
  12. This comment has been removed by a blog administrator.

    ReplyDelete
  13. In reply to the above comment, I welcome any comments or suggestions relating to what I have wrote. If you wish to promote your blog, good SEO is the key.

    ReplyDelete
  14. Thanks, Adam, very good help for those who want a custom kernel for whatever reason!

    ReplyDelete
  15. Thanks, this guide worked beautifully. Now if I can just figure out how to get my CD/DVD drive to work...

    ReplyDelete
  16. Excellent guide for noobs like me! (10.04)

    Could you add more info on using custom CFlags like Gentoo? Ubuntu docs are hard to navigate and it seems like they don't want people tinkering with the kernel.

    Thanks!

    ReplyDelete
  17. Thanks again! It took more than 5 hours for the kernel to compile! This is an old junker PentiumM based Inspiron 600m laptop.

    No problems so far, nor do I notice an immediate difference.

    I removed all of the unnecessary junk that comes with the generic kernel. Is there a benchmark I can run to compare my kernel with the stock one?

    ReplyDelete
  18. Recompiling your kernel doesnt automatically guarantee a performance gain or even a noticeable gain.

    There are other reasons for compiling a kernel, such as driver support, your require a specific setting on/off, learning, reducing memory consumption, tuning for a particular use such as low latency or throughput.

    Any performance gain will always be minor.

    For a good benchmarking suite, http://www.phoronix-test-suite.com/?k=home

    However on such an old system, stick to a very basic benchmark like super PI.

    ftp://pi.super-computing.org/Linux/

    If you want to play around with the kernel cflags you have to edit the makefile which is not very straight forward.

    ATTN: section 6 and 3.7.
    http://kernel.org/doc/Documentation/kbuild/makefiles.txt

    ReplyDelete
  19. Great and helpful Howto for getting an altered kernel running quick!
    As embedded developer i almost always need 8 or more UARTs registered (CONFIG_NR_8250_UARTS..)

    ReplyDelete
  20. My Makefile looks like this:

    # SHELL used by kbuild
    CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
    else if [ -x /bin/bash ]; then echo /bin/bash; \
    else echo sh; fi ; fi)

    HOSTCC = gcc
    HOSTCXX = g++
    HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O3 -fomit-frame-pointer -pipe -march=pentium-m
    HOSTCXXFLAGS = "${CFLAGS}"
    MAKEOPTS = "-j2"

    MAKEOPTS = "-j2" spat out an error which was ignored, but compilation did not stop. I'm running the latest source kernel.

    I have to read the docs more carefully to figure out how to make this error free.

    Thanks for your help!

    ReplyDelete
  21. sudo dpkg -i linux-image-2.6.32.11+drm33.2-alpha_2.6.32.11+drm33.2-alpha-10.00.Custom_amd64.deb
    sudo dpkg -i linux-headers-2.6.32.11+drm33.2-alpha_2.6.32.11+drm33.2-alpha-10.00.Custom_amd64.deb

    Can anyone explain this? My copy is called 2.6.32.15+drm33.5-ver1 and I don't know how to run this. Each time I try I get: No such file or directory.

    ReplyDelete
  22. If you are following this guide, you need to substitute your own kernel name for that in green text.

    For example in my case the source folder in the home folder contains...


    septimus@septimus-laptop:~$ cd ~/src
    septimus@septimus-laptop:~/src$ ls
    linux-2.6.32
    linux_2.6.32-25.44.diff.gz
    linux_2.6.32-25.44.dsc
    linux_2.6.32.orig.tar.gz
    linux-2.6.36-rc5
    linux-headers-2.6.32.21+drm33.7-testing_2.6.32.21+drm33.7-testing-10.00.Custom_i386.deb
    linux-image-2.6.32.21+drm33.7-testing_2.6.32.21+drm33.7-testing-10.00.Custom_i386.deb

    My new kernel is the one with the "testing_2" in it. I will be using this name in place of the green text in the step you posted.

    ReplyDelete
  23. It is probably a good idea, once update-grub has been run (and, by the way, update-grub2 just passes everything to update-grub, so there is no difference), to also run startupmanager (from the GUI; it does not like being launched from the command line) in order to set the default boot kernel.

    startupmanager is not installed by default, so you'll need to use the Synaptic package manager to install it first.

    ReplyDelete
  24. Quick update on the difference a fast processor makes to compilation time.
    ------------------------------------------------------
    Holy hell man...I compiled the latest 2.6.36 from kernel.org and it took me only about 15 freaking minutes on my Q6700 desktop! I guess CONCURRENCY_LEVEL=5 FTW! Kick ass stuff!

    Edited the makefile to include -march=core2 -pipe.

    Note that -fomit-frame-pointer is not required for 64-bit systems.

    ReplyDelete
  25. Great tutorial! Do you have any hints on recompiling a kernel fast? It takes me 3 hours to recompile and that's making debugging take forever.

    Thanks.

    ReplyDelete
  26. Compile time really depends on your hardware. On the crap Dothan Laptop, it takes > 4 hours. On the Core2Quad it takes about 15 minutes. Not much you can do I guess. My only suggestion would be to trim all the fat when you configure the kernel.

    ReplyDelete
  27. Even if you trim as much as possible, on old hardware it will still take long. The best solution would be to compile your kernel on a more powerful system, copy it to a usb stick, then install on the older system.

    ReplyDelete
  28. Good idea.

    BTW in 10.1, there is no need for the last line in your uninstallation process. It is done automatically.

    septimus@laptop:~$ sudo dpkg -r linux-image-2.6.36-bravo
    (Reading database ... 303625 files and directories currently installed.)
    Removing linux-image-2.6.36-bravo ...
    Examining /etc/kernel/prerm.d.
    Examining /etc/kernel/postrm.d .
    run-parts: executing /etc/kernel/postrm.d/initramfs-tools 2.6.36-bravo /boot/vmlinuz-2.6.36-bravo
    update-initramfs: Deleting /boot/initrd.img-2.6.36-bravo
    run-parts: executing /etc/kernel/postrm.d/zz-update-grub 2.6.36-bravo /boot/vmlinuz-2.6.36-bravo
    Generating grub.cfg ...
    Found linux image: /boot/vmlinuz-2.6.36-rc7-alpha
    Found initrd image: /boot/initrd.img-2.6.36-rc7-alpha
    Found linux image: /boot/vmlinuz-2.6.35-22-generic
    Found initrd image: /boot/initrd.img-2.6.35-22-generic
    Found linux image: /boot/vmlinuz-2.6.32-24-generic
    Found initrd image: /boot/initrd.img-2.6.32-24-generic
    Found memtest86+ image: /boot/memtest86+.bin
    done
    septimus@laptop:~$ sudo rm /boot/initrd.img-2.6.36-bravo
    rm: cannot remove `/boot/initrd.img-2.6.36-bravo': No such file or directory

    ReplyDelete
  29. A tip:

    Don't use -O3. Use -O2 instead in your makefile. The former option seems to make my system a bit sluggish.

    ReplyDelete
  30. Hi there,
    you might like to know that here in Western Australia, the local TAFE is using this tutorial to teach ....

    Thank you, very good tutorial, error-free !!

    Cheers.

    ReplyDelete
  31. I guess that explains the 429+ visits from Australia. Thanks for the praise and interesting information.

    ReplyDelete
  32. Heh, not necessarily. I'm also from Perth, Western Australia and I came here from a link in the comments related to a sweet new patch. I think the common factor is probably that Aussies don't like to read heaps of documentation. ;)

    Very glad to hear they are teaching linux at TAFE now. It was nowhere to be seen many years back when I was studying there, all OS9 and Windows computers.

    Great article Adam

    ReplyDelete
  33. Oops forgot linkage for that comment where I found the site: http://www.phoronix.com/forums/showpost.php?p=156813&postcount=39

    ReplyDelete
  34. Excellent guide! Concise and accurate :)

    ReplyDelete
  35. I had no luck with creating the deb package using the vanilla kernel from kernel.org

    cd ~/src
    sudo dpkg -i linux-image-2.6.32.11+drm33.2-alpha_2.6.32.11+drm33.2-alpha-10.00.Custom_amd64.deb
    sudo dpkg -i linux-headers-2.6.32.11+drm33.2-alpha_2.6.32.11+drm33.2-alpha-10.00.Custom_amd64.deb

    I replaced the linux-image-2.6.32.11+drm33 with -linux-image-2.6.36 but I have no idea what the +drm33 is! What is that? Do I need it? The naming convention here is not explained and I didn't think I needed an explanation but yet everything that I tried did not work. It won't find my kernel that is right there in the home/user/src/linux-2.6.36 directory. :-(

    Any advice for a ....I'm not a NOOB because I've been compiling kernels since the 'make install' days. ;-)

    ReplyDelete
  36. As stated in the post,

    "Please note the text in green must be changed to reflect your version"

    What is the +drm33.2?

    Ubuntu's kernels by default are customized to append additional version information to their kernel, the +drm33.2 is a result of their customization.

    This is why every time you rebuild their kernel, the kernel name automatically has +drm33.2 as part of it.

    If building kernels from kernel.org, it wont have +drm33.2 appended to the kernel version.

    I therefore reiterate, you have to change the text in green to reflect your version.

    If you are not familiar with the Ubuntu way,I suggest you follow the post 100%. You will be able to relate to the post better and work a few things out for yourself.

    Then when you are confident, compile a kernel from kernel.org.

    ReplyDelete
  37. Thanks for doing this but I have only one problem, after installing the kernel, I booted into it and everything was fine except for my wireless card. There was no driver for it and the kernel couldn't see it. The wireless card still works for my older kernel. Is there anyway you could help me get it to work? Thanks. By the way its a Broadcom 802.11g Network adapter.

    ReplyDelete
  38. Following this guide will recompile your existing ubuntu kernel and unless you change the config options it will be identical.

    So the question I have for you, were you using a different kernel source eg from kernel.org?

    ReplyDelete
  39. yeah, i have a book, "Linux Kernel Development" and I tried to follow the instructions that way but then I was told it was different for each distributer so I followed this. And yes I downloaded it from kernel.org, should i remove my kernel using your instructions and restart from square 1 following your instructions. Thanks for the quick response

    ReplyDelete
  40. It is always best to use the distribution vendors instructions as oppose to generic instructions.

    I would recommend starting from square one and follow these instructions.

    If later you wish to compile a kernel from kernel.org, lets assume 2.6.37

    cd ~/src
    wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.37.tar.gz
    tar -xf linux-2.6.37.tar.gz
    cd linux-2.6.37
    make mrproper
    make menuconfig

    Proceed as described above.

    Notice the following steps have been omitted,

    apt-get source linux-image-$(uname -r)
    cd linux-2.6.32
    cp -vi /boot/config-`uname -r` .config

    The make mrproper command cleans left over files from a previous kernel compile attempt including the .config

    I hope this guides you in the right direction.

    ReplyDelete
  41. Ok, thank you very much, and just out of curiosity, why won't it work if I just download it directly from kernel.org?

    ReplyDelete
  42. Also, shouldn't I copy the config file of my other kernel so I already have that set. I got the kernel working for the way you stated above but I was just wandering if I would need to do "cp -vi /boot/config-`uname -r` .config" to copy the configuration file if I was going to install the 2.6.37 kernel. If you could answer this and the post above I'll be finished with questioning and going on, again thank you very much, its really appreciated.

    ReplyDelete
  43. wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.37.tar.gz

    This command is downloading a kernel directly from kernel.org, you can always use firefox and the gnome file browser to achieve the same result.

    So to answer your question, using a kernel source from kernel.org does work.

    cp -vi /boot/config-`uname -r` .config

    If you are running a default ubuntu 10.04 this command will copy the ubuntu kernel config to your source directory. However if the kernel source is different (eg 2.6.37 not ubuntu's 2.6.32) it will be incompatible.

    Running make menuconfig instead produces a better result.

    ReplyDelete
  44. K thanks for clearing it up

    ReplyDelete
  45. hey thanks a lot for the tutorial, all the commands worked in my machine but I am getting a kernel-panic error while booting up it says "kernel-panic not syncing:VFS:unable to mount fs on unknown block(0,0)"

    ReplyDelete
  46. This can occur when the initramfs image is not present or not in the grub file.

    Paste the contents of your /boot directory, and check that your menu.lst file has an entry corresponding to the correct initramfs image file.

    ReplyDelete
  47. Hey ! Thank you very much for the tutorial. I have an error when the linux-image file is generated : tar: crypto.master: The function stat failed: No such file or directory.
    In fact the folder src/linux-source-2.6.28.10/cryto is missing !

    What can I do ?
    Thank you :)

    ReplyDelete
  48. If you are going to use a different kernel source instead of the ubuntu 2.6.32 then do not run cp -vi /boot/config-`uname -r` .config

    Go into your kernel source directory, then type

    make mrproper
    make menuconfig

    and proceed as normal

    ReplyDelete
  49. Just a quick question, why is it when I change something in my old kernel "generic", my custom build also changes and vice versa. For example desktop background, text document changes etc. Thank you your script was very helpful!

    ReplyDelete
  50. Your desktop environment, all the settings, your documents, the desktop background are not part of the kernel.

    And the kernel is not the entire operating system, its just a small but important part of it.

    So by using a different kernel you are not using a different operating system, you are using the same operating system and this is therefore why if you set your desktop background to picture X it remains the same regardless of the kernel you are using.

    And why if you change picture X to picture Y the other kernels are affected.

    This wikipedia article may be of help,

    http://en.wikipedia.org/wiki/Operating_system#Components

    ReplyDelete
  51. Adam you are the man! Thank you! I understand!

    ReplyDelete
  52. Hey! Thanks for the post!

    I have a question before I dive into this:

    Is there a way to compile in my Broadcom and nvidia drivers?

    Basically, my reasons for wanting to do this is to get those drivers embedded deep into the kernel, and to get rid of bloat like tape drives.

    So could you show us what we would do to add these proprietary drivers to the kernel and then compile?

    Thanks!

    ReplyDelete
    Replies
    1. Hi Swift Arrow,

      Did you manage to get your Broadcom driver compiled in.
      If so, how? I am struggling with this issue on a Lenova W500.
      I don't see how the standard Lucid release works with it but a recompiled kernel does not.

      Thanks for any help
      Richard

      Delete
  53. Unless those vendors provide a kernel patch I am unaware of any other way to do this.

    Nvidia do not provide any kernel patches to achieve this, not sure on broadcom.

    I suggest going to their website and check if they have linux drivers which include such a patch.

    ReplyDelete
  54. Awesome how to on compiling a custom kernel. I was able to get my Samsung SCX-4521F printer/scanner working (the scanner half). After copying the .configure file over to ~/src, I changed the CONFIG_USB_DEVICEFS to '=Y' by editing the .config file directly. Then when compiling (after make menuconfig) I choose the alternate config file from the menu and followed the rest of the steps.
    Scanner now works great. Thanks for the empowerment lesson.

    ReplyDelete
  55. Question: When you install the custom kernel, does it replace the current kernel in the grub options, or is it added as a second kernel choice?

    Thanks.

    ReplyDelete
  56. It is added as another kernel choice.

    The only time it will replace your existing kernel is if the kernel you are attempting to install has the exact same name.

    Hence the importance of,

    --append-to-version=-some-string-here

    ReplyDelete
  57. Thank you, Adam, and thank you for this guide.

    ReplyDelete
  58. my pc freezes during the compile process :(

    ReplyDelete
  59. Compiling a kernel does stress the system, power consumption and heat will increase. If the system cant cope it will crash.

    ReplyDelete
  60. When I get to step:
    cp -vi /boot/config-'uname -r' .config
    I get this message:
    cp: cannot stat `/boot/config-': No such file or directory

    All steps prior to this worked. Any suggestions?

    ReplyDelete
  61. Heather, skip this step and continue with make menuconfig.

    It will attempt to pull in your current kernel config, manually copying the config using the cp -vi .... isnt really needed.

    ReplyDelete
  62. Hello,how does one cross-compile a 32-bit kernel in a 64-bit linux box?
    Just asking.

    ReplyDelete
  63. I have to admit this is not something I have tried before.
    The below link should point you in the right direction.

    http://kernelnewbies.org/FAQ/KernelCrossCompilation

    ReplyDelete
  64. Hi, your posts are helpful. I have some doubts. How to change a linux scheduler in order to set priority according to the user? What are the initial steps to be taken? please let me know.

    ReplyDelete
  65. If I understand your question correctly, in the kernel config options go to,

    Processor type and features --->
    Preemption Model --->

    And set the preemption model to,

    (X) Preemptible Kernel (Low-Latency Desktop)

    This will make your kernel more responsive to user events.

    ReplyDelete
  66. Thanks for your prompt reply. I need to change a linux scheduler so that processes do not get their priority dynamically changed by the kernel once set by the user. I have installed linux 2.6.32 generic version. Does your solution works for this? or do i need to make any modifications in my version?

    ReplyDelete
  67. thanus, this should be of help.

    http://www.nixtutor.com/linux/changing-priority-on-linux-processes/

    Forget my previous post, that was something else.

    ReplyDelete
  68. Thank you very much for writing this, only read the first bit on how to get the source, but it told what I needed to know :-)

    ReplyDelete
  69. Hi,
    i´m getting this output E: Unable to find a source package for linux-image-2.6.18-028stab092.1

    after this command sudo apt-get build-dep --no-install-recommends linux-image-$(uname -r)
    It´s my first time working with a kernel so i have no idea what to do. Maybe you can help me out or give me a link to solve this problem.
    Thanks for the how to.

    ReplyDelete
  70. Hello Boris, what Linux distribution are you using?

    The reason I ask is because it appears you are using kernel 2.6.18 which is not the default kernel version for Ubuntu 10.04.

    ReplyDelete
    Replies
    1. It´s an virtual Ubuntu, a preinstallation from my hoster. hosteurope.de

      Delete
    2. Because your Ubuntu is using a different kernel source, the command

      apt-get source linux-image-$(uname -r)

      will not work as it is trying to download your hoster's customized source from Ubuntu's servers. Obviously Ubuntu will not have their kernel.

      If you want to continue working on 2.6.18, contact your hoster and ask them to supply the source.

      Alternatively you could try compiling a vanilla kernel from kernel.org.

      http://linuxtweaking.blogspot.co.uk/2011/02/how-to-compile-kernel-from-kernelorg-in.html

      Delete
  71. Hi, I have a problem while i was running this command "my current kernal version is (2.6.35-22-generic). Any body can help me please...
    sudo dpkg -i linux-image-2.6.35-22+drm33.2-nasir_2.6.32.11+drm33.2-alpha-10.00.nasir.deb
    [sudo] password for nasir:
    dpkg: error processing linux-image-2.6.35-22+drm33.2-nasir_2.6.32.11+drm33.2-alpha-10.00.nasir.deb (--install):
    cannot access archive: No such file or directory
    Errors were encountered while processing:
    linux-image-2.6.35-22+drm33.2-nasir_2.6.32.11+drm33.2-alpha-10.00.nasir.deb

    ReplyDelete
  72. hi Adam,
    i have installed ELDK on windows xp having ppc 85xx processor port and now any kernel source is not compiling and installing after being configured by make menuconfig. mkinitrd is also not working. i am working for a project of RTOS. please help me..

    ReplyDelete