]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
sandbox: switch to dynamic UUIDs
authorCaleb Connolly <caleb.connolly@linaro.org>
Fri, 30 Aug 2024 12:34:35 +0000 (13:34 +0100)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Thu, 12 Sep 2024 15:35:37 +0000 (17:35 +0200)
Migrate sandbox over to generating it's capsule update image GUIDs
dynamically from the namespace and board/image info. Update the
reference and tests to use the new GUIDs.

Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
board/sandbox/sandbox.c
include/sandbox_efi_capsule.h
test/py/tests/test_efi_capsule/test_capsule_firmware_fit.py
test/py/tests/test_efi_capsule/test_capsule_firmware_raw.py
test/py/tests/test_efi_capsule/test_capsule_firmware_signed_fit.py
test/py/tests/test_efi_capsule/test_capsule_firmware_signed_raw.py
test/py/tests/test_efi_capsule/version.dtso
tools/binman/etype/efi_capsule.py
tools/binman/ftest.py

index 802596569c6410838ed1958bf31a75f732c9acda..d97945e58fcf8ba53ad3aa0b483bd6ea7d637275 100644 (file)
 gd_t *gd;
 
 #if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)
-/* GUIDs for capsule updatable firmware images */
-#define SANDBOX_UBOOT_IMAGE_GUID \
-       EFI_GUID(0x09d7cf52, 0x0720, 0x4710, 0x91, 0xd1, \
-                0x08, 0x46, 0x9b, 0x7f, 0xe9, 0xc8)
-
-#define SANDBOX_UBOOT_ENV_IMAGE_GUID \
-       EFI_GUID(0x5a7021f5, 0xfef2, 0x48b4, 0xaa, 0xba, \
-                0x83, 0x2e, 0x77, 0x74, 0x18, 0xc0)
-
-#define SANDBOX_FIT_IMAGE_GUID \
-       EFI_GUID(0x3673b45d, 0x6a7c, 0x46f3, 0x9e, 0x60, \
-                0xad, 0xab, 0xb0, 0x3f, 0x79, 0x37)
-
 struct efi_fw_image fw_images[] = {
 #if defined(CONFIG_EFI_CAPSULE_FIRMWARE_RAW)
        {
-               .image_type_id = SANDBOX_UBOOT_IMAGE_GUID,
                .fw_name = u"SANDBOX-UBOOT",
                .image_index = 1,
        },
        {
-               .image_type_id = SANDBOX_UBOOT_ENV_IMAGE_GUID,
                .fw_name = u"SANDBOX-UBOOT-ENV",
                .image_index = 2,
        },
 #elif defined(CONFIG_EFI_CAPSULE_FIRMWARE_FIT)
        {
-               .image_type_id = SANDBOX_FIT_IMAGE_GUID,
                .fw_name = u"SANDBOX-FIT",
                .image_index = 1,
        },
index 3e288e8a84a26c309bd6e1c060bdfcaefdbb3772..84d45ec5cfd524d17dfb9f860c6dea075e480f1d 100644 (file)
@@ -6,9 +6,9 @@
 #if !defined(_SANDBOX_EFI_CAPSULE_H_)
 #define _SANDBOX_EFI_CAPSULE_H_
 
-#define SANDBOX_UBOOT_IMAGE_GUID       "09d7cf52-0720-4710-91d1-08469b7fe9c8"
-#define SANDBOX_UBOOT_ENV_IMAGE_GUID   "5a7021f5-fef2-48b4-aaba-832e777418c0"
-#define SANDBOX_FIT_IMAGE_GUID         "3673b45d-6a7c-46f3-9e60-adabb03f7937"
+#define SANDBOX_UBOOT_IMAGE_GUID       "985f2937-7c2e-5e9a-8a5e-8e063312964b"
+#define SANDBOX_UBOOT_ENV_IMAGE_GUID   "9e339473-c2eb-530a-a69b-0cd6bbbed40e"
+#define SANDBOX_FIT_IMAGE_GUID         "46610520-469e-59dc-a8dd-c11832b877ea"
 #define SANDBOX_INCORRECT_GUID         "058b7d83-50d5-4c47-a195-60d86ad341c4"
 
 #define UBOOT_FIT_IMAGE                        "u-boot_bin_env.itb"
index 11bcdc2bb293cd3de00bb255182e3b7cbe2d5a00..a726c71c1138cbd9195690ed43b744de09a732b2 100644 (file)
@@ -147,7 +147,7 @@ class TestEfiCapsuleFirmwareFit():
                 verify_content(u_boot_console, '150000', 'u-boot-env:Old')
             else:
                 # ensure that SANDBOX_UBOOT_IMAGE_GUID is in the ESRT.
-                assert '3673B45D-6A7C-46F3-9E60-ADABB03F7937' in ''.join(output)
+                assert '985F2937-7C2E-5E9A-8A5E-8E063312964B' in ''.join(output)
                 assert 'ESRT: fw_version=5' in ''.join(output)
                 assert 'ESRT: lowest_supported_fw_version=3' in ''.join(output)
 
index f3a2dff5c2c88fddaff58120fb148e0680361273..8a790405c7c497e9c279e6998654754b72f274a4 100644 (file)
@@ -145,10 +145,10 @@ class TestEfiCapsuleFirmwareRaw:
                 'efidebug capsule esrt'])
 
             # ensure that SANDBOX_UBOOT_ENV_IMAGE_GUID is in the ESRT.
-            assert '5A7021F5-FEF2-48B4-AABA-832E777418C0' in ''.join(output)
+            assert '9E339473-C2EB-530A-A69B-0CD6BBBED40E' in ''.join(output)
 
             # ensure that SANDBOX_UBOOT_IMAGE_GUID is in the ESRT.
-            assert '09D7CF52-0720-4710-91D1-08469B7FE9C8' in ''.join(output)
+            assert '985F2937-7C2E-5E9A-8A5E-8E063312964B' in ''.join(output)
 
             check_file_removed(u_boot_console, disk_img, capsule_files)
 
@@ -199,12 +199,12 @@ class TestEfiCapsuleFirmwareRaw:
                 verify_content(u_boot_console, '150000', 'u-boot-env:Old')
             else:
                 # ensure that SANDBOX_UBOOT_IMAGE_GUID is in the ESRT.
-                assert '09D7CF52-0720-4710-91D1-08469B7FE9C8' in ''.join(output)
+                assert '985F2937-7C2E-5E9A-8A5E-8E063312964B' in ''.join(output)
                 assert 'ESRT: fw_version=5' in ''.join(output)
                 assert 'ESRT: lowest_supported_fw_version=3' in ''.join(output)
 
                 # ensure that SANDBOX_UBOOT_ENV_IMAGE_GUID is in the ESRT.
-                assert '5A7021F5-FEF2-48B4-AABA-832E777418C0' in ''.join(output)
+                assert '9E339473-C2EB-530A-A69B-0CD6BBBED40E' in ''.join(output)
                 assert 'ESRT: fw_version=10' in ''.join(output)
                 assert 'ESRT: lowest_supported_fw_version=7' in ''.join(output)
 
index 44a58baa3106477a6a86e05288d06171a213f9d5..debbce8bdbdf8607a5690dc64181106cd588dbba 100644 (file)
@@ -157,7 +157,7 @@ class TestEfiCapsuleFirmwareSignedFit():
                 'efidebug capsule esrt'])
 
             # ensure that SANDBOX_UBOOT_IMAGE_GUID is in the ESRT.
-            assert '3673B45D-6A7C-46F3-9E60-ADABB03F7937' in ''.join(output)
+            assert '46610520-469E-59DC-A8DD-C11832B877EA' in ''.join(output)
             assert 'ESRT: fw_version=5' in ''.join(output)
             assert 'ESRT: lowest_supported_fw_version=3' in ''.join(output)
 
index 83a10e160b8caa2bf5a8c35946418d56a7e2c521..439bd71b3a7d70b7d76a5209028d5a79d8ccfce4 100644 (file)
@@ -151,12 +151,12 @@ class TestEfiCapsuleFirmwareSignedRaw():
                 'efidebug capsule esrt'])
 
             # ensure that SANDBOX_UBOOT_IMAGE_GUID is in the ESRT.
-            assert '09D7CF52-0720-4710-91D1-08469B7FE9C8' in ''.join(output)
+            assert '985F2937-7C2E-5E9A-8A5E-8E063312964B' in ''.join(output)
             assert 'ESRT: fw_version=5' in ''.join(output)
             assert 'ESRT: lowest_supported_fw_version=3' in ''.join(output)
 
             # ensure that SANDBOX_UBOOT_ENV_IMAGE_GUID is in the ESRT.
-            assert '5A7021F5-FEF2-48B4-AABA-832E777418C0' in ''.join(output)
+            assert '9E339473-C2EB-530A-A69B-0CD6BBBED40E' in ''.join(output)
             assert 'ESRT: fw_version=10' in ''.join(output)
             assert 'ESRT: lowest_supported_fw_version=7' in ''.join(output)
 
index 07850cc6064c77b03c7e741a6918d859cb00468b..3aebb5b64fbd19fc0ef5747fa0da14e92166a36b 100644 (file)
@@ -8,17 +8,17 @@
                image1 {
                        lowest-supported-version = <3>;
                        image-index = <1>;
-                       image-type-id = "09D7CF52-0720-4710-91D1-08469B7FE9C8";
+                       image-type-id = "985F2937-7C2E-5E9A-8A5E-8E063312964B";
                };
                image2 {
                        lowest-supported-version = <7>;
                        image-index = <2>;
-                       image-type-id = "5A7021F5-FEF2-48B4-AABA-832E777418C0";
+                       image-type-id = "9E339473-C2EB-530A-A69B-0CD6BBBED40E";
                };
                image3 {
                        lowest-supported-version = <3>;
                        image-index = <1>;
-                       image-type-id = "3673B45D-6A7C-46F3-9E60-ADABB03F7937";
+                       image-type-id = "46610520-469E-59DC-A8DD-C11832B877EA";
                };
        };
 };
index 5941545d0b29385d7ef4a880216361a64f314d75..768e006dc50dbf7440557bc6ff10ba2d64e76905 100644 (file)
@@ -24,7 +24,7 @@ def get_binman_test_guid(type_str):
         The actual GUID value (str)
     """
     TYPE_TO_GUID = {
-        'binman-test' : '09d7cf52-0720-4710-91d1-08469b7fe9c8'
+        'binman-test' : '985f2937-7c2e-5e9a-8a5e-8e063312964b'
     }
 
     return TYPE_TO_GUID[type_str]
index 93f3d22cf57388ad3395721d9451b6e12fb762ab..2577c0016c0cbf7478f6c69cdd74a9bbb0974796 100644 (file)
@@ -125,7 +125,7 @@ TEE_ADDR = 0x5678
 # Firmware Management Protocol(FMP) GUID
 FW_MGMT_GUID = '6dcbd5ed-e82d-4c44-bda1-7194199ad92a'
 # Image GUID specified in the DTS
-CAPSULE_IMAGE_GUID = '09d7cf52-0720-4710-91d1-08469b7fe9c8'
+CAPSULE_IMAGE_GUID = '985F2937-7C2E-5E9A-8A5E-8E063312964B'
 # Windows cert GUID
 WIN_CERT_TYPE_EFI_GUID = '4aafd29d-68df-49ee-8aa9-347d375665a7'
 # Empty capsule GUIDs