So, ever since I installed the LTS kernel to get around a specific issue I was having with the Artix kernel & Flashrom, I noticed that the top Artix kernel menu entry started loading the LTS kernel, even after I booted from the Artix kernel again, So basically, the top menu option didn't seem to "remember" what kernel I last used, and instead, just defaulted to LTS for some reason. What I ended up doing was changing my grub config to remember which
menu entry I chose instead of changing the order of the entries around, and changing what those menu entries themselves do.
But that was kind of a quick and dirty fix, so now, whenever I want to load my
main kernel (Artix kernel instead of LTS), the menu entry selector is on the second row, and to switch back to it from LTS, I must enter the "Advanced options" entry and select the right sub-entry.
However, I decided that not only do I want to soothe my OCD by fixing this issue, but I also want to change the menu options to how I want. Instead of having a menu entry that selects what GRUB thinks is the main kernel (in my case, the LTS kernel, even though I want it to be the Artix kernel again) followed by the "Advanced options" menu entry which leads to sub entries, including one which is the same as the first entry, which I think is redundant, followed by the memtest86+ option, I want the entries to be like this (in quotes are what I want to menu entries to say):
- "Artix Kernel" which leads to whatever version of the Artix Linux kernel I have installed
- "LTS Kernel" which is same as above except with the LTS kernel instead
- "More options..." which leads to a submenu (below)
- "Artix Kernel (initramfs)"
- "LTS Kernel (initramfs)"
- "Memory Test" memtest86+ software/firmware
How would I do this?
The easiest way IMHO is to install grub-customizer from the Arch repos. Then you can customise your grub menu however you wish.
grub-customizer is now in omniverse :
pacman -Ss grub-customizer
omniverse/grub-customizer 5.2.1-1
A graphical grub2 settings manager
Thank you for the correction! ;D
I would've just liked to modify the GRUB config files directly, but I guess I can use grub-customizer and then look at what it's doing so that I can do it manually if I like. Thanks
It is very easy, and you can set it to boot the previously booted entry if you wish (under the General Settings tab), which is useful sometimes when updating the kernel.
I installed it because I will have to learn how to run grub in Artix (and eventually make Artix my 'grubbing' distro, issues raised in another thread). Does running grub-customizer automatically end with running grub (for which I'm not ready) or is that a separate operation?
No, I don't believe it does, but I am not an expert on it, I just use it and find the options to configure it very useful.
If you want to use Grub-customizer, you need to use grub (like the name already give the hint :-) ).
To use grub, isnt hard at all (for my opinion the easiest way to install and have a bootloader wich works in the end).
Sure there is bunch other bootloaders, but for example systemd one (no problem with artix :D) didnt work on one notebook i have, because systemd is buggy or (possible that) the uefi from the notebook. It simply fails to set himself as bootoption.
For me, grub is for me the most stable and mature one, but other "smaller" bootloaders could be faster (didnt tested that, only theory).
The correct way would be to read the coments in
/etc/default/grub.
The solution looks like this:
GRUB_DEFAULT="saved"
GRUB_SAVEDEFAULT="true"
GRUB_DISABLE_SUBMENU="y"
don't forget
update-grub after that.
Possibly irrelevant to note as no FS is mentioned, you can't use GRUB_SAVEDEFAULT="true" if /boot is BTRFS as it doesn't support the sparse file Grub tries to save the last boot choice info in. Perhaps that has been or will be fixed sometime? It was still the case until quite recently anyhow. But you can still set the GRUB_DEFAULT value numerically to select your choice.