Ilias Apalodimas
00da8d65a3
efi_loader: add an EFI variable with the file contents
...
Previous patches enabled SetVariableRT using a RAM backend.
Although EBBR [0] defines a variable format we can teach userspace tools
and write the altered variables, it's better if we skip the ABI
requirements completely.
So let's add a new variable, in its own namespace called "VarToFile"
which contains a binary dump of the updated RT, BS and, NV variables
and will be updated when GetVariable is called.
Some adjustments are needed to do that.
Currently we discard BS-only variables in EBS(). We need to preserve
those on the RAM backend that exposes the variables. Since BS-only
variables can't appear at runtime we need to move the memory masking
checks from efi_var_collect() to efi_get_next_variable_name_mem()/
efi_get_variable_mem() and do the filtering at runtime.
We also need an efi_var_collect() variant available at runtime, in order
to construct the "VarToFile" buffer on the fly.
All users and applications (for linux) have to do when updating a variable
is dd that variable in the file described by "RTStorageVolatile".
Linux efivarfs uses a first 4 bytes of the output to represent attributes
in little-endian format. So, storing variables works like this:
$~ efibootmgr -n 0001
$~ dd if=/sys/firmware/efi/efivars/VarToFile-b2ac5fc9-92b7-4acd-aeac-11e818c3130c of=/boot/efi/ubootefi.var skip=4 bs=1
[0] https://arm-software.github.io/ebbr/index.html#document-chapter5-variable-storage
Suggested-by: Ard Biesheuvel <ardb@kernel.org> # dumping all variables to a variable
Co-developed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> # contributed on efi_var_collect_mem()
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-04-20 08:22:24 +02:00
..
2024-03-27 09:22:07 +01:00
2024-03-29 10:39:25 -04:00
2024-04-04 18:48:46 +02:00
2023-09-24 09:54:57 -04:00
2024-01-24 11:12:11 -05:00
2024-04-04 18:48:46 +02:00
2024-03-17 18:39:21 -03:00
2023-05-31 12:31:47 -04:00
2024-02-08 09:17:46 -03:00
2023-11-07 14:50:52 -05:00
2023-11-07 14:49:40 -05:00
2024-04-14 08:49:40 +02:00
2023-10-15 12:23:48 +02:00
2023-11-16 12:43:48 -05:00
2024-01-03 09:22:47 -05:00
2024-03-14 18:19:44 +08:00
2023-10-16 15:46:18 +02:00
2022-10-30 20:07:16 +01:00
2023-12-28 12:02:56 -05:00
2024-04-12 12:57:07 -06:00
2023-12-01 14:06:04 +01:00
2022-12-23 10:07:03 -05:00
2023-08-25 13:54:33 -04:00
2023-11-07 18:36:06 -05:00
2023-07-17 15:39:55 -04:00
2023-04-04 14:50:47 -04:00
2023-08-08 10:22:03 -04:00
2023-08-08 10:22:03 -04:00
2023-12-21 08:54:37 -05:00
2024-02-15 10:38:34 +01:00
2023-04-28 01:30:24 +01:00
2023-04-28 01:30:24 +01:00
2023-04-28 01:30:24 +01:00
2023-04-28 01:30:24 +01:00
2023-11-12 16:47:16 +00:00
2023-11-16 18:59:58 -05:00
2023-04-28 11:30:17 -06:00
2023-10-24 15:55:17 +08:00
2023-11-18 10:08:08 +02:00
2024-02-29 09:24:22 -05:00
2023-11-07 14:50:52 -05:00
2023-12-13 11:51:53 -05:00
2024-03-04 10:25:47 -05:00
2024-04-18 08:29:35 -06:00
2023-08-25 17:55:19 -04:00
2023-12-21 08:54:05 -05:00
2023-12-13 11:51:24 -05:00
2024-02-13 15:38:49 -05:00
2023-10-24 16:34:45 -04:00
2023-11-02 22:38:01 -04:00
2023-08-25 13:54:33 -04:00
2024-03-21 06:56:13 +01:00
2023-12-28 12:02:56 -05:00
2023-10-11 15:43:54 -04:00
2024-01-29 22:35:02 -05:00
2024-01-29 22:35:02 -05:00
2024-01-16 17:05:29 -05:00
2023-09-24 09:54:57 -04:00
2023-05-10 16:45:42 -04:00
2022-12-05 16:06:08 -05:00
2024-01-09 14:58:33 +01:00
2024-03-21 06:56:13 +01:00
2024-03-21 06:56:13 +01:00
2023-11-10 11:01:50 -05:00
2023-10-24 16:34:45 -04:00
2022-11-02 08:42:03 +01:00
2024-01-24 11:12:11 -05:00
2023-11-07 14:50:51 -05:00
2024-04-02 09:08:07 +02:00
2024-04-02 09:08:07 +02:00
2022-12-05 16:06:07 -05:00
2024-01-07 13:45:07 -07:00
2023-07-15 11:20:41 +02:00
2024-04-20 08:22:24 +02:00
2023-11-07 14:50:52 -05:00
2024-04-13 11:03:12 +02:00
2024-04-20 08:22:24 +02:00
2024-04-08 13:03:34 +02:00
2023-02-06 13:04:52 -05:00
2023-07-16 23:13:17 +08:00
2024-04-12 14:53:13 +02:00
2023-05-05 13:41:55 -04:00
2023-12-21 08:54:05 -05:00
2024-01-19 10:57:36 +08:00
2023-10-23 17:07:06 +03:00
2023-10-11 15:43:55 -04:00
2023-11-16 18:53:09 -05:00
2023-10-17 20:50:52 -04:00
2023-05-02 14:23:34 -04:00
2023-05-13 09:52:32 -04:00
2024-04-18 08:29:35 -06:00
2024-04-19 07:28:24 -06:00
2023-11-28 20:10:24 -05:00
2023-04-28 11:30:17 -06:00
2023-12-13 18:39:05 -05:00
2024-01-07 13:45:07 -07:00
2023-05-15 10:00:30 +02:00
2023-11-07 14:50:52 -05:00
2023-09-21 13:20:11 +02:00
2023-01-12 14:06:15 -05:00
2023-11-07 14:50:52 -05:00
2023-01-20 12:27:24 -05:00
2023-01-20 12:27:06 -05:00
2023-11-07 14:50:52 -05:00
2023-11-07 14:50:52 -05:00
2023-11-07 14:50:51 -05:00
2023-11-07 14:50:52 -05:00
2023-11-07 14:50:52 -05:00
2023-11-07 14:50:52 -05:00
2023-01-20 12:27:24 -05:00
2023-06-12 13:24:31 +02:00
2023-06-19 14:34:16 -04:00
2024-01-13 18:17:47 +01:00
2023-11-10 11:01:50 -05:00
2023-12-21 08:54:37 -05:00
2024-04-08 13:04:48 +02:00
2024-01-24 11:12:11 -05:00
2024-01-24 11:12:11 -05:00
2023-10-31 09:08:51 +01:00
2023-04-27 13:51:06 -04:00
2023-07-25 12:44:46 -04:00
2024-04-11 09:38:57 -06:00
2024-04-05 09:39:18 -03:00
2023-07-13 11:29:40 +02:00
2024-02-08 09:01:22 -03:00
2024-03-01 14:44:35 +00:00
2023-09-14 10:42:24 -04:00
2023-11-02 16:22:06 +08:00
2023-12-21 11:59:49 -05:00
2023-11-07 14:50:52 -05:00
2023-08-19 04:12:53 +02:00
2023-11-10 11:01:50 -05:00
2024-03-13 10:10:04 -04:00
2024-03-13 10:10:04 -04:00
2023-11-07 14:50:52 -05:00
2023-12-13 11:35:13 -05:00
2023-11-07 14:50:52 -05:00
2022-10-30 20:07:17 +01:00
2023-04-04 12:24:29 -04:00
2023-08-15 18:21:17 +02:00
2024-03-02 12:26:56 -05:00
2024-01-07 13:45:07 -07:00
2023-04-07 14:21:37 +02:00
2024-04-12 16:23:06 -06:00
2023-12-21 08:54:37 -05:00
2024-01-09 14:58:33 +01:00
2023-10-11 15:43:55 -04:00
2023-11-07 14:50:52 -05:00
2023-08-08 10:22:03 -04:00
2024-04-15 15:19:12 +09:00
2023-11-07 14:50:51 -05:00
2022-12-05 16:06:08 -05:00
2023-11-10 11:01:50 -05:00
2023-11-10 11:01:50 -05:00
2023-11-07 14:50:52 -05:00
2022-12-05 16:06:08 -05:00
2023-11-16 12:43:49 -05:00
2023-05-05 17:58:52 -04:00
2023-12-21 08:54:37 -05:00
2023-11-18 10:08:09 +02:00
2023-02-07 14:33:50 -05:00
2023-10-06 14:38:13 -04:00
2024-01-24 11:12:11 -05:00
2023-08-30 17:56:21 -04:00
2023-10-06 14:38:13 -04:00
2023-06-20 16:08:13 -04:00
2023-11-16 12:43:49 -05:00
2023-11-07 14:50:52 -05:00
2023-08-25 17:55:19 -04:00
2024-01-21 11:24:24 +01:00
2024-03-26 19:58:26 -04:00
2024-01-18 20:24:13 -05:00
2023-04-07 14:20:53 +02:00
2024-03-26 19:58:26 -04:00
2023-11-07 14:50:52 -05:00
2024-01-24 11:12:11 -05:00
2023-05-05 17:48:44 -04:00
2023-02-06 13:04:53 -05:00
2023-01-16 18:01:10 +08:00
2023-05-06 17:28:18 +08:00
2023-09-14 10:42:24 -04:00
2024-03-22 15:50:28 -04:00
2023-02-12 13:44:20 -05:00
2023-10-24 15:55:17 +08:00
2024-03-02 12:26:19 -05:00
2023-12-21 08:54:37 -05:00
2023-08-29 13:37:54 -04:00
2023-10-10 16:19:43 -04:00
2023-10-15 12:23:48 +02:00
2023-11-07 18:36:06 -05:00
2023-10-24 17:05:24 -04:00
2023-10-13 16:59:23 -04:00
2023-10-24 17:05:24 -04:00
2022-10-31 11:02:44 -04:00
2023-11-07 18:36:06 -05:00
2023-11-01 10:01:10 +09:00
2023-09-15 23:38:02 +02:00
2022-12-08 15:15:22 +08:00
2023-11-07 13:47:08 +01:00
2023-10-15 12:23:48 +02:00
2023-10-15 12:23:48 +02:00
2024-03-27 09:23:30 +01:00
2024-01-24 11:12:11 -05:00
2024-01-24 11:12:11 -05:00
2023-11-07 14:50:52 -05:00
2023-11-16 13:49:14 -05:00
2024-01-29 14:49:17 -05:00
2023-04-24 21:37:45 +02:00
2023-10-09 15:24:31 -04:00
2023-10-22 23:41:46 +01:00
2023-05-06 17:28:18 +08:00
2024-01-24 11:12:11 -05:00
2023-12-21 08:54:37 -05:00
2024-01-09 10:08:52 +01:00
2022-12-05 16:06:08 -05:00
2023-02-10 07:41:40 -05:00
2023-11-07 14:50:52 -05:00
2023-09-15 23:38:02 +02:00
2023-11-10 11:01:50 -05:00
2023-09-09 06:12:47 +02:00
2024-01-24 11:12:11 -05:00
2023-02-28 09:44:19 +02:00
2023-02-28 09:44:33 +02:00
2023-02-28 09:44:33 +02:00
2023-10-27 13:14:47 +03:00
2023-02-11 12:22:35 -05:00
2022-12-07 16:04:16 -05:00
2024-04-04 10:45:27 +02:00
2023-11-07 14:50:52 -05:00
2023-11-07 14:50:52 -05:00
2023-11-07 14:50:52 -05:00
2023-06-06 10:37:25 +02:00
2022-12-07 16:04:17 -05:00
2024-03-22 10:16:13 +01:00
2024-04-05 03:25:14 +02:00
2022-12-22 10:31:49 -05:00
2023-11-07 14:50:52 -05:00
2023-08-25 17:55:18 -04:00
2022-10-31 11:04:00 -04:00
2023-07-21 09:00:38 +02:00
2023-05-31 17:23:01 -04:00
2023-03-13 13:53:01 +01:00
2024-03-21 06:56:13 +01:00
2023-03-07 15:57:19 +01:00
2023-03-07 15:57:19 +01:00
2023-03-07 15:57:19 +01:00
2023-03-07 15:59:47 +01:00
2023-03-07 15:59:58 +01:00
2023-03-07 15:59:58 +01:00
2023-11-14 20:04:00 -07:00
2023-04-25 11:53:15 -04:00
2023-01-23 18:11:39 -05:00
2023-09-21 13:20:10 +02:00
2023-07-21 09:00:38 +02:00