Make GPT partition as bootable from Toradex Easy Installer

Hi,

I’m configuring new partitions on emmc. I need 5 partitions for OTA with RAUC (2xrootfs, 2xbootfs and 1 data).
I saw here I need to configure Toradex Easy Installer to use GPT instead of the old MBR if I want more than 4 partitions.
Changing from MBR to GPT works well, I have my 5 parts on eMMC.
However, I want U-Boot to be able to determine which partition is bootable with the following command:

# part list mmc 0 -bootable devplist

as far as I tried, my devplist variable stayed in “non defined” state:

# printenv devplist                 
## Error: "devplist" not defined

I expected to see my partition 1 (bootfs1) in that variable as I configured my json image file with the following information: (based on GUID Partition Table - Wikipedia)

	    "partition_type": "BC13C2FF-59E6-4262-A352-B275FD6F7172",
	    "active": true,

Do you know how can i correctly place the bootable flag on GPT partition with Toradex Easy Installer?

For debug, the attached image.json result in this mmc configuration:

Colibri iMX7 # mmc part     

Partition Map for MMC device 0  --   Partition Type: EFI

Part    Start LBA       End LBA         Name
        Attributes
        Type GUID
        Partition GUID
  1     0x00002000      0x00009fff      ""
        attrs:  0x0000000000000000
        type:   bc13c2ff-59e6-4262-a352-b275fd6f7172
        guid:   643e52a7-1953-4ca5-9206-db12878ef9b2
  2     0x0000a000      0x00109fff      ""
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   4559a961-9b7f-49da-938f-0d82ff07acab
  3     0x0010a000      0x00111fff      ""
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   2a96d490-e267-4cdc-866f-daec78b38aa9
  4     0x00112000      0x00211fff      ""
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   039c0afb-5bb1-4c76-9e1d-cff157e471b5
  5     0x00212000      0x00747fdd      ""
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   6ec5fe68-1aba-4a92-8c1c-a697c15f091e

Secondary question : How can I set the “Name” parameter of the partition with Toradex Easy Installer ?

My image.json file:

{
    "config_format": "2",
    "autoinstall": false,
    "name": "test Image",
    "description": "test image",
    "version": "5.0.0-devel-20200921144925+build.0",
    "release_date": "2020-09-21",
    "u_boot_env": "uEnv.txt",
    "prepare_script": "prepare.sh",
    "wrapup_script": "wrapup.sh",
    "marketing": "marketing.tar",
    "icon": "toradexlinux.png",
    "supported_product_ids": [
        "0039"
    ],
    "blockdevs": [
        {
            "name": "mmcblk0",
            "table_type": "gpt",
            "partitions": [
                {
                    "partition_size_nominal": 16,
                    "want_maximised": false,
		    "partition_type": "BC13C2FF-59E6-4262-A352-B275FD6F7172",
		    "active": true,
                    "content": {
                        "label": "BOOT-A",
                        "filesystem_type": "ext4",
                        "mkfs_options": "",
                        "filename": "test_image-colibri-imx7-emmc.bootfs.tar.xz",
                        "uncompressed_size": 5.98828125
                    }
                },
                {
                    "partition_size_nominal": 512,
                    "want_maximised": false,
                    "content": {
                        "label": "ROOTFS-A",
                        "filesystem_type": "ext4",
                        "mkfs_options": "-E nodiscard",
                        "filename": "test_image-colibri-imx7-emmc.tar.xz",
                        "uncompressed_size": 169.70703125
                    }
                },
                {
                    "partition_size_nominal": 16,
                    "want_maximised": false,
                    "content": {
                        "label": "BOOT-B",
                        "filesystem_type": "ext4",
                        "mkfs_options": "",
                        "filename": "test_image-colibri-imx7-emmc.bootfs.tar.xz",
                        "uncompressed_size": 5.98828125
                    }
                },
                {
                    "partition_size_nominal": 512,
                    "want_maximised": false,
                    "content": {
                        "label": "'ROOTFS-B",
                        "filesystem_type": "ext4",
                        "mkfs_options": "-E nodiscard",
                        "filename": "test_image-colibri-imx7-emmc.tar.xz",
                        "uncompressed_size": 169.70703125
                    }
                },
                {
                    "partition_size_nominal": 512,
                    "want_maximised": true,
                    "content": {
                        "label": "DATA",
                        "filesystem_type": "ext4"
                    }
                }
            ]
        },
        {
            "name": "mmcblk0boot0",
            "erase": true,
            "content": {
                "filesystem_type": "raw",
                "rawfiles": [
                    {
                        "filename": "u-boot.imx",
                        "dd_options": "seek=2"
                    }
                ]
            }
        }
    ]
}

Greetings @Rapsody!

I’m consulting with the Toradex Easy Installer team to check on this.

Meanwhile, does creating a bootable GPT partition and printing devplist work if you do it manually (like in this example)?

Hi @gustavo.tx

the example works as expected :

Colibri iMX7 # setenv partitions 'uuid_disk=${uuid_gpt};name=u-boot,size=60MiB,uuid=${gpt_3};name=boot,size=60Mib,bootable,uuid=${gpt_1};name=rootfs,size=0,uuid=${gpt_2};'
Colibri iMX7 # setenv gpt_3 04f44f7c-41f6-44cd-9ed8-de937b5f339c
Colibri iMX7 # setenv gpt_1 27aa84d9-4b88-464c-9ac3-c64e3333fc09
Colibri iMX7 # setenv gpt_2 ddd3a5ab-7544-4dc0-ba97-d6e01aaec20b
Colibri iMX7 # gpt write mmc 0 $partitions                                                                                                                                 
Writing GPT: success!
Colibri iMX7 # mmc part

Partition Map for MMC device 0  --   Partition Type: EFI

Part    Start LBA       End LBA         Name
        Attributes
        Type GUID
        Partition GUID
  1     0x00000022      0x0001e021      "u-boot"
        attrs:  0x0000000000000000
        type:   ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
        guid:   04f44f7c-41f6-44cd-9ed8-de937b5f339c
  2     0x0001e022      0x0003c021      "boot"
        attrs:  0x0000000000000004
        type:   ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
        guid:   27aa84d9-4b88-464c-9ac3-c64e3333fc09
  3     0x0003c022      0x00747fde      "rootfs"
        attrs:  0x0000000000000000
        type:   ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
        guid:   ddd3a5ab-7544-4dc0-ba97-d6e01aaec20b
Colibri iMX7 # part list mmc 0 -bootable devplist
Colibri iMX7 # printenv devplist 
devplist=2

Looking forward for Toradex Easy Installer team reply !

Hello @gustavo.tx !

Thanks for the quick reply and fix!
It is working like a charm !

Colibri iMX7 # part list mmc 0 -bootable devplist
Colibri iMX7 # printenv devplist 
devplist=1

Congrats to the Easy Installer team !

Hey @Rapsody!

So glad to know it works. This functionality will also be there in the next production release of the Installer.

Always happy to help, feel free to contact us whenever you have any issues.

Best regards,

Gustavo.

Hello @Rapsody!

I’ve consulted the Easy Installer team and in fact the functionality for implementing the bootable flag was not there. Long story short, U-Boot uses the legacy bootable flag to mark the partitions and the way we are doing it on the Easy Installer required an extra argument to be passed along the flag. They were able to quickly fix that and the latest Toradex Easy Installer nightly build should already work.

You can download the latest nightly from here or directly via the Toradex Easy Installer you’re already running by just enabling the CI feeds and installing from there.

Please let me know your results.