You are not logged in.

#1 2017-08-28 18:33:28

Fallback
Member
From: Austria
Registered: 2009-12-26
Posts: 25

[Solved] systemd-boot, no timeout, no select menu - LoaderEntryDefault

I cannot select a kernel or have a timeout to do so. I think I have accidently pressed d  some time ago in the boot menu and set a default one. Editing /boot/loader/loader.conf makes no diffrence, it always boots directly in the kernel. I want to change this behavior...

I researched this problem back to this:
https://github.com/systemd/systemd/issues/5739
https://github.com/NixOS/nixpkgs/issues/28445

Have anyone a idea how to change or reset the efi variables manuelly ?

 efivar -l
4a67b082-0a4c-41cf-b6c7-440b29bb8c4f-LoaderTimeExecUSec
4a67b082-0a4c-41cf-b6c7-440b29bb8c4f-LoaderEntrySelected
4a67b082-0a4c-41cf-b6c7-440b29bb8c4f-LoaderImageIdentifier
4a67b082-0a4c-41cf-b6c7-440b29bb8c4f-LoaderDevicePartUUID
4a67b082-0a4c-41cf-b6c7-440b29bb8c4f-LoaderFirmwareType
4a67b082-0a4c-41cf-b6c7-440b29bb8c4f-LoaderFirmwareInfo
4a67b082-0a4c-41cf-b6c7-440b29bb8c4f-LoaderInfo
4a67b082-0a4c-41cf-b6c7-440b29bb8c4f-LoaderTimeInitUSec
2781600e-9df9-4ef8-a5a4-66501ae55c41-ASR_TIMERSMI
1b838190-4625-4ead-abc9-cd5e6af18fe0-HiiDB
7b77fb8b-1e0d-4d7e-953f-3980a261e077-AfterReadyToBoot
8be4df61-93ca-11d2-aa0d-00e098032b8c-BootCurrent
ec87d643-eba4-4bb5-a1e5-3f3e36b20da9-AmiGopPolicySetupData
8be4df61-93ca-11d2-aa0d-00e098032b8c-LangCodes
8be4df61-93ca-11d2-aa0d-00e098032b8c-PlatformLangCodes
8be4df61-93ca-11d2-aa0d-00e098032b8c-ErrOutDev
8be4df61-93ca-11d2-aa0d-00e098032b8c-BootOptionSupport
8be4df61-93ca-11d2-aa0d-00e098032b8c-ConInDev
560bf58a-1e0d-4d7e-953f-2980a261e031-PNP0510_0_VV
560bf58a-1e0d-4d7e-953f-2980a261e031-PNP0400_0_VV
560bf58a-1e0d-4d7e-953f-2980a261e031-PNP0604_0_VV
560bf58a-1e0d-4d7e-953f-2980a261e031-PNP0501_1_VV
560bf58a-1e0d-4d7e-953f-2980a261e031-PNP0501_0_VV
8be4df61-93ca-11d2-aa0d-00e098032b8c-ConOutDev
c811fa38-42c8-4579-a9bb-60e94eddfb34-USB_POINT
ec87d643-eba4-4bb5-a1e5-3f3e36b20da9-UsbMassDevValid
ec87d643-eba4-4bb5-a1e5-3f3e36b20da9-UsbMassDevNum
8be4df61-93ca-11d2-aa0d-00e098032b8c-OsIndicationsSupported
ec87d643-eba4-4bb5-a1e5-3f3e36b20da9-EzConfigData
ec87d643-eba4-4bb5-a1e5-3f3e36b20da9-NBPlatformData
ec87d643-eba4-4bb5-a1e5-3f3e36b20da9-AcpiAslPtr
ec87d643-eba4-4bb5-a1e5-3f3e36b20da9-SetupPlatformData
01368881-c4ad-4b1d-b631-d57a8ec8db6b-OA3MSDMvariable
ec87d643-eba4-4bb5-a1e5-3f3e36b20da9-GoodNightLed
e6c2f70a-b604-4877-85ba-deec89e117eb-PchS3Peim
4bafc2b4-02dc-4104-b236-d6f1b98d9e84-S3SS
8be4df61-93ca-11d2-aa0d-00e098032b8c-SetupMode
8be4df61-93ca-11d2-aa0d-00e098032b8c-SecureBoot
8be4df61-93ca-11d2-aa0d-00e098032b8c-SignatureSupport
8be4df61-93ca-11d2-aa0d-00e098032b8c-Boot000A
8be4df61-93ca-11d2-aa0d-00e098032b8c-Boot000B
8be4df61-93ca-11d2-aa0d-00e098032b8c-Boot0000
8be4df61-93ca-11d2-aa0d-00e098032b8c-BootOrder
4a67b082-0a4c-41cf-b6c7-440b29bb8c4f-LoaderConfigTimeout
01368881-c4ad-4b1d-b631-d57a8ec8db6b-MonotonicCounter
eaec226f-c9a3-477a-a826-ddc716cdc0e3-OfflineUniqueIDRandomSeedCRC
eaec226f-c9a3-477a-a826-ddc716cdc0e3-OfflineUniqueIDRandomSeed
8be4df61-93ca-11d2-aa0d-00e098032b8c-Boot0006
8be4df61-93ca-11d2-aa0d-00e098032b8c-Boot0002
d8944553-c4dd-41f4-9b30-e1397cfb267b-D050990AFE13
8be4df61-93ca-11d2-aa0d-00e098032b8c-Boot0009
77fa9abd-0359-4d32-bd60-28f4e78f784b-CurrentPolicy
a9b5f8d2-cb6d-42c2-bc01-b5ffaae4335e-PBRDevicePath
8be4df61-93ca-11d2-aa0d-00e098032b8c-Boot0001
8be4df61-93ca-11d2-aa0d-00e098032b8c-Timeout
d1405d16-7afc-4695-bb12-41459d3695a2-NetworkStackVar
7b77fb8b-1e0d-4d7e-953f-3980a261e077-IccAdvancedSetupDataVar
ec87d643-eba4-4bb5-a1e5-3f3e36b20da9-ASRockTimerSmiData
ec87d643-eba4-4bb5-a1e5-3f3e36b20da9-UsbSupport
c811fa38-42c8-4579-a9bb-60e94eddfb34-AMITSESetup
8be4df61-93ca-11d2-aa0d-00e098032b8c-PlatformLang
8be4df61-93ca-11d2-aa0d-00e098032b8c-OsIndications
4c19049f-4137-4dd3-9c10-8b97a83ffdfa-MemoryTypeInformation
4c19049f-4137-4dd3-9c10-8b97a83ffdfa-PreviousMemoryTypeInformation
ec87d643-eba4-4bb5-a1e5-3f3e36b20da9-HddBootDev
8be4df61-93ca-11d2-aa0d-00e098032b8c-Boot_Dev_name
c020489e-6db2-4ef2-9aa5-ca06fc11d36a-AcpiGlobalVariable
af9ffd67-ec10-488a-9dfc-6cbf5ee22c2e-AcpiGlobalVariable
1bad711c-d451-4241-b1f3-8537812e0c70-MeBiosExtensionSetup
d54f49f6-0dd4-4276-b09c-dfe1fd8085f0-PetAlertCfg
ec87d643-eba4-4bb5-a1e5-3f3e36b20da9-IccLockDefault
7b77fb8b-1e0d-4d7e-953f-3980a261e076-TdtAdvancedSetupDataVar
8be4df61-93ca-11d2-aa0d-00e098032b8c-Lang
45cf35f6-0d6e-4d04-856a-0370a5b16f53-DefaultBootOrder
3c4ead08-45ae-4315-8d15-a60eaa8caf69-DefaultLegacyDevOrder
a56074db-65fe-45f7-bd21-2d2bdd8e9652-OldLegacyDevOrder
a56074db-65fe-45f7-bd21-2d2bdd8e9652-LegacyDevOrder
8be4df61-93ca-11d2-aa0d-00e098032b8c-ErrOut
8be4df61-93ca-11d2-aa0d-00e098032b8c-ConIn
8be4df61-93ca-11d2-aa0d-00e098032b8c-ConOut
560bf58a-1e0d-4d7e-953f-2980a261e031-PNP0510_0_NV
560bf58a-1e0d-4d7e-953f-2980a261e031-PNP0400_0_NV
560bf58a-1e0d-4d7e-953f-2980a261e031-PNP0604_0_NV
560bf58a-1e0d-4d7e-953f-2980a261e031-PNP0501_1_NV
560bf58a-1e0d-4d7e-953f-2980a261e031-PNP0501_0_NV
40312829-7891-4abd-b200-0c541b061939-MemCeil.
ec87d643-eba4-4bb5-a1e5-3f3e36b20da9-SetupAmtFeatures
368cda0d-cf31-4b9b-8cf6-e7d1bfff157e-ConsoleLock
a31b27a4-cae6-48ff-8c5a-294221e6f389-PchInitPei
4b3082a3-80c6-4d7e-9cd0-583917265df1-WriteOnceStatus
ec87d643-eba4-4bb5-a1e5-3f3e36b20da9-ASR_USER_DEF_VER
ec87d643-eba4-4bb5-a1e5-3f3e36b20da9-ASR_USER_DEF_TSE
ec87d643-eba4-4bb5-a1e5-3f3e36b20da9-Boot_Last_Device
ec87d643-eba4-4bb5-a1e5-3f3e36b20da9-Q_ASR_QUICKON
01f33c25-764d-43ea-aeea-6b5a41f3f3e8-SbAslBufferPtrVar
87f22dcb-7304-4105-bb7c-317143ccc23b-MrcS3Resume
ec87d643-eba4-4bb5-a1e5-3f3e36b20da9-NumOfPState
1456cc6e-22ac-5289-33ba-2e13bbdabaee-CPUS3APICID
8be4df61-93ca-11d2-aa0d-00e098032b8c-LoadSetupDefault
f3ed95df-828e-41c7-bca0-16c41965a634-TcgInternalSyncFlag
ec87d643-eba4-4bb5-a1e5-3f3e36b20da9-Setup
01368881-c4ad-4b1d-b631-d57a8ec8db6b-FPDT_Variable
e6c2f70a-b604-4877-85ba-deec89e117eb-PchInit
78ce2354-cfbc-4643-aeba-07a27fa892bf-WdtPersistentData
dde1bc72-d45e-4209-ab85-14462d2f5074-HobRomImage
8f132913-6907-4192-a227-6cbcd7a50e6c-NetConfigData
4b3082a3-80c6-4d7e-9cd0-583917265df1-DmiVar0200020700
4b3082a3-80c6-4d7e-9cd0-583917265df1-DmiArray
8f132913-6907-4192-a227-6cbcd7a50e6c-StageChk
4599d26f-1a11-49b8-b91f-858745cff824-StdDefaults

Last edited by Fallback (2017-08-30 17:35:34)

Offline

#2 2017-08-28 19:07:56

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 27,319
Website

Re: [Solved] systemd-boot, no timeout, no select menu - LoaderEntryDefault

Please use code tags when pasting to the boards: https://wiki.archlinux.org/index.php/Co … s_and_code


Arch + dwm   •   Mercurial repos  •   Github

Registered Linux User #482438

Offline

#3 2017-08-28 20:39:33

Blasphemist
Member
From: Colorado
Registered: 2013-01-17
Posts: 160

Re: [Solved] systemd-boot, no timeout, no select menu - LoaderEntryDefault

What is the output of:

$ efibootmgr -v

The info from efivar doesn't help me other than to show you are in UEFI mode.

Please also post the output of:

$ bootctl status

This will show what bootctl sees.

Your description of the problem and posting the efi variables confuses me as to whether you are actually using bootctl or are instead configured to have UEFI launch the kernel directly. The efibootmgr command above will clear that up. If your mount point for the ESP is /boot, you do seem to be using the right config file for bootctl so my guess is you are launching the kernel directly from UEFI. If you already do have a boot entry in UEFI for bootctl, you can use efibootmgr to change the boot order. See the efibootmgr man page for an example or ask here if you do need the command. It may be that you need to the bootctl install command or if that has been done and it seems it might have, just use efibootmgr to create a new boot entry for it.


Simple and Open

Offline

#4 2017-08-28 21:39:59

Fallback
Member
From: Austria
Registered: 2009-12-26
Posts: 25

Re: [Solved] systemd-boot, no timeout, no select menu - LoaderEntryDefault

efibootmgr   
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0001,0002,000A,0000,0009,0006
Boot0000* Linux Boot Manager
Boot0001* Windows Boot Manager
Boot0002* CD/DVD Drive 
Boot0006  Hard Drive 
Boot0009  Network Card 
Boot000A* USB 
efibootmgr -v
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0001,0002,000A,0000,0009,0006
Boot0000* Linux Boot Manager	HD(1,GPT,fd2c7f40-6a99-4219-b00f-43eea660228f,0x800,0x12c000)/File(\EFI\systemd\systemd-bootx64.efi)
Boot0001* Windows Boot Manager	HD(2,GPT,97fce92f-afb5-400e-bede-700ca33d91d3,0xe1800,0x32000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}....................
Boot0002* CD/DVD Drive 	BBS(CDROM,,0x0)..GO..NO........o.H.L.-.D.T.-.S.T. .D.V.D.R.A.M. .G.H.2.4.N.S.B.0....................A...........................>..Gd-.;.A..MQ..L.D.K.E.C.O.2.5.G.3.0. .1. . . . . . . . ........BO
Boot0006  Hard Drive 	BBS(HD,,0x0)..GO..NO........o.C.r.u.c.i.a.l._.C.T.5.1.2.M.X.1.0.0.S.S.D.1....................A...........................>..Gd-.;.A..MQ..L. . . . . . . . .4.1.2.3.C.0.9.E.A.1.1.4........BO..NO........o.M.K.N.S.S.D.R.E.4.8.0.G.B.-.3.D....................A...........................>..Gd-.;.A..MQ..L.K.M.7.1.4.0.7.0.0.1.3.0.1.5.B.B. .F. . ........BO..NO........o.T.O.S.H.I.B.A. .D.T.0.1.A.C.A.3.0.0....................A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . .1. .I.4.P.N.K.4.S.G........BO
Boot0009  Network Card 	BBS(Network,,0x0)..GO..NO........q.I.B.A. .G.E. .S.l.o.t. .0.0.C.8. .v.1.4.1.0.........................rN.D+..,.\...........B..Gd-.;.A..MQ..L.I.B.A. .G.E. .S.l.o.t. .0.0.C.8. .v.1.4.1.0........BO
Boot000A* USB 	BBS(USB,,0x0)..GO..NO........{.L.i.n.u.x. .F.i.l.e.-.C.D. .G.a.d.g.e.t. .0.4.0.1....................A.............................H..Gd-.;.A..MQ..L.L.i.n.u.x. .F.i.l.e.-.C.D. .G.a.d.g.e.t. .0.4.0.1........BO
bootctl status
Using EFI System Partition at /boot.
System:
     Firmware: UEFI 2.31 (American Megatrends 4.654)
  Secure Boot: disabled
   Setup Mode: setup

Current Loader:
      Product: systemd-boot 234
          ESP: /dev/disk/by-partuuid/fd2c7f40-6a99-4219-b00f-43eea660228f
         File: └─/EFI/systemd/systemd-bootx64.efi

Boot Loader Binaries:
          ESP: /boot (/dev/disk/by-partuuid/fd2c7f40-6a99-4219-b00f-43eea660228f)
         File: └─/EFI/systemd/systemd-bootx64.efi (systemd-boot 234)
         File: └─/EFI/BOOT/BOOTX64.EFI (systemd-boot 234)

Boot Loader Entries in EFI Variables:
        Title: Windows Boot Manager
           ID: 0x0001
       Status: active, boot-order
    Partition: /dev/disk/by-partuuid/97fce92f-afb5-400e-bede-700ca33d91d3
         File: └─/EFI/Microsoft/Boot/bootmgfw.efi

        Title: Linux Boot Manager
           ID: 0x0000
       Status: active, boot-order
    Partition: /dev/disk/by-partuuid/fd2c7f40-6a99-4219-b00f-43eea660228f
         File: └─/EFI/systemd/systemd-bootx64.efi

config files

cat /boot/loader/loader.conf


default  arch
timeout  5

some boot entries in /boot/loader/entries/

cat /boot/loader/entries/arch.conf
title Arch Linux
linux vmlinuz-linux
# initrd intel-ucode.img
initrd initramfs-linux.img 
options cryptdevice=/dev/sda2:main:allow-discards root=/dev/mapper/main-root rw lang=de locale=de_DE.UTF-8 resume=/dev/mapper/main-swap ip=:::::enp0s25:dhcp

# cat /boot/loader/entries/arch-fallback.conf 
title Arch Linux Fallback
linux /EFI/arch/vmlinuz-linux
# initrd /EFI/arch/intel-ucode.img
initrd /EFI/arch/initramfs-linux-fallback.img 
options cryptdevice=/dev/sda2:main:allow-discards root=/dev/mapper/main-root ro lang=de locale=de_DE.UTF-8 resume=/dev/mapper/main-swap

# cat /boot/loader/entries/arch-zen.conf     
title Arch Linux Zen
linux vmlinuz-linux-zen
# initrd intel-ucode.img
initrd initramfs-linux-zen.img
options cryptdevice=/dev/sda2:main:allow-discards root=/dev/mapper/main-root rw lang=de locale=de_DE.UTF-8 resume=/dev/mapper/main-swap ip=:::::enp0s25:dhcp

Just to be sure but still no systemd-boot menu for kernel selection. The system boots directly to the kernel and promts the cryptsetup phasephrase dialog.

The straige thing is that the setup was working ....

bootctl install
Using EFI System Partition at /boot.
Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/boot/EFI/systemd/systemd-bootx64.efi".
Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/boot/EFI/BOOT/BOOTX64.EFI".
Created EFI boot entry "Linux Boot Manager".
#
# bootctl update 
Using EFI System Partition at /boot.
Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/boot/EFI/systemd/systemd-bootx64.efi".
Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/boot/EFI/BOOT/BOOTX64.EFI".

Offline

#5 2017-08-30 15:09:58

Blasphemist
Member
From: Colorado
Registered: 2013-01-17
Posts: 160

Re: [Solved] systemd-boot, no timeout, no select menu - LoaderEntryDefault

I'm going to start making notes about what this shows me and if it leads me to something I may move the notes around to make it easier to follow.

My UEFI boot manager timeout is 5 seconds and yours is one as shown by efibootmgr but it seems this only controls a wait time until the boot option is chosen by UEFI from bootnext or bootorder. I'll change that on mine and shorten the time I thought was all hardware init. I could delete the timeout but I'll just change mine to 1 second for now. Tested, 1 second timeout works great for me, saves 4 seconds before the boot option is selected by UEFI.

Your bootorder is as follows:

  1. Windows Boot Manager

  2. CD/DVD Drive

  3. USB

  4. Bootctl/Linux Boot Manager

  5. Network

  6. Hard Disk Default

This is how should be working. With no interference from you accessing the built in UEFI boot manager, windows should boot if it still exists. If it doesn't that boot entry should be deleted. Next, if a CD/DVD is in the drive and bootable it should boot. Next, the same for a bootable USB. Next comes bootctl/Linux Boot Loader. Network boot is next and last is the default UEFI boot location on the hard drive. Your current boot shows that the installed bootctl boot loader is what booted, not the hard drive default. I set up my system like your two timeouts, the UEFI timeout of 1 second and the bootctl timeout of 5 seconds. I booted via bootctl and did get the 5 second timeout with the bootctl menu up.

I don't see the problems cause. You have some apparent boot entries in bootctl that don't have corresponding entries in UEFI but that isn't the issue even if I'd ensure you have entries for each real boot option in UEFI and /boot/loader/entries. If windows still exists I'd get it showing up in bootctl or if it doesn't I'd remove it from the UEFI variables using efibootmgr. That isn't the problem though either. Other than the encryption that you have and I don't, the only difference I see between us is the setup mode shown by bootctl status. Mine is user and yours is setup but I don't know just where that is coming from nor if it has anything to with anything.


Simple and Open

Offline

#6 2017-08-30 17:10:21

Fallback
Member
From: Austria
Registered: 2009-12-26
Posts: 25

Re: [Solved] systemd-boot, no timeout, no select menu - LoaderEntryDefault

The problem is that the timeout from bootctl isn't working and is ignoring the timeout set in /boot/loader/loader.conf . Manuel chosing the (UEFI) entry with the BIOS by pressing F11 is working. There is also a second Windows OS on the other drive that works well. I only want this timeout to be able to chose my favorite kernel because I don't see the menu.

I think my timeout is set to zero somewhere in a EFI variable caused by pressing the related key (t/T) or set to a automatic-default entry (d).

related:

t/T     adjust the timeout (stored in a non-volatile EFI variable)

from:
https://www.freedesktop.org/wiki/Softwa … temd-boot/
https://wiki.archlinux.org/index.php/Ta … rification
__________________________________________-

Solved after reading the source code

Hold down + or t immediately while booting the Linux Boot Manager


case KEYPRESS(0, 0, '-'):
  742                 case KEYPRESS(0, 0, 'T'):
  743                         if (config->timeout_sec_efivar > 0) {
  744                                 config->timeout_sec_efivar--;
  745                                 efivar_set_int(L"LoaderConfigTimeout", config->timeout_sec_efivar, TRUE);
  746                                 if (config->timeout_sec_efivar > 0)
  747                                         status = PoolPrint(L"Menu timeout set to %d sec.", config->timeout_sec_efivar);
  748                                 else
  749                                         status = StrDuplicate(L"Menu disabled. Hold down key at bootup to show menu.");
  750                         } else if (config->timeout_sec_efivar <= 0){
  751                                 config->timeout_sec_efivar = -1;
  752                                 efivar_set(L"LoaderConfigTimeout", NULL, TRUE);
  753                                 if (config->timeout_sec_config > 0)
  754                                         status = PoolPrint(L"Menu timeout of %d sec is defined by configuration file.",
  755                                                            config->timeout_sec_config);
  756                                 else
  757                                         status = StrDuplicate(L"Menu disabled. Hold down key at bootup to show menu.");
  758                         }
  759                         break;
  760 
  761                 case KEYPRESS(0, 0, '+'):
  762                 case KEYPRESS(0, 0, 't'):
  763                         if (config->timeout_sec_efivar == -1 && config->timeout_sec_config == 0)
  764                                 config->timeout_sec_efivar++;
  765                         config->timeout_sec_efivar++;
  766                         efivar_set_int(L"LoaderConfigTimeout", config->timeout_sec_efivar, TRUE);
  767                         if (config->timeout_sec_efivar > 0)
  768                                 status = PoolPrint(L"Menu timeout set to %d sec.",
  769                                                    config->timeout_sec_efivar);
  770                         else
  771                                 status = StrDuplicate(L"Menu disabled. Hold down key at bootup to show menu.");
  772                         break;

https://fossies.org/linux/systemd/src/boot/efi/boot.c

thank you for your support smile

Last edited by Fallback (2017-08-30 17:34:56)

Offline

#7 2017-08-30 21:36:03

Blasphemist
Member
From: Colorado
Registered: 2013-01-17
Posts: 160

Re: [Solved] systemd-boot, no timeout, no select menu - LoaderEntryDefault

I do see the hold down + or t to get the menu. After doing that does it always come up now? I don't see a function that is using efibootmgr to write to the UEFI NVRAM though so I'm not sure of it writing to UEFI. Did you follow the code better than I did?


Simple and Open

Offline

#8 2017-08-31 21:03:46

Fallback
Member
From: Austria
Registered: 2009-12-26
Posts: 25

Re: [Solved] systemd-boot, no timeout, no select menu - LoaderEntryDefault

Blasphemist wrote:

I do see the hold down + or t to get the menu. After doing that does it always come up now? I don't see a function that is using efibootmgr to write to the UEFI NVRAM though so I'm not sure of it writing to UEFI. Did you follow the code better than I did?

It uses the function efivar_set() which is from efivar which is a requirement by efibootmgr to write/store variables in the UEFI

when the  EFI variable LoaderConfigTimeout can't be read by efivar_get_int() it returns something else than EFI_SUCCESS 0 (False) [for example EFI_LOAD_ERROR 1 | True because LoaderConfigTimeout dosen't exists )  then config->timeout_sec_efivar will be set to -1 and the value in the loader.conf will be used , if  that is also empty it's set to 10 sec

it seems that if once something is stored in the EFI (LoaderConfigTimeout) that value will be prefered over the value in loader.conf



1141 static VOID config_load_defaults(Config *config, EFI_FILE *root_dir) {
 1142         CHAR8 *content = NULL;
 1143         UINTN sec;
 1144         UINTN len;
 1145         EFI_STATUS err;
 1146 
 1147         len = file_read(root_dir, L"\\loader\\loader.conf", 0, 0, &content);
 1148         if (len > 0)
 1149                 config_defaults_load_from_file(config, content);
 1150         FreePool(content);
 1151 
 1152         err = efivar_get_int(L"LoaderConfigTimeout", &sec);
 1153         if (!EFI_ERROR(err)) {
 1154                 config->timeout_sec_efivar = sec;
 1155                 config->timeout_sec = sec;
 1156         } else
 1157                 config->timeout_sec_efivar = -1;
 1158 }

Offline

Board footer

Powered by FluxBB