You are not logged in.

#1 2020-10-09 06:54:10

Anonymous20210217
Banned
Registered: 2020-10-03
Posts: 5

[SOLVED] GRUB's default kernel priority behavior

I recently installed Arch on my laptop (UEFI mode). While setting up Arch I installed linux-lts. Later I decided to use both the linux stable and linux-lts. After installing linux stable, my GRUB still booted into older linux-lts. I actually wanted to use it as a fallback option. So, I referred to this :

https://wiki.archlinux.org/index.php/GR … le_entries

And, modified my GRUB menu entries using grub-customizer, to get latest stable linux to boot by default. I enabled GRUB's entry recalling function and timeout to let me to easily switch between linux and linux-lts. (BTW, I am using only single OS, Arch)

My question is, do grub prioritize latest kernel or the kernel installed first in order ? As I previously used Ubuntu, I observed that it's GRUB used to prioritize the latest kernel version. Why Arch's GRUB doesn't sets such priority ?

Last edited by Anonymous20210217 (2020-10-09 08:09:44)

Offline

#2 2020-10-09 07:06:35

GaKu999
Member
From: US/Eastern
Registered: 2020-06-21
Posts: 696

Re: [SOLVED] GRUB's default kernel priority behavior

Methinks GRUB2 config from grub-mkconfig makes usage of grubenv to store the latest booted kernel, so that’s unrelated to any default and it’s just a little persistence.

Otherwise I have no clue how you managed to end up with that behavior, because ArchLinux barely haves a sane default on the grub.cfg generator...

They get ordered in alphabetical order btw...

Without grub.cfg or anything that you may have changed its guessing game...


My reposSome snippets

Heisenberg might have been here.

Offline

#3 2020-10-09 07:16:49

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,231

Re: [SOLVED] GRUB's default kernel priority behavior

Afaik in the default config it picks the newer timestamp of the kernel image as the default.

Arch's GRUB doesn't set such a priority is because Arch just ships the default config as is without any adjustments. It's up to you to configure this.

Offline

#4 2020-10-09 07:24:53

GaKu999
Member
From: US/Eastern
Registered: 2020-06-21
Posts: 696

Re: [SOLVED] GRUB's default kernel priority behavior

V1del wrote:

Afaik in the default config it picks the newer timestamp of the kernel image as the default.

Arch's GRUB doesn't set such a priority is because Arch just ships the default config as is without any adjustments. It's up to you to configure this.

Or just write a grub.cfg manually...

No wonder I have no clue about the sh “magic” inside /etc/grub.d tho...


My reposSome snippets

Heisenberg might have been here.

Offline

#5 2020-10-09 07:41:03

Anonymous20210217
Banned
Registered: 2020-10-03
Posts: 5

Re: [SOLVED] GRUB's default kernel priority behavior

Ok. I think my question is not much clear so simplifying it....

My current kernel is LTS. I install new stable kernel. (Obviously it's version number is greater than LTS) Then I reboot and GRUB boots into LTS kernel again.

In other distros like Ubuntu, you see, if a new kernel is installed, it boots in that new kernel directly without any special configuration.

So why my grub is not booting into new kernel ? Why it still boots into older LTS kernel ? This means that grub-mkconfig don't set new kernel as default. I will need to do it manually.

Offline

#6 2020-10-09 07:49:28

GaKu999
Member
From: US/Eastern
Registered: 2020-06-21
Posts: 696

Re: [SOLVED] GRUB's default kernel priority behavior

abhidesh128 wrote:

Ok. I think my question is not much clear so simplifying it....

My current kernel is LTS. I install new stable kernel. (Obviously it's version number is greater than LTS) Then I reboot and GRUB boots into LTS kernel again.

In other distros like Ubuntu, you see, if a new kernel is installed, it boots in that new kernel directly without any special configuration.

So why my grub is not booting into new kernel ? Why it still boots into older LTS kernel ? This means that grub-mkconfig don't set new kernel as default. I will need to do it manually.

Yes you have to, because since you have not changed anything the old kernel is still stored as default in grubenv...

Don’t expect Arch to do things for you. :-)


My reposSome snippets

Heisenberg might have been here.

Offline

#7 2020-10-09 08:09:21

Anonymous20210217
Banned
Registered: 2020-10-03
Posts: 5

Re: [SOLVED] GRUB's default kernel priority behavior

GaKu999 wrote:
Yes you have to, because since you have not changed anything the old kernel is still stored as default in grubenv...

Don’t expect Arch to do things for you. :-)

Okay, so it means that Ubuntu or other distros may do that thing readily for you.

But Arch expects this to be configured by user, giving the user more freedom in this regards.

This also means that there is no such thing as 'default kernel priority' in Arch GRUB. It will not set any priority itself as like Ubuntu. The user will need to set up this.

My doubt is cleared now. Thank you @GaKu999 & @V1del  for you comments.

Marking this as solved.

Offline

Board footer

Powered by FluxBB