Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/index.php/Reporting_Bug_Guidelines

Do NOT report bugs when a package is just outdated, or it is in Unsupported. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#28081 - [grub-common] Incorrect ordering of kernels in grub.cfg generated by grub-mkconfig

Attached to Project: Arch Linux
Opened by Xavier D. (magicrhesus) - Tuesday, 24 January 2012, 13:05 GMT
Last edited by Tobias Powalowski (tpowa) - Monday, 06 October 2014, 06:57 GMT
Task Type Bug Report
Category Upstream Bugs
Status Waiting on Response   Reopened
Assigned To Ronald van Haren (pressh)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 13
Private No

Details

Description:

The detection order is not correct.
If you have linux-lts & linux installed, linux-lts is detected as more recent than linux.


Additional info:
* package version(s)
* config and/or log files etc.

Package version: grub2-common 1:1.99-6

Steps to reproduce:

Install linux & linux-lts package, run grub-mkconfig.

Attached a patch which permits to detect them in the correct order (inspired from one of the Fedora bugtracker)
This task depends upon

Comment by Keshav Amburay (the.ridikulus.rat) - Thursday, 02 February 2012, 06:26 GMT
Post this issue in bug-grub ML or #grub irc.
Comment by Keshav Amburay (the.ridikulus.rat) - Monday, 19 March 2012, 11:28 GMT
Someone please change the title to be more descriptive, like "[grub2-common] Incorrect ordering of kernels in grub.cfg generated by grub-mkconfig"
Comment by Keshav Amburay (the.ridikulus.rat) - Tuesday, 03 April 2012, 04:34 GMT
Is the detection order correct in grub2 2.00beta3-1 ?
Comment by Xavier D. (magicrhesus) - Tuesday, 03 April 2012, 13:01 GMT
Nope
Comment by Keshav Amburay (the.ridikulus.rat) - Monday, 16 April 2012, 13:35 GMT
@magicrhesus: Did you contact upstream about this?
Comment by Andreas Källberg (Hjulle) - Monday, 06 October 2014, 06:57 GMT
  • Field changed: Percent Complete (100% → 0%)
The proposed patch actually finds the _oldest_ kernel according to sort -V. According to normal version ordering vmlinuz-linux _is_ older than vmlinuz-linux-lts. The arch-linux kernel naming system causes this bug.
Comment by Cherrot Luo (cherrot) - Saturday, 08 October 2016, 15:58 GMT
Seems that this issue still remains on grub-mkconfig (GRUB) 2.02~beta3 ?
Comment by deusstultus (deusstultus) - Tuesday, 07 February 2017, 08:19 GMT
I move to reclassify this and solve as a distribution bug which may eventually be handled through feature request at upstream #42597. (Edit fixed bug number)

1) Kernel naming is a distribution choice, there is no universal right answer here. In fact, archlinux deviates from upstream norm.
2) Given archlinux rolling release philosophy, it stands to reason that if a user has both linux and linux-lts installed, linux should be pushed as the default. Let user configuration drive changes from this norm rather than relying on grub parsing to guess.

Three real options here:
1) Revamp arch implementation to make use of GRUB_DEFAULT, configuring IDs a bit differently
2) Apply patch from upstream #4259 or something akin to reporter here, acknowledging that an alpha sorted listing doesn't serve much more than solving for the current core repository kernels. touch /boot/vmlinuz-zzz and suddenly there's a new priority.
3) Refactor 10_linux so that the distribution preferred kernel is made first if available.

Attached is a hack for route 3 which I have verified.

I'll file up with an upstream tag on this new direction, but hold that this issue is a distribution bug which could be served in time by an upstream feature.
Comment by vlamnire0 (blomstertj) - Thursday, 13 April 2017, 22:13 GMT
I'm getting this problem too. Logically I'd think grub-mkconfig would put "linux" as the default entry (0) and "linux-lts" in the Advanced section so if "linux" breaks something you can try "linux-lts." Correct me if that is not how it's supposed to be; you could make the argument that "linux-lts" should be default because it may be more stable in some cases.

My GRUB version is: 1:2.02.rc2-1 which I assume means 2.02.rc2-1
Comment by Alif (alive4ever) - Monday, 17 April 2017, 08:09 GMT
I think the menu order doesn't matter, since the default kernel to be booted can be configured via "GRUB_DEFAULT".

The default Arch Linux installation doesn't pull 'linux-lts'.
If a user installs linux-lts manually, it's assumed that the user wants to boot linux-lts and grub-mkconfig does that.


Comment by vlamnire0 (blomstertj) - Monday, 17 April 2017, 18:48 GMT
Alif

I completely see what you're saying; however, I need the "GRUB_DEFAULT" line set to "saved" or the "grub-reboot" command does not work correctly. I do understand though that not many people are probably using this command.
Comment by AMM (amish) - Tuesday, 06 June 2017, 18:02 GMT
I disagree with Alif. If user installs linux-lts it does not necessarily mean that user wants to boot linux-lts

Most user install linux-lts as fallback just incase linux boot fails.

Plus arch philosophy is of always being up-to-date with latest version and hence having linux should be the preferred kernel.

Loading...