mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-15 17:34:43 +00:00
![]() When we store EFI variables on file we don't allow SetVariable at runtime, since the OS doesn't know how to access or write that file. At the same time keeping the U-Boot drivers alive in runtime sections and performing writes from the firmware is dangerous -- if at all possible. For GetVariable at runtime we copy runtime variables in RAM and expose them to the OS. Add a Kconfig option and provide SetVariable at runtime using the same memory backend. The OS will be responsible for syncing the RAM contents to the file, otherwise any changes made during runtime won't persist reboots. It's worth noting that the variable store format is defined in EBBR [0] and authenticated variables are explicitly prohibited, since they have to be stored on a medium that's tamper and rollback protected. - pre-patch $~ mount | grep efiva efivarfs on /sys/firmware/efi/efivars type efivarfs (ro,nosuid,nodev,noexec,relatime) $~ efibootmgr -n 0001 Could not set BootNext: Read-only file system - post-patch $~ mount | grep efiva efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime) $~ efibootmgr -n 0001 BootNext: 0001 BootCurrent: 0000 BootOrder: 0000,0001 Boot0000* debian HD(1,GPT,bdae5610-3331-4e4d-9466-acb5caf0b4a6,0x800,0x100000)/File(EFI\debian\grubaa64.efi) Boot0001* virtio 0 VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,850000001f000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,1600850000000000){auto_created_boot_option} $~ efivar -p -n 8be4df61-93ca-11d2-aa0d-00e098032b8c-BootNext GUID: 8be4df61-93ca-11d2-aa0d-00e098032b8c Name: "BootNext" Attributes: Non-Volatile Boot Service Access Runtime Service Access Value: 00000000 01 00 FWTS runtime results Skipped tests are for SetVariable which is now supported 'Passed' test is for QueryVariableInfo which is not yet supported Test: UEFI miscellaneous runtime service interface tests. Test for UEFI miscellaneous runtime service interfaces 6 skipped Stress test for UEFI miscellaneous runtime service i.. 1 skipped Test GetNextHighMonotonicCount with invalid NULL par.. 1 skipped Test UEFI miscellaneous runtime services unsupported.. 1 passed Test: UEFI Runtime service variable interface tests. Test UEFI RT service get variable interface. 1 passed Test UEFI RT service get next variable name interface. 4 passed Test UEFI RT service set variable interface. 8 passed Test UEFI RT service query variable info interface. 1 skipped Test UEFI RT service variable interface stress test. 2 passed Test UEFI RT service set variable interface stress t.. 4 passed Test UEFI RT service query variable info interface s.. 1 skipped Test UEFI RT service get variable interface, invalid.. 5 passed Test UEFI RT variable services unsupported status. 1 passed, 3 skipped [0] https://arm-software.github.io/ebbr/index.html#document-chapter5-variable-storage Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> |
||
---|---|---|
.. | ||
.gitignore | ||
efi_freestanding.c | ||
efi_miniapp_tcg2_arm.h | ||
efi_miniapp_tcg2_arm64.h | ||
efi_miniapp_tcg2_ia32.h | ||
efi_miniapp_tcg2_riscv32.h | ||
efi_miniapp_tcg2_riscv64.h | ||
efi_miniapp_tcg2_x86_64.h | ||
efi_selftest.c | ||
efi_selftest_bitblt.c | ||
efi_selftest_block_device.c | ||
efi_selftest_config_table.c | ||
efi_selftest_console.c | ||
efi_selftest_controllers.c | ||
efi_selftest_crc32.c | ||
efi_selftest_devicepath.c | ||
efi_selftest_devicepath_util.c | ||
efi_selftest_disk_image.h | ||
efi_selftest_ecpt.c | ||
efi_selftest_esrt.c | ||
efi_selftest_event_groups.c | ||
efi_selftest_events.c | ||
efi_selftest_exception.c | ||
efi_selftest_exitbootservices.c | ||
efi_selftest_fdt.c | ||
efi_selftest_gop.c | ||
efi_selftest_hii.c | ||
efi_selftest_hii_data.c | ||
efi_selftest_load_file.c | ||
efi_selftest_loaded_image.c | ||
efi_selftest_loadimage.c | ||
efi_selftest_manageprotocols.c | ||
efi_selftest_mem.c | ||
efi_selftest_memory.c | ||
efi_selftest_miniapp_exception.c | ||
efi_selftest_miniapp_exit.c | ||
efi_selftest_miniapp_return.c | ||
efi_selftest_open_protocol.c | ||
efi_selftest_register_notify.c | ||
efi_selftest_reset.c | ||
efi_selftest_rng.c | ||
efi_selftest_rtc.c | ||
efi_selftest_set_virtual_address_map.c | ||
efi_selftest_snp.c | ||
efi_selftest_startimage_exit.c | ||
efi_selftest_startimage_return.c | ||
efi_selftest_tcg2.c | ||
efi_selftest_textinput.c | ||
efi_selftest_textinputex.c | ||
efi_selftest_textoutput.c | ||
efi_selftest_tpl.c | ||
efi_selftest_unaligned.c | ||
efi_selftest_unicode_collation.c | ||
efi_selftest_util.c | ||
efi_selftest_variables.c | ||
efi_selftest_variables_runtime.c | ||
efi_selftest_watchdog.c | ||
Kconfig | ||
Makefile |