UEFI Boot options are Reset after unpluging USB Key

1

First of all, I hope I am on the right place to ask my question. I believe it deals with Hardware configuration & firmware.

I will give you the context of my problem:
So, I have played with UEFI Programming and the EDK2 environment since a few weeks on my work laptop (a Lenovo legion Y520), and I have wrote a UEFI Application that search for a specific .efi file, and if it finds it, it will add it in the NVRAM, as a new entry boot. Let's call it "the Loader", it will be easier this way. After a few days of works the Loader works correctly. I also have routines for deleting the entry, printing all Boot Entry from the NVRAM.

To use my application and check if it works, I boot on a USB Key where i have a EFI Shell app file, and the Loader .efi file. Once i enter in the EFI Shell, i just run the Loader, and the new boot entry is created. I also use the bcfg command from the EFI Shell to check one more time that everything is ok. And indeed, everything looks good: both the Loader and the bcfg command show that i have add a new boot entry.

My problem is the following: I can reboot, shutdown, boot on windows and then reboot, ... All those actions do not change the boot entries. However, once i unplug the USB Key where i was booting on, (i guess that) the NVRAM is reset, because the new boot entry have disappeared. I believe that my program do not fail, because adding a new entry with bcfg result in the same behavior.

Does someone know what is happening here ? I think that the Lenovo firmware is responsible of this behavior, but I can't be sure of that, and I don't know where I should search for information. Any help would be welcomed.

Julien Hache

Posted 2019-03-07T14:26:03.770

Reputation: 11

No answers