mirror of
https://github.com/Metabolix/HackBGRT.git
synced 2026-09-27 22:41:21 -07: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:
+3
-2
@@ -403,10 +403,11 @@ public class Efi {
|
|||||||
Setup.Log($"Read EFI variable: {bootOrder}");
|
Setup.Log($"Read EFI variable: {bootOrder}");
|
||||||
Setup.Log($"Read EFI variable: {bootCurrent}");
|
Setup.Log($"Read EFI variable: {bootCurrent}");
|
||||||
var bootOrderInts = new List<UInt16>(BytesToUInt16s(bootOrder.Data));
|
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));
|
var entry = GetVariable(String.Format("Boot{0:X04}", num));
|
||||||
if (entry.Data == null) {
|
if (entry.Data == null) {
|
||||||
if (ownEntry == null) {
|
// Use only Boot0000 .. Boot00FF because some firmwares expect that.
|
||||||
|
if (ownEntry == null && num < 0x100) {
|
||||||
ownNum = num;
|
ownNum = num;
|
||||||
ownEntry = entry;
|
ownEntry = entry;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user