# Custom kernel -- portage kernel headers?

## ens_leader

When I build by gentoo systems, i typically download and build the latest kernel off of kernel.org. I do this all within /usr/src.

Whenever I install packages in and around portage, it always wants to download and install the gentoo-sources and kernel-header packages. These package versions will always differ from the latest version that I built myself.

My question is... Even though it installs these two packages -- all which differ between kernel versions -- Does it really matter?

----------

## kimmie

For gentoo-sources, it doesn't matter, installing that package just puts the kernel source under /usr/src. You have to go and actually configure, build and install that kernel for it to affect your system.

For linux-headers, well, you need them. But headers are supposed to work across multiple kernel versions (otherwise updating your kernel would require a full system rebuild). Unless you've explicitly done a "make headers-install" from your custom kernel you're using the portage ones.

So what you're doing shouldn't hurt. You could even put "sys-kernel/gentoo-sources" in "/etc/portage/package.mask" to stop them getting installed. BUT I think it would be much simpler just to "emerge vanilla-sources" rather than going to kernel.org and doing it yourself. That way, you can choose stable or testing versions, and portage will tell you when there's an upgrade available etc.

----------

## DaggyStyle

 *ens_leader wrote:*   

> When I build by gentoo systems, i typically download and build the latest kernel off of kernel.org. I do this all within /usr/src.
> 
> Whenever I install packages in and around portage, it always wants to download and install the gentoo-sources and kernel-header packages. These package versions will always differ from the latest version that I built myself.
> 
> My question is... Even though it installs these two packages -- all which differ between kernel versions -- Does it really matter?

 

why are you doing that? you have vanilla-sources which is the kernel directly from kernel.org without gentoo patch set.

emerge that and you won't have to deal with such problems.

masking gentoo-sources will just pull in another sources package in the best case or will prevent you from installing the package thus forcing you to either mask the other sources package which is pulled in (eventually you'll mask all sources packages and you'll have to use the second way) or installing each an every package without it's dependencies and when it fails, try to understand what package is missing.

save the hassle and just use vanilla-sources.

----------

## RedSquirrel

If you want to manage the kernel sources outside of Portage, put an appropriate line for vanilla-sources in /etc/portage/profile/package.provided. See 'man portage' for the details on this file. There is some information in the Gentoo Handbook about it as well: here. Once you have taken care of that, Portage will no longer ask you to install vanilla-sources (nor gentoo-sources since you only need one *-sources package).

----------

