* [meta-rockchip][PATCH] wic: add GPT partition names to partitions
@ 2024-04-18 22:04 Trevor Woerner
2024-04-22 9:15 ` [yocto-patches] " Quentin Schulz
2024-04-22 13:18 ` Trevor Woerner
0 siblings, 2 replies; 3+ messages in thread
From: Trevor Woerner @ 2024-04-18 22:04 UTC (permalink / raw)
To: yocto-patches
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.
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
wic/rockchip.wks | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/wic/rockchip.wks b/wic/rockchip.wks
index a9e5508d3ff5..9ba3352b51bb 100644
--- a/wic/rockchip.wks
+++ b/wic/rockchip.wks
@@ -18,14 +18,14 @@
# atf 24576 8192 (trusted OS e.g. ATF, OP-TEE, etc)
# root 32768 -
-part loader1 --offset 64s --fixed-size 3552K --fstype=none --source rawcopy --sourceparams="file=${SPL_BINARY}"
-part v_storage --offset 7168s --fixed-size 256K --fstype=none
-part reserved --offset 7680s --fixed-size 192K --fstype=none
-part reserved1 --offset 8064s --fixed-size 32K --fstype=none
-part uboot_env --offset 8128s --fixed-size 32K --fstype=none
-part reserved2 --offset 8192s --fixed-size 4096K --fstype=none
-part loader2 --offset 16384s --fixed-size 4096K --fstype=none --source rawcopy --sourceparams="file=u-boot.${UBOOT_SUFFIX}"
-part atf --offset 24576s --fixed-size 4096K --fstype=none
-part / --label root --active --fstype=ext4 --source rootfs
+part loader1 --offset 64s --fixed-size 3552K --fstype=none --part-name loader1 --source rawcopy --sourceparams="file=${SPL_BINARY}"
+part v_storage --offset 7168s --fixed-size 256K --fstype=none --part-name v_storage
+part reserved --offset 7680s --fixed-size 192K --fstype=none --part-name reserved
+part reserved1 --offset 8064s --fixed-size 32K --fstype=none --part-name reserved1
+part uboot_env --offset 8128s --fixed-size 32K --fstype=none --part-name uboot_env
+part reserved2 --offset 8192s --fixed-size 4096K --fstype=none --part-name reserved2
+part loader2 --offset 16384s --fixed-size 4096K --fstype=none --part-name loader2 --source rawcopy --sourceparams="file=u-boot.${UBOOT_SUFFIX}"
+part atf --offset 24576s --fixed-size 4096K --fstype=none --part-name atf
+part / --label root --active --fstype=ext4 --part-name root --source rootfs
bootloader --ptable gpt
--
2.44.0.478.g7774cfed6261
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [yocto-patches] [meta-rockchip][PATCH] wic: add GPT partition names to partitions
2024-04-18 22:04 [meta-rockchip][PATCH] wic: add GPT partition names to partitions Trevor Woerner
@ 2024-04-22 9:15 ` Quentin Schulz
2024-04-22 13:18 ` Trevor Woerner
1 sibling, 0 replies; 3+ messages in thread
From: Quentin Schulz @ 2024-04-22 9:15 UTC (permalink / raw)
To: yocto-patches
Hi Trevor,
On 4/19/24 00:04, Trevor Woerner via lists.yoctoproject.org wrote:
> 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.
>
> Signed-off-by: Trevor Woerner <twoerner@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Thanks,
Quentin
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [meta-rockchip][PATCH] wic: add GPT partition names to partitions
2024-04-18 22:04 [meta-rockchip][PATCH] wic: add GPT partition names to partitions Trevor Woerner
2024-04-22 9:15 ` [yocto-patches] " Quentin Schulz
@ 2024-04-22 13:18 ` Trevor Woerner
1 sibling, 0 replies; 3+ messages in thread
From: Trevor Woerner @ 2024-04-22 13:18 UTC (permalink / raw)
To: yocto-patches
On Thu 2024-04-18 @ 06:04:31 PM, Trevor Woerner wrote:
> 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.
>
> Signed-off-by: Trevor Woerner <twoerner@gmail.com>
> ---
> wic/rockchip.wks | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
Applied to meta-rockchip, master branch.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-04-22 13:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-18 22:04 [meta-rockchip][PATCH] wic: add GPT partition names to partitions Trevor Woerner
2024-04-22 9:15 ` [yocto-patches] " Quentin Schulz
2024-04-22 13:18 ` Trevor Woerner
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.