[adelie-devel] Re: GRUB configuration update hook

From: Max Rees <maxcrees_at_me.com>
Date: Wed, 10 Jul 2019 02:33:31 -0400

On Jul 09 10:50 PM, 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."

The trigger should not die here, otherwise apk will mark it as broken
and try to re-run it on the next `apk fix` invocation, when it will be
still broken since .manual_config will still exist, and so on. This
behavior is desirable for the missing mount case, but not here. Here, it
should print a warning message and exit with status zero.

Since the message for the second case will not be fatal, care should be
taken that it is made highly visible in the apk output.

Additionally, some mechanism must be employed so that users who:

  1. Currently have a manual grub config
  2. Do not have a .manual_config file

do not have their configuration file overwritten when this change is
made. By what mechanism this is made (public announcement, some sort of
technical measure) I'm not sure.

> grub-mkconfig -o /boot/grub/grub.cfg

Besides the three concerns discussed above (die, visibility,
transition), this seems like a good idea.

Max
Received on Wed Jul 10 2019 - 06:50:16 UTC

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