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