# Kernel changes and masking

## LIsLinuxIsSogood

What resources are available for tracking important changes to the Linux kernel so I can know when it is important to proceed with an upgrade to the kernel?  

As of now I sort of just been relying on the maintainers of gentoo's repository to tell me what kernel to be using.  I use the gentoo-sources package fyi.

Would it work and still be a good practice to mask kernel source versions greater than or "above" my current one in use so that I can avoid unnecessarily downloading kernel source tree every time it is updated?

I only upgrade the kernel anyway when I have time to go through the manual steps for configuring and installing it, which is probably once a month.

----------

## pietinger

I also use gentoo-sources (unstable)

 *LIsLinuxIsSogood wrote:*   

> Would it work and still be a good practice to mask kernel source versions greater than or "above" my current one in use so that I can avoid unnecessarily downloading kernel source tree every time it is updated?

 

Imho NO, it is not a good practice. Yes, some downloads will be unnecessary, but I can see immediately if there was an update. If after my daily "emerge --sync" I see a new kernel version, I visit:

 *LIsLinuxIsSogood wrote:*   

> What resources are available for tracking important changes to the Linux kernel so I can know when it is important to proceed with an upgrade to the kernel?

 

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

klicking on Branch "linux-5.8.y" and read the headlines of the comitted messages. Today I see there is nothing which affects my kernel config and therefore I will not update to the new version immediately. Maybe the next version.

----------

## NeddySeagoon

LIsLinuxIsSogood,

There are two options to consider.

a) you hardware is well supported in the gentoo-sources stable kernel. 

Keep using the stable kernel. It gets all the important updates.

When a new stable e.g 4.19.x to 5.4.x comes out, move to it. The .x versions are all important to somebody. You need se read the changelog to decide if you are affected.

It may be faster to update anyway.

b) You have new shiny hardware that does not quite work with the newest kernel you can get plus patches that have not get into the kernel yet.

You need testing gentoo-sources or newer  Don't expect improvements every step. Just occasionally things go backward too.

In short, if the stable kernel is good enough, use it but don't mask version mask anything. You will miss things that way.

----------

## Tony0945

If running an unstable version, say ACCEPT_KEYWORDS="~amd64" in make.conf, does "sys-kernel/gentoo-sources amd64" in package.accept_keywords do anything?  My understanding was that it only unmasked unstable keywords.

----------

## NeddySeagoon

Tony0945,

You need 

```
sys-kernel/gentoo-sources -~amd64
```

ACCEPT_KEYWORDS="~amd64" expands to ACCEPT_KEYWORDS="amd64 ~amd64" so as you say, sys-kernel/gentoo-sources amd64 does nothing as it already covered by make.conf.

Not ~amd64 is what's needed.

----------

## Tony0945

 *NeddySeagoon wrote:*   

> You need 
> 
> ```
> sys-kernel/gentoo-sources -~amd64
> ```
> ...

 

Ah! I learned something new!  Thank You!

----------

## LIsLinuxIsSogood

So I gather from the last few messages it would be okay and encouraged to use unstable packages for the rest of the system, but stable for kernel?  This is counter to what I was generally assuming in terms of mixing stable and experimental branches, but I guess if it is for the kernel specifically it may not be a problem?

----------

## pietinger

 *LIsLinuxIsSogood wrote:*   

> [...] it would be okay [...] to use unstable packages for the rest of the system, but stable for kernel?[...]

 

Its okay. I have the same revers: An unstable kernel within a stable system. Mixing stable with unstable is sometimes a must, because all games are unstable in gentoo. Therefore my xboard and stockfish is also unstable.

----------

## LIsLinuxIsSogood

Well now I am not sure whether or not to downgrade the kernel and if so then how to do so?  I tried the scenario of inserting the use flag for sys-kernel/gentoo sources -~amd64 but running the emerge --changed-use or emerge -N does not downgrade automatically. Suggestions?

----------

## pietinger

 *LIsLinuxIsSogood wrote:*   

> Well now I am not sure whether or not to downgrade the kernel [...]

 

Why do you want to downgrade your kernel ?

----------

## LIsLinuxIsSogood

Good point   :Very Happy: 

----------

## NeddySeagoon

LIsLinuxIsSogood,

The mixing branches works both ways A few testing packages on a stable system is the common case. That's the well known package.accept_keywords ~arch

Less common is a few stable packages on an ~arch system.  That's package.accept_keywords -~arch.

Its possible that you had the now stable kernel installed in /usr/src before you added  

```
sys-kernel/gentoo-sources -~amd64
```

to your package.accept_keywords/ from the days when it wan the best testing kernel.

Kernel sources are special, portage only installs them to /usr/src. Its up to you to build them.

Sort out what happened or you will get in a mess in the future. Your testing kernel will become unmaintained and get removed. Possibly due to security updates.

Half a switch, like you appear to have done is worse than not switching at all.

Either move to a stable LTS (Long Term Support) kernel or don't.

LTS kernels got security fixes with patch version bumps.

Testing kernels get security fixes rolled in with all the other functionality additions.

Follow one or the other properly.

----------

## Tony0945

 *NeddySeagoon wrote:*   

> Either move to a stable LTS (Long Term Support) kernel or don't.
> 
> LTS kernels got security fixes with patch version bumps.
> 
> Testing kernels get security fixes rolled in with all the other functionality additions.
> ...

 

For reference, I'm on LTS stable 5.4 on all my 64-bit systems and 4.4 on my only 32-bit system. 

I was on testing kernel for my Ryzen system when it was still relatively new. I even had to patch it to get lm-sensors to work.

Now it's mature and I removed the keyword from gentoo-sources.  My general rule is "stable for system code, testing for applications" because that gives me the applications that upstream calls stable. Sometimes there are problems and I mask specific versions.  As noted many times by NeddySeagoon, these mixed systems are not recommended because sometimes something at the bottom or middle layer causes conflicts. 

4.4 seems to run better on the ancient system and I certainly don't need new drivers.

Keyword gentoo-sources as suggested. Then "emerge -a1v gentoo-sources". Then "eselect kernel <stable version number>". You probably have to run "eselect kernel list" first unless you have an eidetic memory. Then follow your build procedure. And, if you still run grub, update the grub menu.

----------

## LIsLinuxIsSogood

I am currently using an unstable kernel, 5.8.3, and I do want to avoid updating the kernel as often as it seems the latest unstable sources are "pushed" in the repo -- that process being tedious and time consuming.  SO, I've made the accept_keyword change and downloaded the lower version of kernel 5.4.60.  I am considering the downgrade just so I can keep up with the latest stable kernel version, but I could also keep running 5.8.3. However it is conceivable that 5.4.60 as a stable kernel is safer and more reliable than staying with this later kernel version that in its x.x.3 revision as opposed to the x.x.60 for the 5.4 would end up becoming outdated quickly putting me back in the same position I am now of upgrading again and again.  I bet by the time 5.8 is available as stable it would be far beyond 5.8.3 so I guess I should not risk keeping 5.8.3 and downgrade to 5.4.60.

----------

## asturm

Only LTS kernels are stabilised so 5.8 will never be stable. But if it works for you now, why change? By now there's already 5.8.7 available which by definition has received numerous fixes over 5.8.3.

----------

## DespLock

Another way to do this: emerge a special kernel version: 

emerge --noreplace sys-kernel/gentoo-sources:5.8.3

Then remove gentoo-sources from world (file):

emerge --deselect gentoo-sources

emerge --depclean

After that you can install newer versions like above.Last edited by DespLock on Mon Sep 07, 2020 10:04 am; edited 1 time in total

----------

## NeddySeagoon

LIsLinuxIsSogood,

Once 5.9.x is out, there will be no more changes to 5.8.

Either track LTS or testing but don't stay on 5.8 now with the intent to track LTS 'one day'.

----------

## Tony0945

 *NeddySeagoon wrote:*   

> LIsLinuxIsSogood,
> 
> Once 5.9.x is out, there will be no more changes to 5.8.
> 
> Either track LTS or testing but don't stay on 5.8 now with the intent to track LTS 'one day'.

 

A possible compromise?  In package.accept_keywords put lines:

```

sys-kernel/gentoo-sources -~amd64

=sys-kernel/gentoo-sources-5.8.3  ~amd64
```

Would that work to enable anything in the stable branch and also the one unstable he has now?

----------

## NeddySeagoon

Tony0945,

Yes. The problem is that LIsLinuxIsSogood will stay on gentoo-sources-5.8.3 long after its forgotten, until there is a newer LTS kernel.

gentoo-sources-5.8.3 is already forgotten. 5.8.7 is out.

----------

## pietinger

LIsLinuxIsSogood,

you want to avoid too many updates of your kernel. You can do this with a stable (today: 5.4.x) and an unstable kernel (today: 5.8.7), BUT ...

... dont believe a stable kernel has less updates than the unstable ones (think of 5.4.60 - in words: sixty). This is because every bug found in newer unstable kernels wil be BACKPORTED to the actual LTS-kernel. And for security reasons you should update your stable LTS-kernel ALSO when a new version is out ...

so, you dont win (or loose) something with your decission for a stable kernel.

----------

## Tony0945

pietinger,

What you win is avoiding the weekly build of a new kernel.

----------

## pietinger

 *Tony0945 wrote:*   

> What you win is avoiding the weekly build of a new kernel.

 

Tony,

yes you are right, IF I would build ervery version. But I am still on 5.8.6 and before I had 5.8.4 and 5.8.1 ... its my decission when I update to a new version ... and I beleive in the same time there where the same numbers of new LTS-versions ...

----------

## LIsLinuxIsSogood

Not to deter from discussions about stable vs unstable, but now that I downgraded the kernel, and I decided I want to keep the latest version in my /boot folder since I know it works.  When running grub-mkconfig I believe the default entry is set to the highest version number of the kernel found, which unfortunately is not the one I want.  I would read all the grub documentation to figure it out myself, but I am also not one to shy away from recommended solutions.  So what is a way to instruct grub to either remove or block the 5.8.3 kernel or else to prioritize the lower kernels in the boot loader's menu entry order?  thank you in advance for your suggestions.

----------

## Tony0945

LIsLinuxIsSogood,

If you were running rEFInd, all you would have to do is run "touch <full pathname of desired boot kernel>" and it would become the latest. I suppose you could do that with grub:2 also, running your grub command afterward.

----------

## Tony0945

 *pietinger wrote:*   

>  IF I would build every version. 

 

So I gather you do not have "sys-kernel/gentoo-sources" in your world file. Or you put specific versions in world. Or just mask higher versions until the spirit moves you to change.  That's okay too. I had assumed that gentoo-sources was updating on the release schedule. Tilde (I really dislike "unstable") version come out much more often than stabilizations occur.  I just switched in the last few days from 5.4.48 to 5.4.60 as 5.4.60 became stable, skipping eleven builds. There wasn't even much to it. I took the default "no" foe each new config item. My hardware is already supported except for lm-sensors which shows fans at zero ROM (I can see them running) and claims my CPU is frozen.

----------

## pietinger

 *Tony0945 wrote:*   

> So I gather you do not have "sys-kernel/gentoo-sources" in your world file. Or you put specific versions in world. Or just mask higher versions until the spirit moves you to change.  [...]

 

No - no - no.

I have gentoo-sources in my world file without a specific version and I dont mask higher versions. So, I get every version when I do an "emerge -uUDv @world", but I dont compile (and install) every new version ... (this is what I meant when I answered LIsLinuxIsSogood: "Yes, some downloads will be unnecessary [...]).

----------

