Toradex Easy Installer: Set GPT Partition Label During Creation

It would be extremely useful to be able to set GPT Partition Labels during GPT creation in Toradex Easy Installer, specified through the image.json of the image.

The primary use-case for this is having a machine+DT+kernel-agnostic way to reference partitions on the system, useful for things like finding the rootfs for kernel boot, and for dual-copy update configurations, where multiple rootfs instances are stored on the eMMC or other storage device.

Alternatives / Workarounds

I have achieved this functionality in the past in TEZI through post install scripts and using sgdisk by chrooting into the installed rootfs, but this is less ideal, as it requires installing tools that otherwise wouldn’t be required for the production (sgdisk and dependencies) and requires hard-coding of the partition order in the script, when this definition is duplicated in image.json.

Additionally, filesystem labels (which of course can be set by TEZI) are not as as useful in this case, as if an update were to be pushed to the system as a raw filesystem binary, that update image would need to contain the filesystem label. This is not ideal if that binary could potentially be installed to different partitions, a.e. rofs-a and rofs-b; in this case different binaries would need to be created for each potential label needed, or scripting would need to be used to manually re-label filesystems after installing them.

Finally, the other alternative of hard-coding device numbers/paths and partition order is less ideal as device numbers are subject to change as kernel/DT versions change (a.e. upstream TDX aliases in DT change), and of course make it more difficult for multiple platoforms with different storage mediums to be supported by the same image.

This would be a great feature which would greatly increase the appeal of continued use of Toradex SOMs for my projects! Thanks for considering!

Please check this thread:

Thanks for the reply! I’ve looked that thread over before, but unless I’m missing something, the result of that thread just shows that the bootable flag can now be set on the partition through TEZI. I see the requestor mentioned setting the name of partitions, but I don’t see if that was ever directly addressed or responded TO. Am I missing something?

Hello @danny.kaehn,
We can analyze this input as a feature request. However, because of the way we update Tezi on production devices (only when necessary), even if we implement it, you won’t be getting this feature in your modules installed by default anytime soon.
To use the new feature, you would have to add a second step in your production programming that would load the updated Tezi and from that do the installation.

Have you considered maybe using blkid in your postinstall script to get the stable UUID’s for the partitions and use this to mount your partitions?
This would still mean that you would have to edit your fstab after installing, but the ID’s are going to be stable.

blkid is available in Tezi, so you don’t need to install extra tools on your rootfs.

As another alternative, it seems that it’s possible to set the UUID of a partition, which could be another alternative for you:

You could use tune2fs.e2fsprogs, also available in Tezi, to set the UUID of the partitions to the ones you have set on your fstab.

Does this help you?