×
Menu
Index

GETUEFIVAR Subroutine

 
Usage:
binvar = UEFIGETVAR(varname, namespaceguid)
 
Description:
Retrieve a UEFI firmware variable (variables are case sensitive) and its attributes in binvar.attributes. This subroutine is only available when the system booted using UEFI. In linux, the efivarfs must be mounted at
/sys/firmware/efi/efivars. The linux command to mount is: mount -t efivarfs none /sys/firmware/efi/efivars. On failure the returned binvar is zero bytes in length and contains a member binvar.errno to indicate the error code.
 
Example:
sub main()
   t = getuefivar("Timeout", "{8BE4DF61-93CA-11D2-AA0D-00E098032B8C}")
   if (len(t) > 0) then
     printl("Boot Timeout = ", t)
   else
     printl("Unable to retrieve Boot Timeout. Error:", t.errno)
     t = ""   // remove variable
   end if
end sub