Comments on How To Compile A Kernel - The Ubuntu Way

How To Compile A Kernel - The Ubuntu Way Each distribution has some specific tools to build a custom kernel from the sources. This article is about compiling a kernel on Ubuntu systems. It describes how to build a custom kernel using the latest unmodified kernel sources from www.kernel.org (vanilla kernel) so that you are independent from the kernels supplied by your distribution. It also shows how to patch the kernel sources if you need features that are not in there.

16 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By:

It is absolutely unneccessary to allow root logins by setting a root password in the first step. You can get a root shell without adding insecurity to your system by typing  "sudo bash" or "sudo -i".

By:

As another option - if you want to work fully as root without any lingering settings from your user account, use the following:

sudo su - 

This will give you a "pure" root login with no root password or other changes required from the default Ubuntu setup. 

By: meavaiua

Exactly. You should NEVER EVER create a root login. There is a good reason why this is disabled by default. So just don't. Use sudo su instead.

By: Vladimir

Why

sudo su -

Isn't

sudo -i

enough?

By:

Thank you for this How To.  It helped a lot when I was patching the kernel with the Web100 patch to set up an NDT (Network Diagnostic Tool) server.

By:

Yeah same thing here, great article. I've been wanting to set up an NDT too for a while, so i used it for help with patching.

Dream your life or live your dreams?

 | ramen noodle |

By:

As a newb, when I did the following:

apt-get install kernel-package libncurses5-dev fakeroot wget bzip2

neither package could be located.  After much searching, I figured out because I installed Ubuntu while offline, the Ubuntu setup commented out all the entries in source.list which meant apt-get would always fail.  If any other beginners hit this you can find source.list in /etc/apt/.   If you don't successfully complete this step, you'll no it when make menuconfig fails gloriously.

Thanks, qhawk 

By:

Both Ubuntu and Gentoo obviously have their strength and weaknesses, both will have a place in the Linux world for the foreseeable future and both groups of users need to recognise that. If people were willing to experiment a bit more and use the right tool for the right job, I think there would be a lot less 'fanboyism' and many people would find themselves being a lot more productive. I use Gentoo and Ubuntu, and think it's one of the great advantages of Linux world that I'm not forced to conform with my OS, but can use variants or even make my own if I see the need. Grow up, guys. Oh, and it's better to use 'sudo -s' than set up su, since the latter isn't officially supported or tested and they have the exact same effect.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | don't buy World of Warcraft Gold, make'em. | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

By: Anonymous
By: Anonymous

From the link above...

"Not that I recommend dispensing with a user account, but I have no user account even on my Ubuntu system."

This guy is an arrogant ignorant (which is the worst combination, ever).

Even distributions with root active (I used to use mandrake 12 years ago) discourage users from running everything as root because it is dangerous. Mandrake had a big warning and a red background whenever running X as root. If you run firefox as root on a regular basis you might get bad surprises, from all the kind of scripts that get executred. I am not one of these no-root paranoid. I am not scared of knives but I do not walk with a knife pointing at my chest on a crowded subway train.

 What I find unacceptable is that this guy is ignorant, has bad practices, dispenses bad suggestion, and does it with so much arrogance. No way!

By: raju

I have compile linux kernel version 2.6.28 , when i see the " .ko " files after the kernel was compiled the size of the ".ko"  file is very large compared files created from the installation by cd . Is their any way to reduce the size .

I assume it has to do with the dependency  Cd installation manages this dependency than when we compile the kernel . Is there a way to reduce the the size of the kernel object files ? .

By: Manuel Schmitt

Howto to compile kernel from scratch in German:

Linux Kernel neu bauen/nachbauen/compilieren (aus Vanilla-Sourcen)

By: tn

Iam stuck on Step 7. Error is as follows: 

dpkg: error processing archive linux-image-2.6.18.1-custom_2.6.18.1-custom-10.00.Custom_i386.deb (--install):

 cannot access archive: No such file or directory

Errors were encountered while processing:

 linux-image-2.6.18.1-custom_2.6.18.1-custom-10.00.Custom_i386.deb

 

By: Raja

I could not find menu.lst in /boot/grub

I am in ubuntu 10.XX with kernel 2.6.32-38-generic

I tried to install kernel 2.6.30.10 for some reason, everything worked fine till installing .deb files

only thing I could not find thsi menu.lst

When I restarted I do not get any option to select other kernel, i am back into the old kernel (2.6.32-38-generic)

Please help me..

By: Will Leverone

Thanks, this guide helped me a lot.

By: ActionParsnip

Could just leave the root account alone (As Ubuntu is designed to be used) and run:

sudo su -

You are now root and the root account itself is disabled for actual login. Much betterr and more secure.