"Das U-Boot" Source Tree
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge patch series "Restore support of short name for type UUID parameter"

Patrick Delaunay <patrick.delaunay@foss.st.com> says:

Fix and add documentation/tests for selection by string for known
partition type GUID introduced by bcb41dcaefac ("uuid: add
selection by string for known partition type GUID"):

- split list_guid for short name (used also for partiton
description with type parameter) and full name to display
information

- as the function are uuid_str_to_bin() / uuid_guid_get_str()
are no more under CONFIG_PARTITION_TYPE_GUID, since commit
31ce367cd100 ("lib/uuid.c: change prototype of uuid_guid_get_str()")
and commit c1528f324c60 ("lib: compile uuid_guid_get_str if
CONFIG_LIB_UUID=y") move the content of array under EFI_PARTITION
and linker will remove it is not used it (in SPL)

- Add and fix documentation for gpt command

- Add test test_gpt_write_part_type to test "type=" parameters

This first patch solves an issue for the "system" shortcut for ESP,
removed by commit d54V3 version solve issue for "ESP" support when
CONFIG_CMD_EFIDEBUG and CONFIG_EFI is not activated
for example for test with qemu-arm-sbsa defconfige1004b8b1 ("lib/uuid.c: use unique name
for PARTITION_SYSTEM_GUID") but used in 2 location (at least):

1- board/samsung/e850-96/e850-96.env:10:

partitions=name=esp,start=512K,size=128M,bootable,type=system;
partitions+=name=rootfs,size=-,bootable,type=linux

2- arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c:1151

case PART_ESP:
/* EFI System Partition */
459219 type_str = "system"
....
offset += snprintf(buf + offset,
buflen - offset,
",type=%s", type_str);

CI: https://source.denx.de/u-boot/custodians/u-boot-stm/-/pipelines/26699

Link: https://lore.kernel.org/r/20250616112749.17311-1-patrick.delaunay@foss.st.com

Tom Rini a239cdc0 17012e30

+201 -84
+84 -9
doc/usage/cmd/gpt.rst
··· 54 54 55 55 * name=<NAME> - The partition name, required 56 56 * start=<BYTES> - The partition start offset in bytes, required 57 - * size=<BYTES> - The partition size in bytes or "-" to expand it to the whole free area 57 + * size=<BYTES> - The partition size in bytes or "-" for the last partition to expand it to the whole free area 58 58 * bootable - Set the legacy bootable flag 59 59 * uuid=<UUID> - The partition UUID, optional if CONFIG_RANDOM_UUID=y is enabled 60 60 * type=<UUID> - The partition type GUID, requires CONFIG_PARTITION_TYPE_GUID=y ··· 62 62 63 63 If 'uuid' is not specified, but CONFIG_RANDOM_UUID is enabled, a random UUID 64 64 will be generated for the partition 65 + 66 + If 'type' is not specified or without CONFIG_PARTITION_TYPE_GUID=y, 67 + the used partition type GUID is PARTITION_BASIC_DATA_GUID. 68 + 69 + Some strings can be also used at the place of the known partition type GUID: 70 + * "mbr" = LEGACY_MBR_PARTITION_GUID (024DEE41-33E7-11D3-9D69-0008C781F39F) 71 + * "msft" = PARTITION_MSFT_RESERVED_GUID (E3C9E316-0B5C-4DB8-817D-F92DF00215AE) 72 + * "data" = PARTITION_BASIC_DATA_GUID (EBD0A0A2-B9E5-4433-87C0-68B6B72699C7) 73 + * "linux" = PARTITION_LINUX_FILE_SYSTEM_DATA_GUID (0FC63DAF-8483-4772-8E79-3D69D8477DE4) 74 + * "raid" = PARTITION_LINUX_RAID_GUID (A19D880F-05FC-4D3B-A006-743F0F84911E) 75 + * "swap" = PARTITION_LINUX_SWAP_GUID (0657FD6D-A4AB-43C4-84E5-0933C84B4F4F) 76 + * "lvm" = PARTITION_LINUX_LVM_GUID (E6D6D379-F507-44C2-A23C-238F2A3DF928) 77 + * "u-boot-env" = PARTITION_U_BOOT_ENVIRONMENT(3DE21764-95BD-54BD-A5C3-4ABE786F38A8) 78 + * "system" = PARTITION_SYSTEM_GUID (C12A7328-F81F-11D2-BA4B-00A0C93EC93B) 79 + 80 + The GPT partitions layout and associated 'type' are also printed with the 81 + :doc:`part command <part>` command by typing "part list". 65 82 66 83 gpt enumerate 67 84 ~~~~~~~~~~~~~ ··· 162 179 163 180 Create 6 partitions on a disk:: 164 181 165 - => setenv gpt_parts 'uuid_disk=bec9fc2a-86c1-483d-8a0e-0109732277d7; 166 - name=boot,start=4M,size=128M,bootable,type=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7, 167 - name=rootfs,size=3072M,type=0fc63daf-8483-4772-8e79-3d69d8477de4; 168 - name=system-data,size=512M,type=0fc63daf-8483-4772-8e79-3d69d8477de4; 169 - name=[ext],size=-,type=0fc63daf-8483-4772-8e79-3d69d8477de4; 170 - name=user,size=-,type=0fc63daf-8483-4772-8e79-3d69d8477de4; 171 - name=modules,size=100M,type=0fc63daf-8483-4772-8e79-3d69d8477de4; 172 - name=ramdisk,size=8M,type=0fc63daf-8483-4772-8e79-3d69d8477de4 182 + => setenv gpt_parts 'uuid_disk=bec9fc2a-86c1-483d-8a0e-0109732277d7;\ 183 + name=boot,start=4M,size=128M,bootable,type=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7;\ 184 + name=rootfs,size=3072M,type=0fc63daf-8483-4772-8e79-3d69d8477de4;\ 185 + name=system-data,size=512M,type=0fc63daf-8483-4772-8e79-3d69d8477de4;\ 186 + name=user,size=512M,type=0fc63daf-8483-4772-8e79-3d69d8477de4;\ 187 + name=modules,size=100M,type=0fc63daf-8483-4772-8e79-3d69d8477de4;\ 188 + name=ramdisk,size=8M,type=0fc63daf-8483-4772-8e79-3d69d8477de4;\ 189 + name=[ext],size=-,type=0fc63daf-8483-4772-8e79-3d69d8477de4' 173 190 => gpt write mmc 0 $gpt_parts 174 191 192 + Last partition "[ext]" with '-' is extended up to the end of the disk 175 193 176 194 Verify that the device matches the partition layout described in the variable 177 195 $gpt_parts:: ··· 228 246 => gpt setenv mmc 0 boot 229 247 => echo ${gpt_partition_entry} 230 248 2 249 + 250 + Other example: a disk with known partition types:: 251 + 252 + => setenv gpt_parts 'name=u-boot,size=32M,type=data;\ 253 + name=env,size=1M,type=u-boot-env; 254 + name=ESP,size=128M,type=system; 255 + name=rootfs,size=3072M,type=linux; 256 + name=swap,size=100M,type=swap; 257 + name=user,size=-,type=linux' 258 + => gpt write mmc 0 $gpt_parts 259 + 260 + => part list mmc 0 261 + Partition Map for mmc device 0 -- Partition Type: EFI 262 + Part Start LBA End LBA Name 263 + Attributes 264 + Type GUID 265 + Partition GUID 266 + 1 0x00000022 0x00010021 "u-boot" 267 + attrs: 0x0000000000000000 268 + type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 269 + (data) 270 + guid: 502d48f6-81c0-488f-bdc0-ad602498f3ce 271 + 2 0x00010022 0x00010821 "env" 272 + attrs: 0x0000000000000000 273 + type: 3de21764-95bd-54bd-a5c3-4abe786f38a8 274 + (u-boot-env) 275 + guid: 9dc62338-459a-485e-bd8f-b3fbf728d9c0 276 + 3 0x00010822 0x00050821 "ESP" 277 + attrs: 0x0000000000000000 278 + type: c12a7328-f81f-11d2-ba4b-00a0c93ec93b 279 + (EFI System Partition) 280 + guid: 8a3a1168-6af8-4ba7-a95d-9cd0d14e1b3d 281 + 4 0x00050822 0x00650821 "rootfs" 282 + attrs: 0x0000000000000000 283 + type: 0fc63daf-8483-4772-8e79-3d69d8477de4 284 + (linux) 285 + guid: 411ffebc-8a19-469d-99a9-0982409a6851 286 + 5 0x00650822 0x00682821 "swap" 287 + attrs: 0x0000000000000000 288 + type: 0657fd6d-a4ab-43c4-84e5-0933c84b4f4f 289 + (swap) 290 + guid: f8ec0410-95ec-4e3e-8b98-fb8cf271a201 291 + 6 0x00682822 0x01dacbde "user" 292 + attrs: 0x0000000000000000 293 + type: 0fc63daf-8483-4772-8e79-3d69d8477de4 294 + (linux) 295 + guid: c5543e1c-566d-4502-99ad-20545007e673 296 + 297 + Modifying GPT partition layout from U-Boot:: 298 + 299 + => gpt read mmc 0 current_partitions 300 + => env edit current_partitions 301 + edit: uuid_disk=[...];name=part1,start=0x4000,size=0x4000,uuid=[...]; 302 + name=part2,start=0xc000,size=0xc000,uuid=[...];[ . . . ] 303 + 304 + => gpt write mmc 0 $current_partitions 305 + => gpt verify mmc 0 $current_partitions
+89 -73
lib/uuid.c
··· 62 62 return 1; 63 63 } 64 64 65 + /* 66 + * Array of string (short and long) for known GUID of GPT partition type 67 + * at least one string must be present, @type or @description 68 + * 69 + * @type : short name for the parameter 'type' of gpt command (max size UUID_STR_LEN = 36, 70 + * no space), also used as fallback description when the next field is absent 71 + * @description : long description associated to type GUID, used for %pUs 72 + * @guid : known type GUID value 73 + */ 65 74 static const struct { 66 - const char *string; 75 + const char *type; 76 + const char *description; 67 77 efi_guid_t guid; 68 78 } list_guid[] = { 69 79 #ifndef USE_HOSTCC 70 - #if defined(CONFIG_PARTITION_TYPE_GUID) || defined(CONFIG_CMD_EFIDEBUG) || \ 71 - defined(CONFIG_EFI) 72 - {"EFI System Partition", PARTITION_SYSTEM_GUID}, 73 - #endif 74 - #ifdef CONFIG_PARTITION_TYPE_GUID 75 - {"mbr", LEGACY_MBR_PARTITION_GUID}, 76 - {"msft", PARTITION_MSFT_RESERVED_GUID}, 77 - {"data", PARTITION_BASIC_DATA_GUID}, 78 - {"linux", PARTITION_LINUX_FILE_SYSTEM_DATA_GUID}, 79 - {"raid", PARTITION_LINUX_RAID_GUID}, 80 - {"swap", PARTITION_LINUX_SWAP_GUID}, 81 - {"lvm", PARTITION_LINUX_LVM_GUID}, 82 - {"u-boot-env", PARTITION_U_BOOT_ENVIRONMENT}, 83 - {"cros-kern", PARTITION_CROS_KERNEL}, 84 - {"cros-root", PARTITION_CROS_ROOT}, 85 - {"cros-fw", PARTITION_CROS_FIRMWARE}, 86 - {"cros-rsrv", PARTITION_CROS_RESERVED}, 87 - #endif 80 + #if CONFIG_IS_ENABLED(EFI_PARTITION) 81 + {"mbr", NULL, LEGACY_MBR_PARTITION_GUID}, 82 + {"msft", NULL, PARTITION_MSFT_RESERVED_GUID}, 83 + {"data", NULL, PARTITION_BASIC_DATA_GUID}, 84 + {"linux", NULL, PARTITION_LINUX_FILE_SYSTEM_DATA_GUID}, 85 + {"raid", NULL, PARTITION_LINUX_RAID_GUID}, 86 + {"swap", NULL, PARTITION_LINUX_SWAP_GUID}, 87 + {"lvm", NULL, PARTITION_LINUX_LVM_GUID}, 88 + {"u-boot-env", NULL, PARTITION_U_BOOT_ENVIRONMENT}, 89 + {"cros-kern", NULL, PARTITION_CROS_KERNEL}, 90 + {"cros-root", NULL, PARTITION_CROS_ROOT}, 91 + {"cros-fw", NULL, PARTITION_CROS_FIRMWARE}, 92 + {"cros-rsrv", NULL, PARTITION_CROS_RESERVED}, 93 + { 94 + "system", "EFI System Partition", 95 + PARTITION_SYSTEM_GUID, 96 + }, 88 97 #if defined(CONFIG_CMD_EFIDEBUG) || defined(CONFIG_EFI) 89 98 { 90 - "Device Path", 99 + NULL, "Device Path", 100 + PARTITION_SYSTEM_GUID, 101 + }, 102 + { 103 + NULL, "Device Path", 91 104 EFI_DEVICE_PATH_PROTOCOL_GUID, 92 105 }, 93 106 { 94 - "Device Path To Text", 107 + NULL, "Device Path To Text", 95 108 EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID, 96 109 }, 97 110 { 98 - "Device Path Utilities", 111 + NULL, "Device Path Utilities", 99 112 EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID, 100 113 }, 101 114 { 102 - "Unicode Collation 2", 115 + NULL, "Unicode Collation 2", 103 116 EFI_UNICODE_COLLATION_PROTOCOL2_GUID, 104 117 }, 105 118 { 106 - "Driver Binding", 119 + NULL, "Driver Binding", 107 120 EFI_DRIVER_BINDING_PROTOCOL_GUID, 108 121 }, 109 122 { 110 - "Simple Text Input", 123 + NULL, "Simple Text Input", 111 124 EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID, 112 125 }, 113 126 { 114 - "Simple Text Input Ex", 127 + NULL, "Simple Text Input Ex", 115 128 EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID, 116 129 }, 117 130 { 118 - "Simple Text Output", 131 + NULL, "Simple Text Output", 119 132 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID, 120 133 }, 121 134 { 122 - "Block IO", 135 + NULL, "Block IO", 123 136 EFI_BLOCK_IO_PROTOCOL_GUID, 124 137 }, 125 138 { 126 - "Disk IO", 139 + NULL, "Disk IO", 127 140 EFI_DISK_IO_PROTOCOL_GUID, 128 141 }, 129 142 { 130 - "Simple File System", 143 + NULL, "Simple File System", 131 144 EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID, 132 145 }, 133 146 { 134 - "Loaded Image", 147 + NULL, "Loaded Image", 135 148 EFI_LOADED_IMAGE_PROTOCOL_GUID, 136 149 }, 137 150 { 138 - "Loaded Image Device Path", 151 + NULL, "Loaded Image Device Path", 139 152 EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID, 140 153 }, 141 154 { 142 - "Graphics Output", 155 + NULL, "Graphics Output", 143 156 EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID, 144 157 }, 145 158 { 146 - "HII String", 159 + NULL, "HII String", 147 160 EFI_HII_STRING_PROTOCOL_GUID, 148 161 }, 149 162 { 150 - "HII Database", 163 + NULL, "HII Database", 151 164 EFI_HII_DATABASE_PROTOCOL_GUID, 152 165 }, 153 166 { 154 - "HII Config Access", 167 + NULL, "HII Config Access", 155 168 EFI_HII_CONFIG_ACCESS_PROTOCOL_GUID, 156 169 }, 157 170 { 158 - "HII Config Routing", 171 + NULL, "HII Config Routing", 159 172 EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID, 160 173 }, 161 174 { 162 - "Load File", 175 + NULL, "Load File", 163 176 EFI_LOAD_FILE_PROTOCOL_GUID, 164 177 }, 165 178 { 166 - "Load File2", 179 + NULL, "Load File2", 167 180 EFI_LOAD_FILE2_PROTOCOL_GUID, 168 181 }, 169 182 { 170 - "Random Number Generator", 183 + NULL, "Random Number Generator", 171 184 EFI_RNG_PROTOCOL_GUID, 172 185 }, 173 186 { 174 - "Simple Network", 187 + NULL, "Simple Network", 175 188 EFI_SIMPLE_NETWORK_PROTOCOL_GUID, 176 189 }, 177 190 { 178 - "PXE Base Code", 191 + NULL, "PXE Base Code", 179 192 EFI_PXE_BASE_CODE_PROTOCOL_GUID, 180 193 }, 181 194 { 182 - "Device-Tree Fixup", 195 + NULL, "Device-Tree Fixup", 183 196 EFI_DT_FIXUP_PROTOCOL_GUID, 184 197 }, 185 198 { 186 - "TCG2", 199 + NULL, "TCG2", 187 200 EFI_TCG2_PROTOCOL_GUID, 188 201 }, 189 202 { 190 - "Firmware Management", 203 + NULL, "Firmware Management", 191 204 EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GUID 192 205 }, 193 206 #if IS_ENABLED(CONFIG_EFI_HTTP_PROTOCOL) 194 207 { 195 - "HTTP", 208 + NULL, "HTTP", 196 209 EFI_HTTP_PROTOCOL_GUID, 197 210 }, 198 211 { 199 - "HTTP Service Binding", 212 + NULL, "HTTP Service Binding", 200 213 EFI_HTTP_SERVICE_BINDING_PROTOCOL_GUID, 201 214 }, 202 215 { 203 - "IPv4 Config2", 216 + NULL, "IPv4 Config2", 204 217 EFI_IP4_CONFIG2_PROTOCOL_GUID, 205 218 }, 206 219 #endif 207 220 /* Configuration table GUIDs */ 208 221 { 209 - "ACPI table", 222 + NULL, "ACPI table", 210 223 EFI_ACPI_TABLE_GUID, 211 224 }, 212 225 { 213 - "EFI System Resource Table", 226 + NULL, "EFI System Resource Table", 214 227 EFI_SYSTEM_RESOURCE_TABLE_GUID, 215 228 }, 216 229 { 217 - "device tree", 230 + NULL, "device tree", 218 231 EFI_FDT_GUID, 219 232 }, 220 233 { 221 - "SMBIOS table", 234 + NULL, "SMBIOS table", 222 235 SMBIOS_TABLE_GUID, 223 236 }, 224 237 { 225 - "SMBIOS3 table", 238 + NULL, "SMBIOS3 table", 226 239 SMBIOS3_TABLE_GUID, 227 240 }, 228 241 { 229 - "Runtime properties", 242 + NULL, "Runtime properties", 230 243 EFI_RT_PROPERTIES_TABLE_GUID, 231 244 }, 232 245 { 233 - "TCG2 Final Events Table", 246 + NULL, "TCG2 Final Events Table", 234 247 EFI_TCG2_FINAL_EVENTS_TABLE_GUID, 235 248 }, 236 249 { 237 - "EFI Conformance Profiles Table", 250 + NULL, "EFI Conformance Profiles Table", 238 251 EFI_CONFORMANCE_PROFILES_TABLE_GUID, 239 252 }, 240 253 #ifdef CONFIG_EFI_RISCV_BOOT_PROTOCOL 241 254 { 242 - "RISC-V Boot", 255 + NULL, "RISC-V Boot", 243 256 RISCV_EFI_BOOT_PROTOCOL_GUID, 244 257 }, 245 258 #endif ··· 247 260 #ifdef CONFIG_CMD_NVEDIT_EFI 248 261 /* signature database */ 249 262 { 250 - "EFI_GLOBAL_VARIABLE_GUID", 263 + "EFI_GLOBAL_VARIABLE_GUID", NULL, 251 264 EFI_GLOBAL_VARIABLE_GUID, 252 265 }, 253 266 { 254 - "EFI_IMAGE_SECURITY_DATABASE_GUID", 267 + "EFI_IMAGE_SECURITY_DATABASE_GUID", NULL, 255 268 EFI_IMAGE_SECURITY_DATABASE_GUID, 256 269 }, 257 270 /* certificate types */ 258 271 { 259 - "EFI_CERT_SHA256_GUID", 272 + "EFI_CERT_SHA256_GUID", NULL, 260 273 EFI_CERT_SHA256_GUID, 261 274 }, 262 275 { 263 - "EFI_CERT_X509_GUID", 276 + "EFI_CERT_X509_GUID", NULL, 264 277 EFI_CERT_X509_GUID, 265 278 }, 266 279 { 267 - "EFI_CERT_TYPE_PKCS7_GUID", 280 + "EFI_CERT_TYPE_PKCS7_GUID", NULL, 268 281 EFI_CERT_TYPE_PKCS7_GUID, 269 282 }, 270 283 #endif 271 284 #if defined(CONFIG_CMD_EFIDEBUG) || defined(CONFIG_EFI) 272 - { "EFI_LZMA_COMPRESSED", EFI_LZMA_COMPRESSED }, 273 - { "EFI_DXE_SERVICES", EFI_DXE_SERVICES }, 274 - { "EFI_HOB_LIST", EFI_HOB_LIST }, 275 - { "EFI_MEMORY_TYPE", EFI_MEMORY_TYPE }, 276 - { "EFI_MEM_STATUS_CODE_REC", EFI_MEM_STATUS_CODE_REC }, 277 - { "EFI_GUID_EFI_ACPI1", EFI_GUID_EFI_ACPI1 }, 285 + { "EFI_LZMA_COMPRESSED", NULL, EFI_LZMA_COMPRESSED }, 286 + { "EFI_DXE_SERVICES", NULL, EFI_DXE_SERVICES }, 287 + { "EFI_HOB_LIST", NULL, EFI_HOB_LIST }, 288 + { "EFI_MEMORY_TYPE", NULL, EFI_MEMORY_TYPE }, 289 + { "EFI_MEM_STATUS_CODE_REC", NULL, EFI_MEM_STATUS_CODE_REC }, 290 + { "EFI_GUID_EFI_ACPI1", NULL, EFI_GUID_EFI_ACPI1 }, 278 291 #endif 292 + #endif /* EFI_PARTITION */ 279 293 #endif /* !USE_HOSTCC */ 280 294 }; 281 295 ··· 284 298 int i; 285 299 286 300 for (i = 0; i < ARRAY_SIZE(list_guid); i++) { 287 - if (!strcmp(list_guid[i].string, guid_str)) { 301 + if (list_guid[i].type && 302 + !strcmp(list_guid[i].type, guid_str)) { 288 303 memcpy(guid_bin, &list_guid[i].guid, 16); 289 304 return 0; 290 305 } ··· 298 313 299 314 for (i = 0; i < ARRAY_SIZE(list_guid); i++) { 300 315 if (!memcmp(list_guid[i].guid.b, guid_bin, 16)) { 301 - return list_guid[i].string; 316 + if (list_guid[i].description) 317 + return list_guid[i].description; 318 + return list_guid[i].type; 302 319 } 303 320 } 304 321 return NULL; ··· 312 329 uint64_t tmp64; 313 330 314 331 if (!uuid_str_valid(uuid_str)) { 315 - #ifdef CONFIG_PARTITION_TYPE_GUID 316 - if (!uuid_guid_get_bin(uuid_str, uuid_bin)) 332 + if (IS_ENABLED(CONFIG_PARTITION_TYPE_GUID) && 333 + !uuid_guid_get_bin(uuid_str, uuid_bin)) 317 334 return 0; 318 - #endif 319 335 return -EINVAL; 320 336 } 321 337
+1 -2
test/common/print.c
··· 45 45 sprintf(str, "%pUL", guid); 46 46 ut_asserteq_str("04030201-0605-0807-090A-0B0C0D0E0F10", str); 47 47 sprintf(str, "%pUs", guid_esp); 48 - if (IS_ENABLED(CONFIG_PARTITION_TYPE_GUID) || 49 - IS_ENABLED(CONFIG_CMD_EFIDEBUG) || IS_ENABLED(CONFIG_EFI)) 48 + if (IS_ENABLED(CONFIG_EFI_PARTITION)) 50 49 ut_asserteq_str("EFI System Partition", str); 51 50 else 52 51 ut_asserteq_str("c12a7328-f81f-11d2-ba4b-00a0c93ec93b", str);
+27
test/py/tests/test_gpt.py
··· 330 330 output = ubman.run_command('gpt guid host 0') 331 331 assert '375a56f7-d6c9-4e81-b5f0-09d41ca89efe' in output 332 332 333 + @pytest.mark.boardspec('sandbox') 334 + @pytest.mark.buildconfigspec('cmd_gpt') 335 + @pytest.mark.buildconfigspec('cmd_part') 336 + @pytest.mark.buildconfigspec('partition_type_guid') 337 + @pytest.mark.requiredtool('sgdisk') 338 + def test_gpt_write_part_type(state_disk_image, ubman): 339 + """Test the gpt command with part type uuid.""" 340 + 341 + output = ubman.run_command('gpt write host 0 "name=part1,type=data,size=1M;name=part2,size=512K,type=system;name=part3,size=65536,type=u-boot-env;name=part4,size=65536,type=375a56f7-d6c9-4e81-b5f0-09d41ca89efe;name=part5,size=-,type=linux"') 342 + assert 'Writing GPT: success!' in output 343 + output = ubman.run_command('part list host 0') 344 + assert '1\t0x00000022\t0x00000821\t"part1"' in output 345 + assert 'ebd0a0a2-b9e5-4433-87c0-68b6b72699c7' in output 346 + assert '(data)' in output 347 + assert '2\t0x00000822\t0x00000c21\t"part2"' in output 348 + assert 'c12a7328-f81f-11d2-ba4b-00a0c93ec93b' in output 349 + assert '(EFI System Partition)' in output 350 + assert '3\t0x00000c22\t0x00000ca1\t"part3"' in output 351 + assert '3de21764-95bd-54bd-a5c3-4abe786f38a8' in output 352 + assert '(u-boot-env)' in output 353 + assert '4\t0x00000ca2\t0x00000d21\t"part4"' in output 354 + assert 'ebd0a0a2-b9e5-4433-87c0-68b6b72699c7' in output 355 + assert '(375a56f7-d6c9-4e81-b5f0-09d41ca89efe)' in output 356 + assert '5\t0x00000d22\t0x00001fde\t"part5"' in output 357 + assert '0fc63daf-8483-4772-8e79-3d69d8477de4' in output 358 + assert '(linux)' in output 359 + 333 360 @pytest.mark.buildconfigspec('cmd_gpt') 334 361 @pytest.mark.buildconfigspec('cmd_gpt_rename') 335 362 @pytest.mark.buildconfigspec('cmd_part')