Biosias / uefi-mkconfig

grub-mkconfig inspired script for automatically managing uefi entries for booting linux kernel directly without bootloader
Apache License 2.0
7 stars 3 forks source link

Replace entire entry deletion logic with a simple wipe #6

Closed Biosias closed 2 months ago

Biosias commented 2 months ago

Well this was a surprising realization. 1/3 of the code, entire logic for choosing what to delete is useless and I was able to delete it.

The only thing that changed by this is that all uefi entries within our managed range are regenerated every time uefi-mkconfig is ran.

This even fixes the issue from #5

AndrewAmmerlaan commented 2 months ago

This even fixes the issue from https://github.com/Biosias/uefi-mkconfig/issues/5

Do I understand correctly then that the issue in #5 relates to the order in which entries are created and that the sorting does sort the .old entries in the correct order (i.e. after the new entry)?

Biosias commented 2 months ago

Not sure yet how I feel about re-generating the full list every time. I suppose it is simpler then setting the BootOrder to our sorting order, and it also has the advantage of propagating configuration changes to all old entries. So perhaps this is the best approach, I'm just a bit worried that we are now removing "known good" entries when the kernel is upgraded, which might increase the chance of ending up with a system where there are no working entries. For example, if I change the cmdline in a wrong way, now all my entries are wrong and none of them work anymore.

If you change cmdline arguments, all entries will be regenerated even in the current released version.

Biosias commented 2 months ago

That is the funny part, nothing has changed. Everything this new version does, was already being done by the released version, just in a more convoluted way.

Biosias commented 2 months ago

Done