[adelie-devel] Re: GRUB configuration update hook

From: Molly Miller <adelie_at_m-squa.red>
Date: Wed, 10 Jul 2019 08:19:28 +0100

On 2019-07-10 04:50, A. Wilcox wrote:
> Hi all,
> Alyx and I have been talking and we think GRUB should automatically
> update its configuration when a new kernel is installed. Something
> like
> triggers="grub.trigger=/usr/share/kernel"
> 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
> Thoughts?

+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
out for.

Received on Wed Jul 10 2019 - 07:38:06 UTC

This archive was generated by hypermail 2.4.0 : Sat May 08 2021 - 22:54:40 UTC