rhboot / efibootmgr

efibootmgr development tree
GNU General Public License v2.0
514 stars 97 forks source link

efibootmgr --remove-dups does not work #125

Closed raharper closed 4 years ago

raharper commented 4 years ago

== Steps to reproduce ===

  1. install grub-efi to the ESP
  1. Add a second entry pointing to the same esp efibootmgr --create --write-signature --label ubuntu --disk /dev/vda --part 1 --loader \EFI\ubuntu\shimx64.efi efibootmgr: Warning : Boot0001 has same label ubuntu Timeout: 0 seconds BootOrder: 0002,0001,0000 Boot0000 UiApp Boot0001 ubuntu Boot0002* ubuntu

  2. Show verbose entrys

    • efibootmgr --verbose Timeout: 0 seconds BootOrder: 0002,0001,0000 Boot0000 UiApp FvVol(7cb8bdc9-f8eb-4f34-aaea-3ee4af6516a1)/FvFile(462caa21-7614-4503-836e-8ab6f4662331) Boot0001 ubuntu HD(1,GPT,55dbc307-5953-4693-b640-e2199025db67,0x800,0xff800)/File(\EFI\ubuntu\shimx64.efi) Boot0002* ubuntu HD(1,GPT,55dbc307-5953-4693-b640-e2199025db67,0x800,0xff800)/File(\EFI\ubuntu\shimx64.efi)
  3. Attempt to remove duplicate

    • efibootmgr --remove-dups Timeout: 0 seconds BootOrder: 0002,0001,0000 Boot0000 UiApp Boot0001 ubuntu Boot0002* ubuntu
  4. Verbose listing

    • efibootmgr -v Timeout: 0 seconds BootOrder: 0002,0001,0000 Boot0000 UiApp FvVol(7cb8bdc9-f8eb-4f34-aaea-3ee4af6516a1)/FvFile(462caa21-7614-4503-836e-8ab6f4662331) Boot0001 ubuntu HD(1,GPT,55dbc307-5953-4693-b640-e2199025db67,0x800,0xff800)/File(\EFI\ubuntu\shimx64.efi) Boot0002* ubuntu HD(1,GPT,55dbc307-5953-4693-b640-e2199025db67,0x800,0xff800)/File(\EFI\ubuntu\shimx64.efi)

https://bugs.launchpad.net/ubuntu/+source/efibootmgr/+bug/1863015

This does not work on 15-1 nor 17-1.

raharper commented 4 years ago

It turns out that --remove-dupes operates only on the BootOrder value itself, not against the entries.

root@ubuntu:/home/ubuntu# efibootmgr -v --bootorder 0,1,2,2,2
BootNext: 0001
Timeout: 0 seconds
BootOrder: 0000,0001,0002,0002,0002
Boot0000* UiApp FvVol(7cb8bdc9-f8eb-4f34-aaea-3ee4af6516a1)/FvFile(462caa21-7614-4503-836e-8ab6f4662331)
Boot0001* ubuntu        HD(1,GPT,ca2f6698-41ad-45df-812a-6aa744d7ddfb,0x800,0xff800)/File(\EFI\ubuntu\shimx64.efi)
Boot0002* ubuntu        HD(1,GPT,ca2f6698-41ad-45df-812a-6aa744d7ddfb,0x800,0xff800)/File(\EFI\ubuntu\shimx64.efi)
root@ubuntu:/home/ubuntu# efibootmgr -v -D 
BootNext: 0001
Timeout: 0 seconds
BootOrder: 0000,0001,0002
Boot0000* UiApp FvVol(7cb8bdc9-f8eb-4f34-aaea-3ee4af6516a1)/FvFile(462caa21-7614-4503-836e-8ab6f4662331)
Boot0001* ubuntu        HD(1,GPT,ca2f6698-41ad-45df-812a-6aa744d7ddfb,0x800,0xff800)/File(\EFI\ubuntu\shimx64.efi)
Boot0002* ubuntu        HD(1,GPT,ca2f6698-41ad-45df-812a-6aa744d7ddfb,0x800,0xff800)/File(\EFI\ubuntu\shimx64.efi)