# To genkernel or NOT to genkernel?

## dhewton

Good morning Friends,

I was wondering if anyone could offer me insight into the merits of compiling kernels with genkernel as opposed to manually.

I have used genkernel ever since I discovered Gentoo, BUT, am I denying myself performance by taking the simpler route?

Is there a difference in the final kernel when you do it either way?

Thanks

Dan

----------

## Drunkula

The only time I would use genkernel is if I am on a computer with unknown hardware.  It works okay but since it compiles everything (modules or otherwise whether you need it not) it takes longer to compile.  Also the bootloader setup is a little more complicated.

Personally I much prefer a manually compiled kernel.  I would say give it a shot but don't nuke your existing kernel just in case.  Just build the manual kernel and update your boot loader with an additional menu item.

----------

## dhewton

Ok, well here is the thing.  I used genkernel for simplicity.  I do like to learn new things though.  

I don't how to build a kernel manually, can you point me to the "compile a kernel for dummie's" page.

Will this mean the kernel is smaller?

Will there be any difference from a performance standpoint?

Thanks

Dan

----------

## Pablo_Escobar

You must know what You can cut out, what to compile as a module, and what to leave as compiled in.

It takes some thinking, reading when compiling it for the first time, but then it's downhill  :Smile: 

http://gentoo-wiki.com/HOWTO_Install_Gentoo_Linux:_Kernel

http://www.gentoo.org/doc/en/kernel-upgrade.xml

----------

## dhewton

Haven't I already made those choices when I used the --gconfig command in genkernel.  I speant ALLOT of time reading and choosing.  Can't I use the .config file I am already using as it is the fruit of all my previous reading and choosing?

Thanks

Dan

----------

## sternklang

There's nothing keeping you from using your current .config as a base. But if you step through the various kernel options, you'll probably find a lot of stuff is being compiled in despite not being used. Making the kernel smaller, and offloading things you only need occaisionally into modules, will reduce kernelspace memory use, which will increase memory available for everything else.

As you read about this, you'll also find things you can select in your kernel setup that will give you better desktop performance. I've never used genkernel, but from what I understand you are getting "generic" settings that are a good balance between desktop and server oriented performance. If you change those settings for the best desktop performance, you will get a noticable increase in speed.

In general, since you are just starting out with manual config, you should change just a couple of things at a time, test it out, then decide whether or not to keep the changes. You should also add the new kernel as a grub menu choice without gettting rid of your working kernel so you can recover from breakage.   :Wink:   Finally, check out  sys-kernel/module-rebuild -- once you set it up, this script will automatically update any kernel modules outside of the kernel tree (such as NVidia/ATI binary drivers) to match your new kernel.

----------

## limn

genkernel is a convenient tool for automating the kernel configuration, build, and install process, with logging to /var/log  and config backup to /etc/kernels. Using it does not prevent you from configuring the kernel in any way you want.

----------

## troymc

 *limn wrote:*   

> genkernel is a convenient tool for automating the kernel configuration, build, and install process, with logging to /var/log  and config backup to /etc/kernels. Using it does not prevent you from configuring the kernel in any way you want.

 

Exactly. You can customize a kernel just as much with genkernel as you can manually.  If you are using --gconfig and have customized your kernel by removing unecessary drivers/options and including your hardware specific drivers, then you are as optimized as anyone who does it manually.

That being said, I personally never use genkernel. I've always hand-built my kernels, and am very comfortable with the kernels built in process [ make mrproper --> make install ].

The only area that might be left open for optimization would be your initrd if you are using one. I've never studied how genkernel makes its initrds, but since I custom make mine, my system boots pretty fast. (well, no wasted time in that portion at least) But do note that boot time is the only time you would notice this.

troymc

----------

## dhewton

Ah, I think I am seeing something new.

I must clarify that I have ALWAYS used --gconfig or --xconfig.  I have never just let genkernel do its thing automatically.  In fact, till this moment, I did not even know you COULD do that.

SO, does that REALLY mean that IF I use --gconfig (or other) and pick and choose what I want, I am JUST AS optimized as a manual person?

I am very comfortable using genkernel and all the switches it has, so unless I want to learn how to do it manually for some reason, there is no advantage to do the manual way.  I am never going to use anything but Gentoo (cuz it rocks) so genkernel will always exist.

Thoughts anyone?

Dan

----------

## sundialsvc4

Let genkernel have the first pass, on new hardware.  Then look at the config (after saving a backup copy) and see what you can edit or omit.

For example, I want my kernels to contain all of the device-support needed by my hardware, and nothing more.  I want to be able to boot without relying upon an initial-RAMdisk, and I don't want to compile hundreds of modules that I'll never need.  (If I buy a DecSystem model BR-549 token-ring adapter, then I'll add support for it.)  I don't need support for gigabytes of RAM because I don't have that.  And so-on.

I think it's very important that you become very familiar with the kernel-generation process.  Really, it's not hard to do at all, but it is scary the first few times.  You need to get beyond that.

----------

## limn

 *dhewton wrote:*   

> I am JUST AS optimized as a manual person?

 

In the population of manual persons, and otherwise, you are just as optimized, or not.

The sensitivity police may be by to discuss how you categorize people.

----------

## dhewton

My humblest apologies good sir.  I pray my inclusionary comments dost not enflame thee.

Dan

----------

## dhewton

Ok, this is hilarious:  I went to recompile using the "make smaller" option and removed a few other unused things and got nothing but hideous errors using genkernel.  I have no idea why.

I decided just for fun to try it manually, followed the instructions in the handbook, and I can't believe it.  I remember learning how to compile kernels in Red Hat 5.0.  It seemed WAY more complicated.  NOW it seems there is only a few commands, a copy here, an edit there, then presto!!

It was SO easy to manually make my kernel.

So, new question:

How do I make it so the kernel has a custom name? I am vain and like to put my name on stuff!    :Wink: 

Thanks

Dan

----------

## troymc

 *dhewton wrote:*   

> 
> 
> How do I make it so the kernel has a custom name? I am vain and like to put my name on stuff!   
> 
> 

 

The kernel comes complete with a built in vanity option:

```

General Setup --->

    (-v1) Local version - append to kernel release

```

Whatever you put here will be appended to the kernel version. I'm pretty boring so I just stick with -v1 version #s.

When built you get a kernel named like this:

```

# uname -r

2.6.15-gentoo-r1-v1

```

See that -v1 at the end there?  That could be YOUR name!

troymc

----------

## dhewton

Now I am playing with POWER.  Now if I could just get this pesky "DELL" off my notebook and my name on it in its place, well, then I would REALLY be living.

Dan

----------

## sternklang

 *dhewton wrote:*   

> Now if I could just get this pesky "DELL" off my notebook and my name on it in its place, well, then I would REALLY be living.

 

Have you considered changing your name to Dell?   :Smile: 

----------

## dhewton

You know, you always get more than what you ask for here in the Gentoo forums.

Thanks so much.  From now on I shall be known as "Dell,  maker of custom kernels and purveyor of thoughts eternal".

Dan

----------

## troymc

hmmm.....

Dan Hewton

Dell Hewton

Dan "Dell" Hewton

Dan "The Dell" Hewton

Doesn't have too bad a ring to it....     :Very Happy: 

Maybe it'll get you a job down in Austin...

troymc

----------

## dhewton

Would it really freak you out if I told you my middle name was Michael?

Dell

----------

## troymc

yes!

troymc      :Wink: 

----------

## dhewton

 *sundialsvc4 wrote:*   

> Let genkernel have the first pass, on new hardware.  Then look at the config (after saving a backup copy) and see what you can edit or omit.
> 
> 

 

Ok, I have been successfully using manually made kernels for a week or so now, but when I was reviewing this thread, your comment above stuck out:

Are you suggesting let genkernel do its thing with NO -gconfig, with the objective of discovering what hardware and its optimum settings would be?  Following that, would be a manually made kernel with all the unneccesary stuff removed?  (this is ideally what I would like anyway)

I don't know what I don't know, so can I use genkernel to possibly unearth some of those things I don't know that I don't know?

Thanks

Dan

----------

