rhboot / efibootmgr

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

Fix insertion location on certain index #182

Closed kamillo closed 1 year ago

kamillo commented 1 year ago

I've found the following issues with adding boot entries at particular index, this pull request fixes both of them:

  1. Short index option (-I) isn't recognized. Using short option like this: > sudo efibootmgr -c -d /dev/sda -p 1 -I 2 return the following error: efibootmgr: invalid option -- 'I'

  2. In some cases using --index causes segmentation fault. This happens when the passed index is greater than current boot order size. Size of the order entry size (uint16_t) hasn't been taken into account in all places.

kamillo commented 1 year ago

Thanks for you remarks. I've updated the commit messages, I hope it's more descriptive now.