summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2015-07-17 21:22:49 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-07-27 07:23:20 +0200
commitc95b1c2bf24cbcce63a036e85ebd3f53544a207b (patch)
tree3036892e6979d7a6efbd0e295c710b970d49def6
parent5df1c6ea9b900d95058149f91e3f0e2cd26ae9c0 (diff)
downloadbarebox-c95b1c2bf24cbcce63a036e85ebd3f53544a207b.tar.gz
barebox-c95b1c2bf24cbcce63a036e85ebd3f53544a207b.tar.xz
efi: use an EFI variable to save the environment
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/efi/efi/efi.c5
-rw-r--r--common/efi-guid.c1
-rw-r--r--include/efi.h1
3 files changed, 7 insertions, 0 deletions
diff --git a/arch/efi/efi/efi.c b/arch/efi/efi/efi.c
index 07a4d9d0fc..d3f520f60f 100644
--- a/arch/efi/efi/efi.c
+++ b/arch/efi/efi/efi.c
@@ -326,8 +326,13 @@ static void fixup_tables(void)
static int efi_init(void)
{
+ char *env;
+
defaultenv_append_directory(env_efi);
+ env = xasprintf("/efivars/barebox-env-%pUl", &efi_barebox_vendor_guid);
+ default_environment_path_set(env);
+
return 0;
}
device_initcall(efi_init);
diff --git a/common/efi-guid.c b/common/efi-guid.c
index f4ff7feadf..64f3b1f65f 100644
--- a/common/efi-guid.c
+++ b/common/efi-guid.c
@@ -9,6 +9,7 @@ efi_guid_t efi_unknown_device_guid = EFI_UNKNOWN_DEVICE_GUID;
efi_guid_t efi_null_guid = EFI_NULL_GUID;
efi_guid_t efi_global_variable_guid = EFI_GLOBAL_VARIABLE_GUID;
efi_guid_t efi_block_io_protocol_guid = EFI_BLOCK_IO_PROTOCOL_GUID;
+efi_guid_t efi_barebox_vendor_guid = EFI_BAREBOX_VENDOR_GUID;
efi_guid_t efi_systemd_vendor_guid = EFI_SYSTEMD_VENDOR_GUID;
#define EFI_GUID_STRING(guid, short, long) do { \
diff --git a/include/efi.h b/include/efi.h
index 5b0de119fb..b2e965bae1 100644
--- a/include/efi.h
+++ b/include/efi.h
@@ -485,6 +485,7 @@ extern efi_guid_t efi_unknown_device_guid;
extern efi_guid_t efi_null_guid;
extern efi_guid_t efi_global_variable_guid;
extern efi_guid_t efi_block_io_protocol_guid;
+extern efi_guid_t efi_barebox_vendor_guid;
extern efi_guid_t efi_systemd_vendor_guid;
#define EFI_SYSTEM_TABLE_SIGNATURE ((u64)0x5453595320494249ULL)