In the need to enter the UEFI firmware setup utility while using ultra fast boot (keyboard drivers are not loaded during POST), I wish to write to the "Os Indications" efi variable. My OS is Ubuntu 14.04 kernel 3.13.0-35-generic.
OsIndicationsvariable returns a UINT64 bitmask
OsIndicationsSupportedvariable returns a UINT64 bitmaskThe
EFI_OS_INDICATIONS_BOOT_TO_FW_UIbit can be set in the OsIndicationsSupported variable by the firmware, if the firmware supports OS requests to stop at a firmware user interface. TheEFI_OS_INDICATIONS_BOOT_TO_FW_UIbit can be set by the OS in the OsIndications variable, if the OS desires for the firmware to stop at a firmware user interface on the next boot.
EFI_OS_INDICATIONS_BOOT_TO_FW_UI=0x0000000000000001- Page 312 of UEFI spec 2.3.1C
My firmware has the ability to enter the firmware setup utility at next boot:
$ hexdump /sys/firmware/efi/vars/OsIndicationsSupported-8be4df61-93ca-11d2-aa0d-00e098032b8c/data
0000000 0001 0000 0000 0000
0000008
I can create a new variable on /sys/firmware/efi/efivars using
$ printf\x07\x00\x00\x00\x00" > myvar-12345678-1234-1234-1234-123456789abc
However writing to the efi variable OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c results in all sorts of write error: Invalid argument:
Using new efivarfs
# printf "x00\x00\x00\x01" > /sys/firmware/efi/efivars/OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c
-bash: printf: write error: Invalid argument
# printf "x00\x00\x00\x01" > /sys/firmware/efi/efivars/OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c
-bash: printf: write error: Invalid argument
# printf "\x01" > /sys/firmware/efi/efivars/OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c
-bash: printf: write error: Invalid argument
# cat enter-uefi-fw > /sys/firmware/efi/efivars/OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c
cat: write error: Invalid argument
Using old 1024 byte maximum sysfs-efivars
# cat enter-uefi-fw > /sys/firmware/efi/vars/OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c/raw_var
cat: write error: Input/output error
# cat enter-uefi-fw > /sys/firmware/efi/vars/new_var
cat: write error: Invalid argument
# echo 'enter-uefi-fw' > /sys/firmware/efi/vars/OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c/raw_var
-bash: echo: write error: Invalid argument
# printf "\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" > /sys/firmware/efi/vars/OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c/raw_var
-bash: printf: write error: Invalid argument
Checked the requirements for UEFI variables support to work properly
- EFI Runtime Services support should be present in the kernel
$ cat /boot/config-$(uname -r) | grep CONFIG_EFI=yreturnsCONFIG_EFI=y - Kernel processor bitness/arch and EFI processor bitness/arch should match
? - Kernel should be booted in EFI mode
CSM is disabled in Firmware setup utility/BIOS - EFI runtime services in the kernel should not be disabled via kernel cmdline, i.e. noefi kernel parameter should not be used.
cat /proc/cmdline | grep EFIreturns nothing - efivarfs filesystem should be mounted at /sys/firmware/efi/efivars
mount | grep efivarsreturnsnone on /sys/firmware/efi/efivars type efivarfs (rw) efivar -lshould list the EFI Variables without any error
The command lists 82 lines and no errors.- Check for existence of /sys/firmware/efi/efivars/dump-* files.
No dump- files exist there.
According to https://ask.fedoraproject.org/en/question/8264/after-installing-fedora-i-cant-open-biosefi-setup/?answer=16402#post-id-16402 the cat enter-uefi-fw > /sys/firmware/efi/vars/new_var command should work in Fedora 17.
First deleting OsIndications doesn't improve
# rm -rv /sys/firmware/efi/efivars/OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c
removed '/sys/firmware/efi/efivars/OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c'
# ls -l enter-uefi-fw
-rw-r--r-- 1 root root 2084 Aug 25 20:23 enter-uefi-fw
# cat enter-uefi-fw > /sys/firmware/efi/vars/new_var
cat: write error: Invalid argument
How can I update the already existing OsIndications efi variable in Ubuntu 14.04 (trusty) from the command-line?