On 2019-07-10 04:50, A. Wilcox wrote:
Alyx and I have been talking and we think GRUB should automatically
update its configuration when a new kernel is installed. Something
Then grub.trigger can contain (pseudocode):
[ -f /boot/grub/grub.cfg ] || die "/boot is not mounted or GRUB is not
installed. Update the configuration manually."
[ -f /boot/grub/.manual_config ]] && die "Not overwriting your
configuration. Please update it manually before rebooting."
grub-mkconfig -o /boot/grub/grub.cfg
+1, this would very much remove some footguns. Alternatively, we could
ship a symlink in /boot pointing to the installed kernel and initramfs
image (if present), so that the Grub config doesn't need to change if
the kernel is upgraded -- this is what Arch Linux does, for example.
Obviously this doesn't really handle the case of having multiple kernels
installed very well, but that then depends on how many kernels we're
planning to ship. (As far as I know, the only place we have multiple
available kernel images is the POWER8-optimised kernel for ppc64
alongside the regular ppc64 kernel.)
A similar case could be made for regenerating the initramfs upon kernel
upgrades, if present, which is another footgun that needs to be watched