]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
efi_loader: avoid multiple local copies of lf2_initrd_guid
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Fri, 15 Oct 2021 00:33:33 +0000 (02:33 +0200)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Thu, 21 Oct 2021 01:46:04 +0000 (03:46 +0200)
Create the GUID as a global variable.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
cmd/efidebug.c
include/efi_load_initrd.h
lib/efi_loader/efi_helper.c
lib/efi_loader/efi_load_initrd.c

index 33a5135ee19f78b32e34bfc1e8bc39fe7f3bc8ac..a977ca9c72f556f50b1d5a11166d4a5b82393cd5 100644 (file)
@@ -1144,7 +1144,6 @@ static void show_efi_boot_opt_data(u16 *varname16, void *data, size_t *size)
        struct efi_device_path *initrd_path = NULL;
        struct efi_load_option lo;
        efi_status_t ret;
-       const efi_guid_t lf2_initrd_guid = EFI_INITRD_MEDIA_GUID;
 
        ret = efi_deserialize_load_option(&lo, data, size);
        if (ret != EFI_SUCCESS) {
@@ -1165,7 +1164,7 @@ static void show_efi_boot_opt_data(u16 *varname16, void *data, size_t *size)
 
        printf("  file_path: %pD\n", lo.file_path);
 
-       initrd_path = efi_dp_from_lo(&lo, &lf2_initrd_guid);
+       initrd_path = efi_dp_from_lo(&lo, &efi_lf2_initrd_guid);
        if (initrd_path) {
                printf("  initrd_path: %pD\n", initrd_path);
                efi_free_pool(initrd_path);
index 478ae807c6855d2abef8499921b29492d6727783..be5d5a7acbe07db110e20cd5eeeec5272080942b 100644 (file)
@@ -16,6 +16,7 @@
 #define EFI_INITRD_MEDIA_GUID \
        EFI_GUID(0x5568e427, 0x68fc, 0x4f3d, \
                 0xac, 0x74, 0xca, 0x55, 0x52, 0x31, 0xcc, 0x68)
+extern const efi_guid_t efi_lf2_initrd_guid;
 
 struct efi_initrd_dp {
        struct efi_device_path_vendor vendor;
index 89833de222852bb9d9037ae482981fc1704fde70..485384b7ee13b535308a82d608b6a1d8412947ec 100644 (file)
 #include <efi_loader.h>
 #include <efi_variable.h>
 
+#if defined(CONFIG_CMD_EFIDEBUG) || defined(CONFIG_EFI_LOAD_FILE2_INITRD)
+/* GUID used by Linux to identify the LoadFile2 protocol with the initrd */
+const efi_guid_t efi_lf2_initrd_guid = EFI_INITRD_MEDIA_GUID;
+#endif
+
 /**
  * efi_create_current_boot_var() - Return Boot#### name were #### is replaced by
  *                                the value of BootCurrent
index e2a806302303cbadb1b98d3d4c9c17231575dc46..c5e6652e664bd7ac2052e1b9b76651f5fea60ac5 100644 (file)
@@ -52,7 +52,6 @@ static efi_handle_t efi_initrd_handle;
  */
 static efi_status_t get_initrd_fp(struct efi_device_path **initrd_fp)
 {
-       const efi_guid_t lf2_initrd_guid = EFI_INITRD_MEDIA_GUID;
        struct efi_device_path *dp = NULL;
 
        /*
@@ -65,7 +64,7 @@ static efi_status_t get_initrd_fp(struct efi_device_path **initrd_fp)
         * We can then use this specific return value and not install the
         * protocol, while allowing the boot to continue
         */
-       dp = efi_get_dp_from_boot(lf2_initrd_guid);
+       dp = efi_get_dp_from_boot(efi_lf2_initrd_guid);
        if (!dp)
                return EFI_INVALID_PARAMETER;