Kernel compilation (2.6 version)

Compiling custom kernel has its own advantages and disadvantages. However, new Linux user / admin find it difficult to compile Linux kernel. Compiling kernel needs to understand few things and then just type couple of commands. This step by step howto covers compiling Linux kernel version 2.6.xx under RPM (Fedora ) GNU Linux. However, instructions remains the same for any other distribution except for yum/apt-get command.

Step # 1 Get Latest Linux kernel code

Visit http://kernel.org/ and download the latest source code. File name would be linux-x.y.z.tar.bz2, where x.y.z is actual version number. For example file inux-2.6.35.tar.bz2 represents 2.6.35 kernel version. Use wget command to download kernel source code:
$ cd /tmp
$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-x.y.z.tar.bz2

Note: Replace x.y.z with actual version number.

Step # 2 Extract tar (.tar.bz or .tar.bz2) file

Type the following command:
# tar -xjvf linux-2.6.35.tar.bz2 -C /usr/src
# cd /usr/src

Step # 3 Configure kernel

Before you configure kernel make sure you have development tools (gcc compilers and related tools) are installed on your system. If gcc compiler and tools are not installed then use apt-get command under Debian Linux to install development tools.
# apt-get install gcc  (ubuntu users)

# yum groupinstall 'Development Tools'  (fedora users)

Now you can start kernel configuration by typing any one of the command:

  • $ make menuconfig – Text based color menus, radiolists & dialogs. This option also useful on remote server if you wanna compile kernel remotely.
  • $ make xconfig – X windows (Qt) based configuration tool, works best under KDE desktop
  • $ make gconfig – X windows (Gtk) based configuration tool, works best under Gnome Dekstop.

For example make menuconfig command launches following screen:
$ make menuconfig

You have to select different options as per your need. Each configuration option has HELP button associated with it so select help button to get help.

Step # 4 Compile kernel

Start compiling to create a compressed kernel image, enter:
$ make
Start compiling to kernel modules:
$ make modules

Install kernel modules (become a root user, use su command):
$ su -
# make modules_install

Step # 5 Install kernel

So far we have compiled kernel and installed kernel modules. It is time to install kernel itself.
# make install

It will install three files into /boot directory as well as modification to your kernel grub configuration file:

  • System.map-2.6.35
  • config-2.6.35
  • vmlinuz-2.6.35

Step # 6: Create an initrd image

Type the following command at a shell prompt:
# cd /boot
# mkinitrd -o initrd.img-2.6.35 2.6.35

initrd images contains device driver which needed to load rest of the operating system later on. Not all computer requires initrd, but it is safe to create one.

Step # 7 Modify Grub configuration file – /boot/grub/menu.lst

(only for ubuntu users)

Open file using vi:
# vi /boot/grub/menu.lst

title           ubuntu (2.6.35.fc14.i686)
root            (hd0,0)
kernel          /boot/vmlinuz root=/dev/hdb1 ro
initrd          /boot/initrd.img-2.6.35
savedefault
boot

Remember to setup correct root=/dev/hdXX device. Save and close the file. If you think editing and writing all lines by hand is too much for you, try out update-grub command to update the lines for each kernel in /boot/grub/menu.lst file. Just type the command:
# update-grub
Neat. Huh?

Step # 8 : Reboot computer and boot into your new kernel

Just issue reboot command:
# reboot

Advertisements
    • debashish samantaray
    • December 1st, 2010

    very very helpful.

    bravo

  1. cool

  2. Hey, I am checking this blog using the phone and this appears to be kind of odd. Thought you’d wish to know. This is a great write-up nevertheless, did not mess that up.

    – David

  3. I can see you’re an expert at your field! I am launching a internet site soon, and your information will likely be quite intriguing for me.. Thanks for all your assist and wishing you all of the success.

  4. I loved as much as you’ll receive carried out right here. The sketch is attractive, your authored material stylish. nonetheless, you command get got an shakiness over that you wish be delivering the following. unwell unquestionably come further formerly again as exactly the same nearly a lot often inside case you shield this increase.

  5. I’m not sure why but this blog is loading very slow for me. Is anyone else having this issue or is it a issue on my end? I’ll check back later on and see if the problem still exists.

  6. The heart of the wise man lies quiet like limpid water.

  7. Hey!I’ve subscribed a few days ago to your RSS and now I’ve decided to post your blog on my website couse I truly belive that my readers will find your blog as interest as I did. Here is the link to your blog: http://meandbreastactives.com/ .Please DO comment on my blog if you feel interensting. Regards, Al

  8. With every little thing that seems to be developing throughout this specific subject matter, many of your points of view are generally quite exciting. Nevertheless, I appologize, but I do not give credence to your whole idea, all be it radical none the less. It would seem to everybody that your comments are actually not totally justified and in reality you are your self not wholly certain of the argument. In any event I did enjoy reading it.

  9. Its like you read my mind! You seem to know a lot about this, like you wrote the book in it or something. I think that you could do with some pics to drive the message home a little bit, but instead of that, this is great blog. A great read. I will definitely be back.

  10. I wanted to visit and allow you to know how , very much I valued discovering your web site today. We would consider it a honor to do things at my business office and be able to utilize the tips shared on your site and also be a part of visitors’ comments like this. Should a position involving guest publisher become on offer at your end, please let me know.

      • Sandipan Patra
      • February 22nd, 2011

      ya ya sure..
      that would be my pleasure..

      anyway thanks a lot..

  11. I have been surfing online more than three hours today, yet I never found any interesting article like yours. It’s pretty worth enough for me. Personally, if all site owners and bloggers made good content as you did, the internet will be much more useful than ever before.

  12. Wow, superb blog layout! How long have you been blogging for? you make blogging look easy. The overall look of your web site is fantastic, as well as the content!

  13. Fantastic goods from you, man. I’ve understand your stuff previous to and you are just extremely magnificent. I really like what you’ve acquired here, certainly like what you’re stating and the way in which you say it. You make it enjoyable and you still care for to keep it wise. I can’t wait to read much more from you. This is really a wonderful site.

  14. I definitely enjoyed reading through this article.Thanks.

  15. How do you make your blog look this sick!? Email me if you get the chance and share your wisdom. I’d be appreciative!

  16. I wished to thanks for this nice read!! I definitely having fun with each little bit of it I’ve you bookmarked to take a look at new stuff you post.

  17. There should not many websites with info like this man! Bookmarked!

  18. Thanks for the good blog. It was very useful for me. Keep sharing such ideas in the future as well. This was really what I was in search of, and I am glad to got here right here! Thanks for sharing the such info with us.

  19. We are a group of volunteers and opening a new scheme in our community. Your web site provided us with valuable info to work on. You have done an impressive job and our whole community will be grateful to you.

  20. Thank you on your assist!

  21. You actually talked about quite a few curious points here. I found it by using Google and I must confess that I am now subscribed for your site, it is quite decent (;

  22. Wow, fantastic blog layout! How long have you been blogging for? you made blogging look easy. The overall look of your website is wonderful, as well as the content!

  23. Man I definetly love your write-up and it has been so commendable so I am surely going to bookmark it. I Have to say the exceptional research you have done is greatly exceptional !!! Who goes that extra mile these days? Bravo !!! Just one more tip you canget some Translator Application for your Global Audience !!!

  24. Hey I absolutely love your article and it was so admirable thus I am gonna save it. I Have to say the Wonderful analysis you have done is trully exceptional ! No one goes that extra mile now days? Well Done . Just one more tip to you is that you definetlyset up some Translator for your Global Audience .

  25. Terrific piece of writing we need to spread the word about this website.You need to have far more attention .

  26. Not necessarily the quickest site to load nevertheless I’m happy I waited. Having searched many of the evening due to this form of material I finally thought it was on the blog. One happy subscriber below!

  27. After study a few of the weblog posts in your website now, and I really like your way of blogging. I bookmarked it to my bookmark web site listing and will be checking back soon. Pls try my site as nicely and let me know what you think.

  28. great info, thanks

  29. One thing is that one of the most frequent incentives for utilizing your credit cards is a cash-back or maybe rebate supply. Generally, you will get 1-5% back upon various expenditures. Depending on the card, you may get 1% again on most expenses, and 5% again on purchases made going to convenience stores, gasoline stations, grocery stores and also ‘member merchants’.

  30. Fantastic post, I should really start blogging too.

    Ralph Laren

  31. I’m impressed, I must say. Actually rarely do I encounter a blog that’s each educative and entertaining, and let me tell you, you will have hit the nail on the head. Your concept is outstanding; the difficulty is one thing that not enough individuals are speaking intelligently about. I am very joyful that I stumbled across this in my seek for something referring to this.

  32. I am glad to be one of many visitants on this great site (:, thankyou for posting .

  33. This is very interesting post. I really liked it. Please keep posting such an informative post

  34. I found your blog web site on google and test just a few of your early posts. Proceed to maintain up the superb operate. I simply extra up your RSS feed to my MSN News Reader. In search of forward to reading more from you afterward!…

  35. I am extremely new at all to the internet and needed to review this subject. Thought it had been a fantastic article well written and helpful. I am going to definitely be going back to your internet site to read more articles when i loved that one..

  36. I must show my appreciation to you for rescuing me from this particular difficulty. Right after checking through the world-wide-web and obtaining ideas which were not pleasant, I assumed my life was well over. Existing devoid of the answers to the issues you’ve fixed by means of this blog post is a crucial case, and those that would have adversely damaged my entire career if I had not come across your blog post. Your own expertise and kindness in controlling every aspect was crucial. I am not sure what I would’ve done if I had not discovered such a stuff like this. It’s possible to at this point look forward to my future. Thanks for your time very much for the specialized and sensible help. I will not hesitate to recommend your blog to any individual who wants and needs counselling on this situation.

  37. I really liked your amazing article. Be sure to keep it up. Greets !!

  38. Due to reading your website, I decided to write my very own. Id never been contemplating keeping a blog until I saw how fun yours was, however was inspired!

  39. Wonderful website you have made here, great topic and its definitely something many people would really like talking about Im sure many other people trust me, so continue posting! haha

  40. Would likely want to express your article is stunning. The clarity within the post is merely impressive and that i will take like a given you could be an expert with this field. Well effortlessly your permission i must grab your feed to maintain at the time of yet with succeeding post. Thanks several and please continue the sound work.

  41. I was wondering if you ever considered changing the layout of one’s blog? Its very well written. I enjoy what youve have got to say. But you may could a tad bit more in the way of content so people could connect with it better. Youve got an awful lot of text for just having a couple of images. You may could space it better?

  42. You sure do understand what youre talking about. Man, this website is just great! I cant wait to see more of what youve have got to say. Im really happy that I found this when I did because I used to be really starting to get bored with the whole blogging scene. Youve turned me around, man!

  43. Thank you for sharing excellent information. Your web site is very cool. I’m impressed by the details that you’ve on this web site. It reveals how nicely you understand this subject. Bookmarked this website page, will come back for extra articles.

  44. Hi, this is truly a magnificent article, and I enjoy your perspective. I will certainly credit this article in my next post.

  45. F*ckin’ amazing things here. I am very glad to peer your article. Thanks so much and i am looking ahead to contact you. Will you kindly drop me a mail?

  46. Just the other evening I actually was speaking of all of this and i also was in fact suggesting to my girly friend that I’d personally gather more information about it all. Would you happen to own any sort of other kinds of articles . as regards to that? That I could show to him?

  47. I ran across this kind of becoming an informational message and also thrilling, i seriously really feel which is fairly valuable and proficient for me personally. I would like to we appreciate you the actual initiatives they’ve built to write this specific fantastic document. When doable, although you acquire experience, do you brain modernizing your weblog with increased facts? It is actually rather valuable for me.

  48. I’m really impressed with your writing skills as well as with the layout on your weblog. Is this a paid theme or did you modify it yourself? Anyway keep up the excellent quality writing, it’s rare to see a great blog like this one today..

  49. Hello, i found your website because a friend of mine knows it, i love it can you whrite more articles please 🙂

  50. But I am sure that your good job is clearly identified. I was thinking if you offer your RSS feeds as I would be very interested but i cant find any link to join here.Where is it?

  51. Very good reading. I recommend this article to my facebook contacts. Hope to see you read.

  52. Good, amusing post. A big part of internet surfers don’t think that every site must have comments section. But I consider that follower comments specify a blog. Briefly thank you very much for letting people commenting on this well prepared blog.

  53. hello!,I like your writing very a lot! share we communicate extra about your post on AOL? I need an expert on this space to resolve my problem. May be that is you! Taking a look forward to see you.

  54. Absolutely composed subject material, thanks for information. “You can do very little with faith, but you can do nothing without it.” by Samuel Butler.

  55. It had been some time since I visited website with such high quality information. Thansk so much for the useful info

  56. Whats Going down i am new to this, I stumbled upon this I’ve discovered It absolutely useful and it has aided me out loads. I’m hoping to contribute & help different customers like its helped me. Great job.

  57. I constantly spent my half an hour to read this website’s posts everyday along with a mug of coffee.

  58. I gotta bookmark this internet website it seems extremely valuable invaluable.

  59. hey,do you need some cheap envelopes to write to your friends?

  60. Have you ever wondered how you could help those who are less fortunate than you?

  61. Great blog you have here, hope you won’t mind if I retweet your blog posts to my twitter’s account.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: