post_install() {
  if [ -f /boot/grub/grub.cfg.pacsave ]; then
    echo "Copying /boot/grub/grub.cfg.pacsave to /boot/grub/grub.cfg"
    install -D -m0644 /boot/grub/grub.cfg.pacsave /boot/grub/grub.cfg
  fi
  if [ -f /etc/default/grub.pacsave ]; then
    echo "Copying /etc/default/grub.pacsave to /etc/default/grub"
    install -D -m0644 /etc/default/grub.pacsave /etc/default/grub
  fi

  cat <<EOM
:: Install your bootloader and generate configuration:
     UEFI: https://wiki.archlinux.org/title/GRUB#Installation
     BIOS: https://wiki.archlinux.org/title/GRUB#Installation_2
EOM
}

post_upgrade() {
  # return if old package version greater 2.06-0...
  (( $(vercmp $2 '2.06-0') > 0 )) && return

  if [[ -e /sys/firmware/efi/efivars ]]; then
    cat <<EOM
:: GRUB no longer supports side-loading modules when secure boot is
   enabled. Thus booting will fail, unless you have an EFI executable
   'grubx64.efi' with bundled modules.
EOM
  fi
}
