# Genkernel: Love or hate it?

## richard.scott

Hi,

I've been using Gentoo since 2003 and I've always used Genkernel to build my kernels/initrd files with.

I'm interested to know what peoples reasons for not using Genkernel. I've heard that its because you want to get a lean, small and fast kernel. Trouble is, I have no idea what is classed as a small kernel?

Without really trying I've got my Genkernel build kernel down to 1.9MB... is that small?

Any feedback on reasons why you choose not to use Genkernel would be interesting.

Thanks,

Rich.

----------

## danomac

When building an initrd, it's so damn easy. I love it, I just have it pop up menuconfig so I can remove stuff that my hardware doesn't need. I typically don't use genkernel when I don't need an initrd; I see no reason to. You can still wind up with a tweaked kernel no matter which you choose.

----------

## szczerb

I never had a reason to use Genkernel - so I haven't actually seen it yet ;]

And I seriously don't like modules. You have to load them....  :Very Happy: 

----------

## Gankfest

never used it, always went the manual config way; it's funner that way! I'd probably hate it though because it is the easy way out, and I'm always down for a challenge.

----------

## mikegpitt

I use both genkernel and manual compilation depending on the machine.  Personally I love genkernel when I need it.

----------

## gringo

i have never used genkernel, so that i really cannot hate or love it. 

 *Quote:*   

> I've heard that its because you want to get a lean, small and fast kernel. 

 

smaller, probably, but not faster. 

I´d love to see some numbers from those claiming a manually compiled kernel is faster than one generated by genkernel.

Stay with the solution that works for you, i really think it is that simple.

 *Quote:*   

> Without really trying I've got my Genkernel build kernel down to 1.9MB... is that small? 

 

not that bad but it surely could be trimmed down even more. The most tiny 2.6 kernel i have been able to get for x86 was around 600 kbs or sth. like that IIRC. Of course with almost everything modularized.

Kernel 2.6 images have never been space efficient btw, they are huge. If you have a look to embedded world ( and not so embedded) , most are still running 2.4 kernels because of this.

cheers

----------

## d2_racing

Hi, I don't like Initrd and also, I don't like to have 350 network card module when I know that my lan card needs the module e1000e.

So, that's why I will never use Genkernel  :Razz: 

----------

## richard.scott

I guess that's where a little knowledge about Genkernel comes in handy as you can have a much or as little configured as a module (or staticly) in genkernel.  You still get the same "make menuconfig" interface as you get with any kernel build.

You don't have to create an initrd file and being totally honest, I never used to like having an initrd file until I found out how useful they are for PXE, USB or LiveCD booting.

I'm interested to find out if anyone can name a specific feature that you can only do when making your own initrd file that genkernel can't already do?

----------

## nativemad

I love it!   :Razz: 

I'm using some "strange" bootup-methods like a squash-root on NFS, CD, USB or even FTP! 

It is quite easy to understand by just reading the code... therefore you can do whatever you like, before the actual root-fs gets mounted!  :Wink: 

Don't get me wrong, i also have systems without initramfs, if i the bootup-speed is important... On the other hand i also like it to have a little env to troubleshoot, if on a normal system the root-partition cant be mounted somehow!   :Razz: 

I also see that there are different goals for using it... Some people simply want to avoid the manual config, others use explicitly "genkernel --menuconfig"!

It's more or less that genkernel has a default full-blown config, while the manual "make menuconfig" has a default minimal config. 

But both can be tweaked like the other... you can even use a genkernel initrd with a "manually compiled kernel" or a genkernel-kernel without initramfs!   :Razz: 

----------

## 165177

 *richard.scott wrote:*   

> I'm interested to find out if anyone can name a specific feature that you can only do when making your own initrd file that genkernel can't already do?

 

Last time I looked, genkernel didn't support "sys-power/suspend" and genkernel developers seemed unwilling to implement support.

----------

## doctork

I think the question might better be phrased

 *Quote:*   

> Genkernel -- Love it?  Hate it?  Could not care less!

 

--

doc

----------

## richard.scott

 *doctork wrote:*   

> I think the question might better be phrased
> 
>  *Quote:*   Genkernel -- Love it?  Hate it?  Could not care less! 
> 
> --
> ...

 

<whistling> there's always one   :Laughing: 

I'm just asking the question as to why people feel its easier not to use genkernel and what advantages not using it brings to the party.

----------

## danomac

 *d2_racing wrote:*   

> Hi, I don't like Initrd and also, I don't like to have 350 network card module when I know that my lan card needs the module e1000e.
> 
> So, that's why I will never use Genkernel 

 

You can configure genkernel to pop up menuconfig so you can remove the hardware you don't need. It's really no different than one of the *-sources packages. OTOH, it easily creates initrd images (if you need them.) It does other stuff too, but I haven't tried any of that.

I basically only use genkernel when I need an initrd. Making one of those by hand is a PITA.

----------

## mikegpitt

 *danomac wrote:*   

> 
> 
> I basically only use genkernel when I need an initrd. Making one of those by hand is a PITA.

 ++ on this comment.  Even if you need a custom initramfs, the one generated by genkernel is a great place to start.  Unpack and edit.  There is a great script here on the forums called convinitrd that handles the unpacking and repacking of initrd's nicely.

----------

## doctork

Richard.Scott says:

 *Quote:*   

> I'm just asking the question as to why people feel its easier not to use genkernel and what advantages not using it brings to the party.

 

I guess it's because I'm a cranky old man who's been configuring kernels since sometime in the 1990s.  Anyone remember Caldera?  I think that's where I started.  I don't think that there's any advantage to NOT using genkernel -- neither do I think that using it would offer any advantage to me.

--

doc

----------

## madisonicus

 *richard.scott wrote:*   

> I'm interested to find out if anyone can name a specific feature that you can only do when making your own initrd file that genkernel can't already do?

 

On my laptop, I use cryptsetup-luks to encrypt everything except the boot partition which I place on a usb flash drive.  Doing this requires an initrd that's a pain to make, unless I use genkernel:

```
genkernel –luks –kernel-config=custom_kernel.conf all
```

The -kernel-config switch lets me do the same menuconfig that I do with all my other boxen, so the only thing that differs from normal in my laptop's kernel creation process is that I use the genkernel package to create the initrd.

-m

----------

## milomak

 *d2_racing wrote:*   

> Hi, I don't like Initrd and also, I don't like to have 350 network card module when I know that my lan card needs the module e1000e.
> 
> So, that's why I will never use Genkernel 

 

can you not run genkernel to use menuconfig so that you can customise your kernel?

----------

## richard.scott

 *milomak wrote:*   

> can you not run genkernel to use menuconfig so that you can customise your kernel?

 

Yes it comes with a "--menuconfig" option to bring up the exact same menu that comes with the kernel source.

----------

## danomac

 *milomak wrote:*   

>  *d2_racing wrote:*   Hi, I don't like Initrd and also, I don't like to have 350 network card module when I know that my lan card needs the module e1000e.
> 
> So, that's why I will never use Genkernel  
> 
> can you not run genkernel to use menuconfig so that you can customise your kernel?

 

Yes, I mentioned that in my first post, although I didn't say how to do it.

----------

## milomak

so given customisation is possible with genkernel, what benefits are thre from a manual config?

----------

## LoSeR_5150

Nothing.... other than the joy of being a masochist ... personally I use genkernel to create my initrd for my dmraid setup... other than that I dont have any use for it.  But I have had to create my initrd by hand for my dmraid, and it was a pain. so another + for genkernel.

----------

## rafo

I am typing this on a Gentoo laptop which has an encrypted internal hard drive with WIndows Vista. The Vista installation is only for company work and it is just plainly no fun. So the other day I got a 250 GB external USB hard disk and put Gentoo on it.

For the kernel I used genkernel because it Just Worked. Well, almost ... I had to add a scandelay kernel parameter in grub.conf.

Before that I also tried manual kernel configuration; it worked partially: the kernel started executing but it failed to access the root partition. Perhaps it was only a matter of adding a "rootdelay" kernel parameter (I learmed about that parameter when I already had the genkernel configuration going).

Or I maybe wrong .. maybe an initrd is required when all Gentoo partitions are on an external USB drive?

----------

## rafo

Speaking of genkernel, there is a Gentoo guide: http://www.gentoo.org/doc/en/genkernel.xml. Usually this is a kind of quality certificate: if there is a Gentoo guide then the documented artifact is definitely useful. However, this particular guide says "Disclaimer: This document is not valid and is not maintained anymore".

Does anyone knows why this is? Just a matter of lacking resources? Seems a pity since genkernel is definitely being used.

----------

## purak

If you need initramfs, genkernel is the best opinion. But I generally don't need initramfs and prefer to manualy compiled kernel

----------

## d2_racing

 *purak wrote:*   

> If you need initramfs, genkernel is the best opinion. But I generally don't need initramfs and prefer to manualy compiled kernel

 

Me too   :Razz: 

----------

## Suicidal

 *milomak wrote:*   

> so given customisation is possible with genkernel, what benefits are thre from a manual config?

 

Manually copying bzImage?

I have done it several ways, genkernel usually has a good basic config as does /proc/config.gz on the livecd.

I have used genkernel, my own script, manual and now I use my own script to invoke genkernel.

----------

## Acron_0248

I think is a matter of taste, knowledge and what better suites you 

As have been already said, not necessarily using genkernel will generate lot of modules you'll never use, it depends, if you pass --menuconfig and choose the modules you need, then it will be the same amount of modules you'll get by using make menuconfig or something else.

Regarding size, to me is relative, if you compile everything you need as built in, then the kernel image (bzimage) will have some size that might be big (depending on what you choose), on the other hand, if you choose to compile a lot of things as modules and use an initramfs, then whatever you've saved from the bzimage regarding size will be occupied by the initramfs, so in the end, it will be practically the same thing.

Finally, if you know how to make a initrd file then genkernel won't be necessary, if you don't, genkernel can be a lot of help

Genkernel automatizes several process and that's all about it, there's nothing you can do using genkernel that you couldn't do without it, so beyond that automatic process there's nothing good or bad

----------

## rafo

Quoting purak:  *Quote:*   

> If you need initramfs, genkernel is the best opinion. 

 

The questions for me was, how do I know if I need initramfs?

I seem to remember that the classical example where initramfs is needed is a system with SCSI disks. But there may be other configurations besides that? For example, what about booting from an external hard disk connected via a USB cable?

Just a thought, perhaps the Gentoo Handbook should provide some guidance here? If there are configurations where initramfs is known to be needed then it is a waste if people try to do a manual kernel configuration with no initramfs.

----------

## d2_racing

For what I remember, you need initramfs if you want to have a gensplash when you boot.

----------

## MaximeG

Hi,

I try not to use Genkernel, merely to keep control on what I'm doing.

Here I had to use it to get initramfs dmraid.

However, not sure aif it's 100% related to my initramfs, but my boot time is much slower since I use it.

Old computer without raid/initramfs : 3secs of boot time (before openRC)

New computer with raid/initramfs : 20secs of boot time (before openRC)

Regards,

Maxime

----------

## poly_poly-man

if yo need a kernel that works well on every hardware, genkernel is good (but at that point... binary distro?)

The problem with genkernel is that newcomers to the distro cling to it thinking that it would make their lives easier because they wouldn't have to play with kernels. 

It invariably makes a user's life harder. They *will* run into problems, whether caused specifically by genkernel, or just problems with the kernel in general. At that point, they come asking for help, and instead of being easy to work with (I expect people on fgo to understand basic kernel-related instructions, like pastebin your config, and enable this option in-kernel or as modules - and to understand the basics of stuff like module loading.)

FOr users who used the handbook and configured the kernel, they all know what to do. But genkernel users tend to have no idea.

genkernel also seems to like to make its own problems... hard to explain.

I do realize that there are people (like me, my first few months of gentoo) that just use genkernel to build the kernels (still do configs themselves)... this, as I learned, is pointless. The manual steps are easy, and you take out the genkernel variable in your debugging.

grr...

----------

## depontius

I use genkernel, but manually manage my own kernel configs.  In /usr/src I have files like 20090501.config, which was a "SaveAs" of my latest kernel build.  Next time I use genkernel I'll load that config, do the necessary tweaks, and save it again with the appropriate date stamp.  For me genkernel is just a kernel build simplification, letting me do all of my work at xconfig or menuconfig, and some time later it's all done.  I don't have to do multiple steps with waits in-between, in which case I'd likely forget, and by the time I got back to kernel-n, kernel-n+1 would probably be out.

----------

## NathanZachary

I personally haven't used genkernel before, so I can't offer an unbiased opinion.  However, I like to build my kernel if only for the sake of knowledge.  I want to know what is being built, and I like to see the changes in each kernel revision.

----------

## justinkb

i don't see the point of genkernel... figure out how to build a kernel once, and you'll know for life... nothing to it really.

----------

## danomac

 *justinkb wrote:*   

> i don't see the point of genkernel... figure out how to build a kernel once, and you'll know for life... nothing to it really.

 

You'll change your mind after trying to build your own initrd. I did. It is useful for some applications.

----------

## i92guboj

Whether you love or hate it is strictly a matter of preference, nothing else. 

The first thing to note is that you can do exactly the same with or without genkernel. Genkernel by definition is not going to give you a bigger or smaller kernel, you can compile as much parts or as few parts of the kernel as you wish both ways, so that's a moot argument no matter which faction (lovers or haters) use it.

Either way, even if you compile everything that's not going to change the size or performance of your kernel either, compiling a thousand modules doesn't mean they are going to be loaded. You will use the same modules always, it doesn't matter if you compiled 2 or 200.

I've never used genkernel just because I have no need to learn yet-another-way to do exactly the same thing for no real benefit.

----------

## rafo

I appreciate that for a great many hardware configurations a manual kernel build is the preferred way to go. As a bonus the build time is shorter.

However, part of the greatness of Gentoo is that it can be set up for nontrivial configurations too. Some configurations require an initramfs. Here is a nice wikipage on the subject: http://en.gentoo-wiki.com/wiki/Initramfs.

I suppose must-have-initramfs hardware configurations is where genkernel stands strongest: It creates an initramfs and you don't have to get into the details. But beware, quoting from the wikipage,

 *Quote:*   

> You can ... let other apps, such as genkernel, do the work for you. If you are lucky, genkernel does what you want out of the box, and you don't need to bother with how initramfs works and what it does anymore. If you're unlucky, genkernel does not do what you want and you have to build an initramfs all by yourself.

 

BTW, I still haven't found out if my hardware (laptop booting from cheap USB disk; no internal hard drive, no floppy, no CD, no memory stick etc) can boot without an initramfs. Time for some experimentation...

----------

## i92guboj

 *rafo wrote:*   

> As a bonus the build time is shorter.

 

Not really. The build time depends on the options you select, and, as I said in the previous post, that's equally configurable either way.

----------

## MaximeG

At least you save the initramfs compilation time ? :p

Maxime

----------

## DrChandra

I use genkernel because it takes care of all the little housekeeping chores that go along with installing and updating a kernel:

 - Mount /boot. I've helped a few people in freenode #gentoo who forgot to do this, and wondered where

   their new kernel went.

 - Copy all of the files to /boot and name them in a consistent way. No typos.

 - Edit grub.conf and add the new kernel without adding any typos to the file names. Also, preserve the previous kernel

   entry so it serves as a backup in case the new kernel doesn't work.

 - Back up the kernel .config file for each kernel in /etc/kernels. This has allowed me to later do compares to find out what

   changed, when.

One thing I will not let genkernel do is configure my kernel. I feel that needs to be done by hand, in order to be certain that the config does not have any extra drivers selected that aren't needed for my hardware. This speeds up the build, and uses less memory while the kernel is running.

I know how to build a kernel by hand (I've been doing it since Linux was only available from Finland), but I use genkernel in the same way that I use fstab to do my mounts. I can do it manually, but the automatic way is faster, more reliable, and keeps a record of my work.

I run genkernel like this:

```
genkernel --oldconfig kernel

```

(I could use --menconfig, as well.)

Here's the options I customize in my genkernel.conf:

```

# Run 'make oldconfig' before compiling this kernel?

OLDCONFIG="no"

# Run 'make menuconfig' before compiling this kernel?

MENUCONFIG="no"

# Run 'make clean' before compilation?

# If set to NO, implies MRPROPER WILL NOT be run

# Also, if clean is NO, it won't copy over any configuration

# file, it will use what's there.

CLEAN="no"

# Run 'make mrproper' before configuration/compilation?

MRPROPER="no"

# Override the arch detection?

# ARCH_OVERRIDE="x86"

# Mount BOOTDIR automatically if it isn't mounted?

MOUNTBOOT="yes"

# Make symlinks in BOOTDIR automatically?

# SYMLINK="no"

# Save the new configuration in /etc/kernels upon

# successfull compilation

SAVE_CONFIG="yes"

# Use Color output in Genkernel?

USECOLOR="yes"

# Add new kernel to grub?

BOOTLOADER="grub"

```

----------

## rafo

OK, now I have found out about my particular case: Booting a Compaq 8510w from an external USB hard drive can be done without an initramfs. My configuration isn't that exotic after all  :Smile:  . A "rootdelay" parameter on the kernel line seems to be required though.

----------

## Carnildo

Never used it.  I've been configuring my own kernels since before Gentoo existed.

----------

## depontius

 *Carnildo wrote:*   

> Never used it.  I've been configuring my own kernels since before Gentoo existed.

 

I'll try to say it again.  You can manage your own configurations, you don't have to accept what genkernel does, and for that matter I'd never use such "defaults," either.  The neat thing about genkernel is that you don't have to hang around between "make bzImage", "make modules", and "make modules_install".

My kernel-building days go back to RedHat 4, when you had to build a custom kernel in order to get support for ANY sound and my soundblaster-16-connected cdrom drive.  Stock kernels weren't even an option.  Module/feature bloat wasn't the problem, they simply wouldn't work with my system.

I like the shortcuts, so I can configure, then go get a coffee or off to a meeting, come back, and the kernel's done and installed.

----------

## poly_poly-man

 *depontius wrote:*   

>  *Carnildo wrote:*   Never used it.  I've been configuring my own kernels since before Gentoo existed. 
> 
> I'll try to say it again.  You can manage your own configurations, you don't have to accept what genkernel does, and for that matter I'd never use such "defaults," either.  The neat thing about genkernel is that you don't have to hang around between "make bzImage", "make modules", and "make modules_install".

 

try make bzImage && make modules && make modules_install.

----------

## EzInKy

 *poly_poly-man wrote:*   

>  *depontius wrote:*    *Carnildo wrote:*   Never used it.  I've been configuring my own kernels since before Gentoo existed. 
> 
> I'll try to say it again.  You can manage your own configurations, you don't have to accept what genkernel does, and for that matter I'd never use such "defaults," either.  The neat thing about genkernel is that you don't have to hang around between "make bzImage", "make modules", and "make modules_install". 
> 
> try make bzImage && make modules && make modules_install.

 

Or even "make && make modules_install"

----------

## pappy_mcfae

 *justinkb wrote:*   

> i don't see the point of genkernel... figure out how to build a kernel once, and you'll know for life... nothing to it really.

 

Amen to that! I began my life of kernel compilation with Slackware-11 and 2.6.18. There was no genkernel there to help me. A few looks around at what Google had to say on the subject, and I was off to the races. 

I look at genkernel as a crutch. IMO, if you're going to go through the trouble of installing and learning Gentoo, why play with a tinker-toy kernel configuration/creation package? For a n00b, once, maybe twice if they are really green. Beyond that, it's time to get with the program when it comes to applying the wonders of the Gentoo learning curve to the wonder that is the Linux kernel. 

As for creating initrd, I don't get people saying that's such a pain. I had to make an initrd with Slackware-12 so hal would work, so I could read my mounted root partition. According to the README.initrd from slack-12,  *Quote:*   

> mkinitrd -c -k @KERNEL_VERSION@ -m reiserfs

  inside the /boot directory is ALL one needs to do to create it, and adding it to /etc/lilo.conf or /boot/grub/grub.conf is how it's activated. It was so simple the n00b I was at the time made it happen three times. I suffered no ill effects or pain at all.

My opinion is my opinion. If you're happy using genkernel, have at it. I prefer my seeds, so I'll continue to use them and make them for others to use as well.

Blessed be!

Pappy

----------

## poly_poly-man

 *EzInKy wrote:*   

> Or even "make && make modules_install"

 

that's what I usually do... but apparently that's what he wanted to do.

----------

## Plague.CZ

I only use (well used to use) Genkernel when I needed an initrd script, because there was no way for me to create one (and I really tried). As for normal use, just configure the ggernel and run "make && make modules modules_install install" and reboot, that's it.

----------

## alkan

 *kalos wrote:*   

> I personally haven't used genkernel before, so I can't offer an unbiased opinion.  However, I like to build my kernel if only for the sake of knowledge.  I want to know what is being built, and I like to see the changes in each kernel revision.

 

you said exacly what i would say

----------

## depontius

I first installed either Gentoo 1.2 or 1.4, Reading The Fine Manual.  They suggested, but didn't require, using genkernel to build the kernel.  I figured, I'm trying out Gentoo, so let's try out genkernel, too.  It was convenient, and I've always managed my own configs, so when I started using genkernel I kept on doing my own config management.  It suits me, and though I see others grumbling, I see no need to stop using it.

The knowledge of kernel building is generally in the configuration management whether you use genkernel or type "make" by hand.  One part I do with I understood better is initr/initramfs, but even in my pre-Gentoo, pre-genkernel days I just ran "make initrd" without understanding the guts.  I see various people working on toolsets for initrd/initramfs, and one of these days, with some spare time...

----------

