mirror of
https://github.com/Metabolix/HackBGRT.git
synced 2025-12-06 17:15:42 -08:00
Don't create entries higher than Boot00FF
Apparently Boot20## are sometimes reserved for firmware even if they seem to be free. Boot00## is the normal place to be.
This commit is contained in:
@@ -403,10 +403,11 @@ public class Efi {
|
||||
Setup.Log($"Read EFI variable: {bootOrder}");
|
||||
Setup.Log($"Read EFI variable: {bootCurrent}");
|
||||
var bootOrderInts = new List<UInt16>(BytesToUInt16s(bootOrder.Data));
|
||||
foreach (var num in BytesToUInt16s(bootCurrent.Data).Concat(bootOrderInts).Concat(Enumerable.Range(0, 0xffff).Select(i => (UInt16) i))) {
|
||||
foreach (var num in BytesToUInt16s(bootCurrent.Data).Concat(bootOrderInts).Concat(Enumerable.Range(0, 0xff).Select(i => (UInt16) i))) {
|
||||
var entry = GetVariable(String.Format("Boot{0:X04}", num));
|
||||
if (entry.Data == null) {
|
||||
if (ownEntry == null) {
|
||||
// Use only Boot0000 .. Boot00FF because some firmwares expect that.
|
||||
if (ownEntry == null && num < 0x100) {
|
||||
ownNum = num;
|
||||
ownEntry = entry;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user