meta-rockchip/wic
Trevor Woerner 88f2064ca2 wic: add GPT partition names to partitions
A filesystem label (/dev/disk/by-label) is a property of, and stored in, the
filesystem itself. Partitions that are not destined to hold filesystems are
not formatted, therefore it is not possible to assign filesystem labels to
such partitions.

However, if GPT partitioning is being used, GPT supports the notion of
assigning labels/names to the partitions which are stored as part of the GPT
partition table itself (instead of being stored in the filesystem in the
partition). The naming is a bit confusing (different tools use different
names) but `wic` calls this "--part-name", `lsblk` calls this "PARTLABEL", and
`parted` calls this "name".

In Linux user-space these partition labels are referenced via
/dev/disk/by-partlabel and provide an excellent way of finding these GPT
partitions regardless of which backing device is actually being used (e.g.
mmcblk0, mmcblk1... i.e. emmc, sdcard...).

An example where this would be handy is for interacting with a stored U-Boot
environment. Another potential use would be to use one of the unused raw
partitions to store information such as MAC addresses, serial numbers, etc.
which could be set/updated "at the factory" as images are flashed.

Tested with both systemd and sysvinit on both rock-pi-e and rock-pi-s.

Reviewed-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2024-04-22 09:16:55 -04:00
..
rockchip.wks wic: add GPT partition names to partitions 2024-04-22 09:16:55 -04:00