How do I go back to a flickerfree boot, where the GRUB menu is hidden unless the last boot failed? I have tried reinstalling GRUB, regenerating its configuration, and grub2-editenv - set boot_success=1; the latter works for the very next boot but doesn’t persist for future boots.
The list of GRUB env variables from grub2-editenv is inconsistent with the text in the grubenv file itself, so maybe that’s part of the problem:
$ sudo grub2-editenv - list
boot_success=1
env_block=512+1
blsdir=/root/boot/loader/entries
boot_success=0
boot_indeterminate=0
$ sudo cat /boot/grub2/grubenv
# GRUB Environment Block
# WARNING: Do not edit this file by tools other than grub-editenv!!!
boot_success=1
env_block=512+1
blsdir=/root/boot/loader/entries
##################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################
That is interesting. On btrfs the grub env block is stored in the partiton at sector 256 as indicated by env_block=512+1. That is why the grubenv file differs from what grub2-editenv shows.
if /boot lives in /dev/nvme0n1p2, run this to display it
That seems to be just zero bytes. But I think the offset is wrong, and if I fix that it’s an entirely different set of variables!
And although removing the env_block variable did get me the hidden menu, it doesn’t seem to actually fix everything: the menu doesn’t show up after a boot failure, and if I use the Alt key in Gnome to change “Reboot” to “Boot Options”, it shows the menu for a minute the first time and goes back to the 5-second menu for all subsequent boots, even if they were successful and shut down cleanly after more than 2 minutes.
I don’t have a separate /boot partition; it’s just a regular directory in the root (BTRFS) filesystem. I was trying to save disk space because my disk is small. I have an EFI system partition sda1, the btrfs with everything at sda2, and a swap partition sda3.
$ sudo cat /boot/grub2/grubenv
# GRUB Environment Block
# WARNING: Do not edit this file by tools other than grub-editenv!!!
boot_success=1
blsdir=/root/boot/loader/entries
menu_auto_hide=1
env_block=512+1
#################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################