Date: Fri, 9 Sep 2022 12:20:59 +0200 (CEST) From: Mark Kettenis Subject: Snapdragon 7c Acer Aspire 1 GPT partition hell So I saw this really cheap snapdragon 7c laptop on offer, and after the work done to make the x13s work, I couldn't resist getting one and see if it would run OpenBSD. Well, it does. It needed the same SMMU bypass/disable quirk as the X13s (just matching a different ACPI _HID), and a tweak to make USB attach. Both of these have been committed. The qciic(4) driver appears to work on this hardware as well, but qcgpio(4) needs a bit of work, so no working keyboard yet. This laptop doesn't have NVMe storage. Instead it has eMMC storage, much like the cheap Intel netbooks. The sdhc(4) driver appears to work, but before I commit the one-line diff that enables this, there are two issues we need to solve regarding the layout of the eMMC storage. I found a reference to this machine here: https://wiki.postmarketos.org/wiki/Acer_Aspire_1_(A114-61) That page contains a big fat warning that damaging the partition layout may brick the machine. Based on the fdisk output, I'm 99.9% sure that doing a "(W)hole disk" install on this machine would indeed be a very bad idea. So there are *49* partitions on this machine. I've googled some of the UUIDs and it appears to be a mix of Android and Qualcomm-specific partitions that are also present on Qualcomm-based phones. This immediately poses a problem for the disklabel spoofing code. We only spoof up to 8 partitions, which means that entries for the EFI system partition, the Windows partition and the Windows recovery partition don't even show up in the spoofed disklabel. So I think we need to find a way to skip partitions 0-45 n the spoofing code. But I'm not sure adding a long list of UUIDs in the kernel is the solution for that. The other problem is that fdisk(8) will of course kill these partitions if "(W)hole disk" is selected in the installer. Adding UUIDs there is maybe less of a problem, but providing a complete list that also works on other models that may have a slightly different set of partitions may be tricky. I did look at the GPT partition attributes for these partitions. Partition 0-45 all have the "Required Partition" bit set. Partition 49 also has the bit set. So at least on this machine, using that bit to decide whether to keep a partition or not would help. Thoughts? --- Primary GPT: Disk: sd0 Usable LBA: 34 to 122142705 [122142720 Sectors] GUID: 61a0aedb-6e3e-1b18-3f12-a1aa383caa98 #: type [ start: size ] guid name ------------------------------------------------------------------------ 0: ebbeadaf-22c9-e33b-8f5d-0e81686a68cb [ 2048: 4096 ] ddb6ce7a-b3d6-c2a4-e6af-e3b3ae4f542f modemst1 1: 0a288b1f-22c9-e33b-8f5d-0e81686a68cb [ 6144: 4096 ] f1d3a726-dc37-5c96-ac37-efb032f7115f modemst2 2: 57b90a16-22c9-e33b-8f5d-0e81686a68cb [ 10240: 2048 ] e2359374-f52c-959c-6922-8c9ae41dc96b fsc 3: 638ff8e2-22c9-e33b-8f5d-0e81686a68cb [ 12288: 4096 ] 71c85fc5-09e3-9da1-dcdf-c806e2e3f3f9 fsg 4: f97b8793-3abf-4719-896b-7c3e9b85e104 [ 16384: 2048 ] 37f3b2ab-4e07-833c-a3c9-b3b94c885a92 DPP 5: 04a856b8-84c1-4075-8391-9a994235e5f0 [ 18432: 2048 ] ee3edcf3-284d-bd6c-e324-909764a1f8db SMBIOS 6: 2c86e742-745e-4fdd-bfd8-b6a7ac638772 [ 20480: 2048 ] dc6de682-44a4-d820-d5ac-d72ad465200d SSD 7: a19f205f-ccd8-4b6d-8f1e-2d9bc24cffb1 [ 22528: 2048 ] f1aca0da-110b-a557-c6f7-75c838b01fc5 CDT 8: dea0ba2c-cbdd-4805-b4f9-f428251c3e98 [ 24576: 8192 ] 9bdd9c66-5d95-08f2-4cec-749e3a9f4448 XBL 9: 5a325ae4-4276-b66d-0add-3494df27706a [ 32768: 2048 ] 012287e7-af0a-b564-fe58-c20fb11e7e08 XBL_CONFIG 10: 10a0c19c-516a-5444-5ce3-664c3226a794 [ 34816: 2048 ] bda4ba7f-27b2-0241-2d95-08e548a44e94 limits 11: 20a0c19c-286a-42fa-9ce7-f64c3226a794 [ 36864: 2048 ] 3aebab81-9d40-c353-ae7a-48c5766a252f DDR 12: 76cfc7ef-039d-4e2c-b81e-4dd8c2cb2a93 [ 38912: 2048 ] b234ea70-d3e5-9704-e499-834f33423677 SECDATA 13: e6e98da2-e22a-4d12-ab33-169e7deaa507 [ 40960: 2048 ] 647a0a17-af73-4f5c-d24f-2f20fb9a6fd7 APDP 14: bc0330eb-3410-4951-a617-03898dbe3372 [ 43008: 32768 ] c7a3a6cd-c952-2f30-5cb0-6a1e28e45bef LogFS 15: d69e90a5-4cab-0071-f6df-ab977f141a7f [ 75776: 2048 ] 6d26a46b-bfe9-b56c-397a-7758ade29b7b AOP 16: a053aa7f-40b8-4b1c-ba08-2f68ac71a4f4 [ 77824: 8192 ] ceb0255e-096d-7d85-ac74-4efcf31d25de TZ 17: f65d4b16-343d-4e25-aafc-be99b6556a6d [ 86016: 2048 ] 71dc8d3c-f7ef-b4bd-a644-0705cd87f39e DEVCFG 18: e1a6a689-0c8d-4cc6-b4e8-55a4320fbd8a [ 88064: 2048 ] 715de6e1-8028-bdf3-e7ff-83ccfdf164f2 HYP 19: 21d1219f-2ed1-4ab4-930a-41a16ae75f7f [ 90112: 2048 ] 2361932f-bc2a-d64d-1cdc-ca34b49a5a9e QUP 20: 14d11c40-2a3d-4f97-882d-103a1ec09333 [ 92160: 4096 ] 4e6d0466-ecef-b9a7-2fc0-1289392fceea TZAPPS 21: 97745aba-135a-44c3-9adc-05616173c24c [ 96256: 2048 ] 3f299f6c-0185-fb9d-0d52-2615530dcd08 ToolsFv 22: 17911177-c9e6-4372-933c-804b678e666f [ 98304: 2048 ] ba15d3ba-33fe-b493-b721-bcfd61b8bdf0 ImageFv 23: f8deafad-b9e5-4873-8c80-68b6b72699c7 [ 100352: 32768 ] cca54461-3c3d-7f00-9153-425000909ea3 ADSP 24: e126a436-757e-42d0-8d19-0f362f7a62b8 [ 133120: 2048 ] 805d81f9-5ee8-b59f-8077-e276e14a8bb5 multiimgoem 25: 543c031a-4cb6-4897-bffe-4b485768a8ad [ 135168: 4096 ] 6ba5d614-d098-55f9-02a3-d84e6c09e6cb PLAT 26: 3c44f88b-1878-4c29-b122-ee78766442a7 [ 139264: 2048 ] 8290ad8e-9a94-95d7-8dd0-2c2913edca07 SYSFW_VERSION 27: b7524b2d-0a91-49a2-aa5e-bda266699d49 [ 141312: 2048 ] bca70f84-e626-1e99-a07d-7e2076835602 EnterpriseFv 28: c80325ba-7ec2-4a30-b2f7-18f646086185 [ 143360: 143360 ] 47f25f17-37f2-9ceb-acfc-7cf9499997f6 UpdateCapsule 29: fa4cbe53-31b5-4c23-9c1e-a01feb966856 [ 286720: 245760 ] f2f21f87-f57c-64b6-518e-93747be985ab NHLOS 30: a3381699-350c-465e-bd5d-fa3ab901a39a [ 532480: 2048 ] 37ce2d1a-5855-d119-4b2e-ccf1896338ed BACKUP_DPP 31: a3381699-350c-465e-bd5d-fa3ab901a39a [ 534528: 2048 ] b38c643d-5e4d-7384-3956-e0f052ed4d2e BACKUP_SMBIOS 32: a3381699-350c-465e-bd5d-fa3ab901a39a [ 536576: 8192 ] 32f1ba47-04fe-ee02-0b80-2abfe145c500 BACKUP_XBL 33: a3381699-350c-465e-bd5d-fa3ab901a39a [ 544768: 2048 ] a4901d0f-ba7e-2c65-e369-526c50b3f9ce BACKUP_XBL_CONFIG 34: a3381699-350c-465e-bd5d-fa3ab901a39a [ 546816: 2048 ] 11f2963c-c5c9-121a-ba6e-f209780b5fac BACKUP_AOP 35: a3381699-350c-465e-bd5d-fa3ab901a39a [ 548864: 8192 ] 4f20a01f-dce8-0530-b2da-af395eeac74a BACKUP_TZ 36: a3381699-350c-465e-bd5d-fa3ab901a39a [ 557056: 2048 ] 6310ecc7-ce63-1fe1-88c7-c286b682dad1 BACKUP_DEVCFG 37: a3381699-350c-465e-bd5d-fa3ab901a39a [ 559104: 2048 ] b60a94ba-b9ef-b87d-4ba8-04575da97fd1 BACKUP_HYP 38: a3381699-350c-465e-bd5d-fa3ab901a39a [ 561152: 2048 ] 5831d2be-ea84-da2d-17cc-02e0f62b9445 BACKUP_QUP 39: a3381699-350c-465e-bd5d-fa3ab901a39a [ 563200: 4096 ] 556313f2-f2e6-1043-d4f4-43b0425bc627 BACKUP_TZAPPS 40: a3381699-350c-465e-bd5d-fa3ab901a39a [ 567296: 2048 ] 85aa8877-a7bc-d28a-197f-8d635de71b04 BACKUP_ToolsFv 41: a3381699-350c-465e-bd5d-fa3ab901a39a [ 569344: 2048 ] d97833cf-eb0e-506f-aa18-15790fa19da8 BACKUP_ImageFv 42: a3381699-350c-465e-bd5d-fa3ab901a39a [ 571392: 32768 ] 0bb48658-3acb-c46c-40f2-93cb1f4f13fa BACKUP_ADSP 43: a3381699-350c-465e-bd5d-fa3ab901a39a [ 604160: 4096 ] 3b5d67be-3cf5-b57a-e7cf-4f76fedb4017 BACKUP_PLAT 44: a3381699-350c-465e-bd5d-fa3ab901a39a [ 608256: 2048 ] 644a86e6-df05-8f3c-6088-7bf2c1562e71 BACKUP_multiimgoem 45: a3381699-350c-465e-bd5d-fa3ab901a39a [ 610304: 2048 ] af190ef7-b029-67bb-2a3e-70fdaceee3a6 BACKUP_EnterpriseFv 46: EFI Sys [ 622592: 532480 ] 3aff027b-a02b-485d-aa53-a7317f013f61 EFI system partition 47: e3c9e316-0b5c-4db8-817d-f92df00215ae [ 1155072: 32768 ] 286d695d-1784-42e0-95a2-c201deb5540f Microsoft reserved partition 48: Microsoft basic data [ 1187840: 118855680 ] b3fcf58f-43f7-4a06-a550-5da0ba225330 Basic data partition 49: Win Recovery [ 120043520: 2097152 ] 8889c4f1-e9a1-4944-9573-57f7699df432 Basic data partition Secondary GPT: Disk: sd0 Usable LBA: 34 to 122142705 [122142720 Sectors] GUID: 61a0aedb-6e3e-1b18-3f12-a1aa383caa98 #: type [ start: size ] guid name ------------------------------------------------------------------------ 0: ebbeadaf-22c9-e33b-8f5d-0e81686a68cb [ 2048: 4096 ] ddb6ce7a-b3d6-c2a4-e6af-e3b3ae4f542f modemst1 1: 0a288b1f-22c9-e33b-8f5d-0e81686a68cb [ 6144: 4096 ] f1d3a726-dc37-5c96-ac37-efb032f7115f modemst2 2: 57b90a16-22c9-e33b-8f5d-0e81686a68cb [ 10240: 2048 ] e2359374-f52c-959c-6922-8c9ae41dc96b fsc 3: 638ff8e2-22c9-e33b-8f5d-0e81686a68cb [ 12288: 4096 ] 71c85fc5-09e3-9da1-dcdf-c806e2e3f3f9 fsg 4: f97b8793-3abf-4719-896b-7c3e9b85e104 [ 16384: 2048 ] 37f3b2ab-4e07-833c-a3c9-b3b94c885a92 DPP 5: 04a856b8-84c1-4075-8391-9a994235e5f0 [ 18432: 2048 ] ee3edcf3-284d-bd6c-e324-909764a1f8db SMBIOS 6: 2c86e742-745e-4fdd-bfd8-b6a7ac638772 [ 20480: 2048 ] dc6de682-44a4-d820-d5ac-d72ad465200d SSD 7: a19f205f-ccd8-4b6d-8f1e-2d9bc24cffb1 [ 22528: 2048 ] f1aca0da-110b-a557-c6f7-75c838b01fc5 CDT 8: dea0ba2c-cbdd-4805-b4f9-f428251c3e98 [ 24576: 8192 ] 9bdd9c66-5d95-08f2-4cec-749e3a9f4448 XBL 9: 5a325ae4-4276-b66d-0add-3494df27706a [ 32768: 2048 ] 012287e7-af0a-b564-fe58-c20fb11e7e08 XBL_CONFIG 10: 10a0c19c-516a-5444-5ce3-664c3226a794 [ 34816: 2048 ] bda4ba7f-27b2-0241-2d95-08e548a44e94 limits 11: 20a0c19c-286a-42fa-9ce7-f64c3226a794 [ 36864: 2048 ] 3aebab81-9d40-c353-ae7a-48c5766a252f DDR 12: 76cfc7ef-039d-4e2c-b81e-4dd8c2cb2a93 [ 38912: 2048 ] b234ea70-d3e5-9704-e499-834f33423677 SECDATA 13: e6e98da2-e22a-4d12-ab33-169e7deaa507 [ 40960: 2048 ] 647a0a17-af73-4f5c-d24f-2f20fb9a6fd7 APDP 14: bc0330eb-3410-4951-a617-03898dbe3372 [ 43008: 32768 ] c7a3a6cd-c952-2f30-5cb0-6a1e28e45bef LogFS 15: d69e90a5-4cab-0071-f6df-ab977f141a7f [ 75776: 2048 ] 6d26a46b-bfe9-b56c-397a-7758ade29b7b AOP 16: a053aa7f-40b8-4b1c-ba08-2f68ac71a4f4 [ 77824: 8192 ] ceb0255e-096d-7d85-ac74-4efcf31d25de TZ 17: f65d4b16-343d-4e25-aafc-be99b6556a6d [ 86016: 2048 ] 71dc8d3c-f7ef-b4bd-a644-0705cd87f39e DEVCFG 18: e1a6a689-0c8d-4cc6-b4e8-55a4320fbd8a [ 88064: 2048 ] 715de6e1-8028-bdf3-e7ff-83ccfdf164f2 HYP 19: 21d1219f-2ed1-4ab4-930a-41a16ae75f7f [ 90112: 2048 ] 2361932f-bc2a-d64d-1cdc-ca34b49a5a9e QUP 20: 14d11c40-2a3d-4f97-882d-103a1ec09333 [ 92160: 4096 ] 4e6d0466-ecef-b9a7-2fc0-1289392fceea TZAPPS 21: 97745aba-135a-44c3-9adc-05616173c24c [ 96256: 2048 ] 3f299f6c-0185-fb9d-0d52-2615530dcd08 ToolsFv 22: 17911177-c9e6-4372-933c-804b678e666f [ 98304: 2048 ] ba15d3ba-33fe-b493-b721-bcfd61b8bdf0 ImageFv 23: f8deafad-b9e5-4873-8c80-68b6b72699c7 [ 100352: 32768 ] cca54461-3c3d-7f00-9153-425000909ea3 ADSP 24: e126a436-757e-42d0-8d19-0f362f7a62b8 [ 133120: 2048 ] 805d81f9-5ee8-b59f-8077-e276e14a8bb5 multiimgoem 25: 543c031a-4cb6-4897-bffe-4b485768a8ad [ 135168: 4096 ] 6ba5d614-d098-55f9-02a3-d84e6c09e6cb PLAT 26: 3c44f88b-1878-4c29-b122-ee78766442a7 [ 139264: 2048 ] 8290ad8e-9a94-95d7-8dd0-2c2913edca07 SYSFW_VERSION 27: b7524b2d-0a91-49a2-aa5e-bda266699d49 [ 141312: 2048 ] bca70f84-e626-1e99-a07d-7e2076835602 EnterpriseFv 28: c80325ba-7ec2-4a30-b2f7-18f646086185 [ 143360: 143360 ] 47f25f17-37f2-9ceb-acfc-7cf9499997f6 UpdateCapsule 29: fa4cbe53-31b5-4c23-9c1e-a01feb966856 [ 286720: 245760 ] f2f21f87-f57c-64b6-518e-93747be985ab NHLOS 30: a3381699-350c-465e-bd5d-fa3ab901a39a [ 532480: 2048 ] 37ce2d1a-5855-d119-4b2e-ccf1896338ed BACKUP_DPP 31: a3381699-350c-465e-bd5d-fa3ab901a39a [ 534528: 2048 ] b38c643d-5e4d-7384-3956-e0f052ed4d2e BACKUP_SMBIOS 32: a3381699-350c-465e-bd5d-fa3ab901a39a [ 536576: 8192 ] 32f1ba47-04fe-ee02-0b80-2abfe145c500 BACKUP_XBL 33: a3381699-350c-465e-bd5d-fa3ab901a39a [ 544768: 2048 ] a4901d0f-ba7e-2c65-e369-526c50b3f9ce BACKUP_XBL_CONFIG 34: a3381699-350c-465e-bd5d-fa3ab901a39a [ 546816: 2048 ] 11f2963c-c5c9-121a-ba6e-f209780b5fac BACKUP_AOP 35: a3381699-350c-465e-bd5d-fa3ab901a39a [ 548864: 8192 ] 4f20a01f-dce8-0530-b2da-af395eeac74a BACKUP_TZ 36: a3381699-350c-465e-bd5d-fa3ab901a39a [ 557056: 2048 ] 6310ecc7-ce63-1fe1-88c7-c286b682dad1 BACKUP_DEVCFG 37: a3381699-350c-465e-bd5d-fa3ab901a39a [ 559104: 2048 ] b60a94ba-b9ef-b87d-4ba8-04575da97fd1 BACKUP_HYP 38: a3381699-350c-465e-bd5d-fa3ab901a39a [ 561152: 2048 ] 5831d2be-ea84-da2d-17cc-02e0f62b9445 BACKUP_QUP 39: a3381699-350c-465e-bd5d-fa3ab901a39a [ 563200: 4096 ] 556313f2-f2e6-1043-d4f4-43b0425bc627 BACKUP_TZAPPS 40: a3381699-350c-465e-bd5d-fa3ab901a39a [ 567296: 2048 ] 85aa8877-a7bc-d28a-197f-8d635de71b04 BACKUP_ToolsFv 41: a3381699-350c-465e-bd5d-fa3ab901a39a [ 569344: 2048 ] d97833cf-eb0e-506f-aa18-15790fa19da8 BACKUP_ImageFv 42: a3381699-350c-465e-bd5d-fa3ab901a39a [ 571392: 32768 ] 0bb48658-3acb-c46c-40f2-93cb1f4f13fa BACKUP_ADSP 43: a3381699-350c-465e-bd5d-fa3ab901a39a [ 604160: 4096 ] 3b5d67be-3cf5-b57a-e7cf-4f76fedb4017 BACKUP_PLAT 44: a3381699-350c-465e-bd5d-fa3ab901a39a [ 608256: 2048 ] 644a86e6-df05-8f3c-6088-7bf2c1562e71 BACKUP_multiimgoem 45: a3381699-350c-465e-bd5d-fa3ab901a39a [ 610304: 2048 ] af190ef7-b029-67bb-2a3e-70fdaceee3a6 BACKUP_EnterpriseFv 46: EFI Sys [ 622592: 532480 ] 3aff027b-a02b-485d-aa53-a7317f013f61 EFI system partition 47: e3c9e316-0b5c-4db8-817d-f92df00215ae [ 1155072: 32768 ] 286d695d-1784-42e0-95a2-c201deb5540f Microsoft reserved partition 48: Microsoft basic data [ 1187840: 118855680 ] b3fcf58f-43f7-4a06-a550-5da0ba225330 Basic data partition 49: Win Recovery [ 120043520: 2097152 ] 8889c4f1-e9a1-4944-9573-57f7699df432 Basic data partition MBR: Disk: sd0 geometry: 7603/255/63 [122142720 Sectors] Offset: 0 Signature: 0xAA55 Starting Ending LBA Info: #: id C H S - C H S [ start: size ] ------------------------------------------------------------------------------- 0: EE 0 0 2 - 7603 8 21 [ 1: 122142719 ] EFI GPT 1: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused 2: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused 3: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused