Continuing the discussion from [Stable Update] 2018-10-08 - Kernels, Gnome 3.30, Cinnamon, Deepin, Pamac, SPL/ZFS:
Requoting my first post in the update thread:
Not a serious problem for me, but I think grub has changed a little how it does things.
Update went fine but terminal text indicated that it couldn’t find the /etc/grub.d/41_custom script. That’s because a few months ago I did a
command to move 41_custom to 09_custom, so that my custom grub entries in custom.cfg would show up before the normal grub.cfg entries.
Anyway, when I rebooted my PC, I found my custom.cfg now appeared twice, once before the grub.cfg stuff and once after. This had never happened before in the upgrades the last few months since I moved 41_custom. So I logged in again and checked /etc/grub.d folder. Turns out grub recreated a 41_custom script for me, which is why I had duplicate custom.cfg entries.
Anyway, I removed 41_custom, but if grub replaces it again the next update, I’ll try removing the actual script content but leave the file there.
@gohlip, you said:
It will begin afresh, meaning without the old manual entry you put into it.
That’s why it is better to have manual entries in /boot/grub/custom.cfg.
Those entries will not be nuked, and can never change without user manual input and even if wrong will not disrupt your grub.
As to your old entries in 41_custom, note we had copied over to /etc/grub.d.old.
So if you still want it, it will be there. Copy back to your new grub.d/41_custom or as said, better in /boot/grub/custom.cfg
There are no manual entries in 41_custom. By default, 41_custom contains a script that looks for the custom.cfg file (which is where all my manual entries are), and if present, it loads it.
See this link,
which says of the custom.cfg file:
The /etc/grub.d/41_custom script will reference [the custom.cfg] file to be read in at boot time if it exists. This file [custom.cfg] provides a place to add additional entries or commands and does not require regeneration of the main grub.cfg file.
So #41 is the actual reason that we are able to add manual entries in a custom.cfg file and have it appear in grub menu without an update-grub.
Problem is that #41 will load custom.cfg AFTER the normal grub entries because “41” is a later number than the ones for the standard entries. By moving the script to “09”, I make custom.cfg appear BEFORE my normal grub menu.
One only needs to update-grub once for “09” to be incorporated. After that, I can do all my normal changes to custom.cfg and have them appear without updating grub.
The point is I don’t need both #09 and #41 doing the same thing, that’s what’s creating the double entries. Previously update-grub (or mkconfig) did not make grub recreate the missing #41, but this recent update of Manjaro, grub behaved differently when regenerating grub.cfg.
BTW, #41 is different from #40 script.