#984759 grub2-common: grub-install/2.02+dfsg1-20+deb10u4 ignores --bootloader-id=xxx parm; sets grubx64.efi's prefix to /EFI/debian -- prevents system boot

Package:
grub2-common
Source:
grub2
Description:
GRand Unified Bootloader (common files for version 2)
Submitter:
YW
Date:
2021-03-08 14:03:04 UTC
Severity:
important
#984759#5
Date:
2021-03-08 03:03:42 UTC
From:
To:
Dear Maintainer,

Upgrading to grub 2.02+dfsg1-20+deb10u4 caused  grub-install
--target=x86_64-efi  to be executed. It failed (as expected) so I ran
   grub-install --bootloader-id=debian1buster
                --efi-directory=/boot/efi1  /dev/sda
   grub-install --bootloader-id=debian2buster
                --efi-directory=/boot/efi2  /dev/sdb
because I'm running two drives under software RAID1 and I wanted boot
redundancy. In order to get there I have two entries in the EFI as
(sda1)/boot/efi1/EFI/debian1buster  and 
(sdb1)/boot/efi2/EFI/debian2buster  giving  efibootmgr -v  of
        Boot0000* debian1buster  
 
HD(1,GPT,xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,0x800,0x100000)/File(\EFI\debian1buster\shimx64.efi)
        Boot0002* debian2buster  
 
HD(1,GPT,xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,0x800,0x100000)/File(\EFI\debian2buster\shimx64.efi)
Where sda2/sdb2 are the RAID1 set.

Upon boot I'd get 'grub>'.
  
Entering 'set' (under 'grub>') showed 'prefix' as '/EFI/debian'.
Running  grep -l '/EFI/debian' /boot/efi1/EFI/debian1buster/* 
returned 'grubx64.efi'.
Leading me to believe that grub-install is not honoring the
--bootloader-id parameter when grubx64.efi is built.
 
 
My temporary solution was to copy
   /boot/efi1/EFI/debian1buster  to  /boot/efi1/EFI/debian
and
   /boot/efi2/EFI/debian2buster  to  /boot/efi2/EFI/debian
and now the system will boot properly.


Without knowing the particulars of Grub, it was a little surprising
that grub-install sets prefix in the first place; before it read
the grub.cfg file in current directory (/boot/efi1/EFI/debian1buster/).

I wonder if BOOTX64.CSV should be effected to prevent both of
the efi1/efi2 entries to be "shimx64.efi,debian,,This is the boot entry
for debian"; such that the ',debian,' should be the --bootloader-id
value as well.


I also wish that my 'debian1buster' entry would stop getting deleted
from EFI. I haven't figured out who to blame yet.

#984759#10
Date:
2021-03-08 14:00:13 UTC
From:
To:
It would seem that *not* setting the prefix in grubx64.efi would be a
better solution as long as the current directory is the one containing
the grubx64.efi file, such that the grub.cfg is right there ready to be
processed. That would eliminate embedding a path in grubx64.efi.