genimage.cfg file clean-up
Subsystems (2)
cover genimage.cfg file clean-up
Hello,
This small series is a revamp of Giulio's series cleaning up genimage.cfg. This new version is the result of some discussion between Arnout and me to find a middle-ground situation.
So what we propose is to:
- Use the U and F specifiers provided by genimage for the EFI System Partition and FAT32 partitions respectively.
- Use the L specifier (explicitly specified in genimage.cfg, even though it is the default), for the root filesystem or other Linux filesystems. This means we would not comply with the systemd-specific Discoverable Partitions Specification
(https://systemd.io/DISCOVERABLE_PARTITIONS/), but we don't see the point of this specification (which requires identifying root filesystems for different architecture by different GUID) in the context of Buildroot. However, while we recommend using L for all new genimage.cfg, we do not change existing genimage.cfg, to not break them.
In this series, none of the patches except the last make any functional change. The last patch does introduce some functional
change: some partitions were identified as EFI System Partition even though they are not: the last commit converts them to use the "F" type, used for FAT filesystems.
Best regards,
Thomas Petazzoni
Thomas Petazzoni (8):
board/orangepi/common/genimage.cfg: use quotes around "gpt" board/*/genimage.cfg: use partition-table-type = "gpt" docs/manual: update documentation about partition-type-uuid convention
in genimage.cfg
board/orangepi/orangepi-r1/genimage.cfg: remove double quotes around
partition-type-uuid values
board/orangepi/orangepi-r1/genimage.cfg: use correct partition type board/*/genimage.cfg: use partition-type-uuid U where relevant board/sifive/hifive-unleashed/genimage*: convert partition-type-uuid
values to lower-case
board/*/genimage.cfg: use partition-type-uuid = F for some FAT
partitions
board/aarch64-efi/genimage-efi.cfg | 2 +- board/friendlyarm/nanopc-t4/genimage.cfg | 2 +- board/friendlyarm/nanopi-m4/genimage.cfg | 2 +- board/octavo/osd32mp1-brk/genimage.cfg | 2 +- board/octavo/osd32mp1-red/genimage.cfg | 2 +- board/olimex/stmp1_olinuxino/genimage.cfg | 2 +- board/orangepi/common/genimage.cfg | 2 +- board/orangepi/orangepi-r1/genimage.cfg | 4 ++-- board/pc/genimage-efi.cfg | 2 +- board/pine64/rockpro64/genimage.cfg | 2 +- board/qemu/aarch64-sbsa/genimage.cfg | 2 +- board/radxa/rockpi-4/genimage.cfg | 2 +- board/radxa/rockpi-n10/genimage.cfg | 2 +- board/radxa/rockpi-n8/genimage.cfg | 2 +- board/seeed/stm32mp157c-odyssey/genimage.cfg | 2 +- board/sifive/hifive-unleashed/genimage_sdcard.cfg | 6 +++--- board/sifive/hifive-unleashed/genimage_spi-nor.cfg | 4 ++-- .../common/stm32mp157/genimage.cfg.template | 2 +- docs/manual/writing-rules.txt | 12 ++++++++++++ 19 files changed, 34 insertions(+), 22 deletions(-)
Signature · 6 lines
2.37.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 1/8 board/orangepi/common/genimage.cfg: use quotes around "gpt"
Like we do in all other genimage configuration files.
--- board/orangepi/common/genimage.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
board/orangepi/common/genimage.cfg +1 -1
@@ -7,7 +7,7 @@ image sdcard.img { } hdimage { - partition-table-type = gpt + partition-table-type = "gpt" gpt-location = 1008K # 1MB - 16KB(GPT) gpt-no-backup = true }
Signature · 6 lines
2.37.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 2/8 board/*/genimage.cfg: use partition-table-type = "gpt"
In reply to Thomas Petazzoni via buildrootThe gpt = "true" form is deprecated in genimage, use partition-table-type = "gpt" instead.
--- board/octavo/osd32mp1-brk/genimage.cfg | 2 +- board/octavo/osd32mp1-red/genimage.cfg | 2 +- board/olimex/stmp1_olinuxino/genimage.cfg | 2 +- board/seeed/stm32mp157c-odyssey/genimage.cfg | 2 +- .../stmicroelectronics/common/stm32mp157/genimage.cfg.template | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
board/octavo/osd32mp1-brk/genimage.cfg +1 -1
@@ -1,6 +1,6 @@ image sdcard.img { hdimage { - gpt = "true" + partition-table-type = "gpt" } partition fsbl1 {
board/octavo/osd32mp1-red/genimage.cfg +1 -1
@@ -1,6 +1,6 @@ image sdcard.img { hdimage { - gpt = "true" + partition-table-type = "gpt" } partition fsbl1 {
board/olimex/stmp1_olinuxino/genimage.cfg +1 -1
@@ -1,6 +1,6 @@ image sdcard.img { hdimage { - gpt = "true" + partition-table-type = "gpt" } partition fsbl1 {
board/seeed/stm32mp157c-odyssey/genimage.cfg +1 -1
@@ -1,6 +1,6 @@ image sdcard.img { hdimage { - gpt = "true" + partition-table-type = "gpt" } partition fsbl1 {
board/stmicroelectronics/common/stm32mp157/genimage.cfg.template +1 -1
@@ -1,6 +1,6 @@ image sdcard.img { hdimage { - gpt = "true" + partition-table-type = "gpt" } partition fsbl1 {
Signature · 6 lines
2.37.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 3/8 docs/manual: update documentation about partition-type-uuid convention in genimage.cfg
In reply to Thomas Petazzoni via buildrootWhenever possible, we want to use the "shortcuts" provided by genimage for the partition-type-uuid values:
- U for the EFI System Partition
- F for FAT32 partitions
- L for root filesystem partitions and other Linux filesystems
In follow-up commits, we will convert existing genimage.cfg to this convention, except for the root filesystem, if the existing genimage.cfg specifies a partition-type-uuid that doesn't match the one that "L" would imply. In this case, we will things as-is to not break existing setups. However, for all future genimage.cfg files, we recommend to use "L" for the root filesystem.
--- docs/manual/writing-rules.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+)
docs/manual/writing-rules.txt +12 -0
@@ -198,6 +198,18 @@ image sdimage.img { chance, the byte count. In comments instead use +GB+, +MB+, +KB+ (not +kb+) in place of +G+, +M+, +K+. +* For GPT partitions, the +partition-type-uuid+ value must be +U+ for + the EFI System Partition (expanded to + +c12a7328-f81f-11d2-ba4b-00a0c93ec93b+ by _genimage_), +F+ for a FAT + partition (expanded to +ebd0a0a2-b9e5-4433-87c0-68b6b72699c7+ by + _genimage_) or +L+ for the root filesystem or other filesystems + (expanded to +0fc63daf-8483-4772-8e79-3d69d8477de4+ by + _genimage_). Even though +L+ is the default value of _genimage_, we + prefer to have it explicitly specified in our +genimage.cfg+ + files. Finally, these shortcuts should be used without double + quotes, e.g +partition-type-uuid = U+. If an explicit GUID is + specified, lower-case letters should be used. + The +genimage.cfg+ files are the input for the genimage tool used in Buildroot to generate the final image file(i.e. sdcard.img). For further details about the _genimage_ language, refer to
Signature · 6 lines
2.37.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 3/8] docs/manual: update documentation about partition-type-uuid convention in genimage.cfg
Thomas,, Giulio, All,
On 2022-07-22 22:21 +0200, Thomas Petazzoni via buildroot spake thusly:
Quoted 11 lines
Whenever possible, we want to use the "shortcuts" provided by genimage for the partition-type-uuid values:
- U for the EFI System Partition
- F for FAT32 partitions
- L for root filesystem partitions and other Linux filesystemsIn follow-up commits, we will convert existing genimage.cfg to this convention, except for the root filesystem, if the existing genimage.cfg specifies a partition-type-uuid that doesn't match the one that "L" would imply. In this case, we will things as-is to not
*we will _keep_ things...
Fixed when applying.
Regards,
Yann E. MORIN.
Quoted 38 lines
break existing setups. However, for all future genimage.cfg files, we recommend to use "L" for the root filesystem.
Signed-off-by Thomas Petazzoni <[email protected]>--- docs/manual/writing-rules.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+)docs/manual/writing-rules.txt +12
-0@@ -198,6 +198,18 @@ image sdimage.img { chance, the byte count. In comments instead use +GB+, +MB+, +KB+ (not +kb+) in place of +G+, +M+, +K+. +* For GPT partitions, the +partition-type-uuid+ value must be +U+ for + the EFI System Partition (expanded to + +c12a7328-f81f-11d2-ba4b-00a0c93ec93b+ by _genimage_), +F+ for a FAT + partition (expanded to +ebd0a0a2-b9e5-4433-87c0-68b6b72699c7+ by + _genimage_) or +L+ for the root filesystem or other filesystems + (expanded to +0fc63daf-8483-4772-8e79-3d69d8477de4+ by + _genimage_). Even though +L+ is the default value of _genimage_, we + prefer to have it explicitly specified in our +genimage.cfg+ + files. Finally, these shortcuts should be used without double + quotes, e.g +partition-type-uuid = U+. If an explicit GUID is + specified, lower-case letters should be used. + The +genimage.cfg+ files are the input for the genimage tool used in Buildroot to generate the final image file(i.e. sdcard.img). For further details about the _genimage_ language, refer toSignature · 6 lines
2.37.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 4/8 board/orangepi/orangepi-r1/genimage.cfg: remove double quotes around partition-type-uuid values
In reply to Thomas Petazzoni via buildrootThis allows to comply with the recently specified genimage.cfg writing rules.
--- board/orangepi/orangepi-r1/genimage.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
board/orangepi/orangepi-r1/genimage.cfg +2 -2
@@ -28,7 +28,7 @@ image sdcard.img { } partition boot { - partition-type-uuid = "U" + partition-type-uuid = U bootable = "true" image = "boot.vfat" }
@@ -36,7 +36,7 @@ image sdcard.img { # 'rootfs' will be used as the partition label, used # with root=PARTLABEL=rootfs kernel command line partition rootfs { - partition-type-uuid = "L" + partition-type-uuid = L image = "rootfs.ext4" size = 512M }
Signature · 6 lines
2.37.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 5/8 board/orangepi/orangepi-r1/genimage.cfg: use correct partition type
In reply to Thomas Petazzoni via buildrootThe boot partition is not an EFI System Partition, it is a normal FAT formatted partition, so using type F instead of U makes more sense.
--- board/orangepi/orangepi-r1/genimage.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
board/orangepi/orangepi-r1/genimage.cfg +1 -1
@@ -28,7 +28,7 @@ image sdcard.img { } partition boot { - partition-type-uuid = U + partition-type-uuid = F bootable = "true" image = "boot.vfat" }
Signature · 6 lines
2.37.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 6/8 board/*/genimage.cfg: use partition-type-uuid U where relevant
In reply to Thomas Petazzoni via buildrootThis commit changes to use partition-type-uuid = U instead of c12a7328-f81f-11d2-ba4b-00a0c93ec93b where relevant for the EFI System Partition.
--- board/aarch64-efi/genimage-efi.cfg | 2 +- board/pc/genimage-efi.cfg | 2 +- board/qemu/aarch64-sbsa/genimage.cfg | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
board/aarch64-efi/genimage-efi.cfg +1 -1
@@ -18,7 +18,7 @@ image disk.img { partition boot { image = "efi-part.vfat" - partition-type-uuid = c12a7328-f81f-11d2-ba4b-00a0c93ec93b + partition-type-uuid = U offset = 32K bootable = true }
board/pc/genimage-efi.cfg +1 -1
@@ -19,7 +19,7 @@ image disk.img { partition boot { image = "efi-part.vfat" - partition-type-uuid = c12a7328-f81f-11d2-ba4b-00a0c93ec93b + partition-type-uuid = U offset = 32K bootable = true }
board/qemu/aarch64-sbsa/genimage.cfg +1 -1
@@ -19,7 +19,7 @@ image disk.img { partition boot { image = "efi-part.vfat" - partition-type-uuid = c12a7328-f81f-11d2-ba4b-00a0c93ec93b + partition-type-uuid = U offset = 32K bootable = true }
Signature · 6 lines
2.37.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 7/8 board/sifive/hifive-unleashed/genimage*: convert partition-type-uuid values to lower-case
In reply to Thomas Petazzoni via buildrootThis allows to match the recently written rules for partition-type-uuid values.
--- board/sifive/hifive-unleashed/genimage_sdcard.cfg | 6 +++--- board/sifive/hifive-unleashed/genimage_spi-nor.cfg | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-)
board/sifive/hifive-unleashed/genimage_sdcard.cfg +3 -3
@@ -6,18 +6,18 @@ image sdcard.img { partition u-boot-spl { image = "u-boot-spl.bin" offset = 17K - partition-type-uuid = 5B193300-FC78-40CD-8002-E86C45580B47 + partition-type-uuid = 5b193300-fc78-40cd-8002-e86c45580b47 } partition u-boot { image = "u-boot.itb" offset = 1041K - partition-type-uuid = 2E54B353-1271-4842-806F-E436D6AF6985 + partition-type-uuid = 2e54b353-1271-4842-806f-e436d6af6985 } partition rootfs { image = "rootfs.ext4" - partition-type-uuid = 0FC63DAF-8483-4772-8E79-3D69D8477DE4 + partition-type-uuid = 0fc63daf-8483-4772-8e79-3d69d8477de4 bootable = true } }
board/sifive/hifive-unleashed/genimage_spi-nor.cfg +2 -2
@@ -8,12 +8,12 @@ image spi-nor.img { partition u-boot-spl { image = "u-boot-spl.bin" offset = 20K - partition-type-uuid = 5B193300-FC78-40CD-8002-E86C45580B47 + partition-type-uuid = 5b193300-fc78-40cd-8002-e86c45580b47 } partition u-boot { image = "u-boot.itb" offset = 1044K - partition-type-uuid = 2E54B353-1271-4842-806F-E436D6AF6985 + partition-type-uuid = 2e54b353-1271-4842-806f-e436d6af6985 } }
Signature · 6 lines
2.37.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 8/8 board/*/genimage.cfg: use partition-type-uuid = F for some FAT partitions
In reply to Thomas Petazzoni via buildrootThe genimage.cfg modified by this commit used the partition-type-uuid c12a7328-f81f-11d2-ba4b-00a0c93ec93b, which identifies the EFI System Partition, for a partition that isn't the EFI System Partition, but just a regular FAT partition, for which GUID ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 is more appropriate.
So we switch these to use partition-type-uuid = F, as it makes more sense.
Please note that this commit introduces a difference in the resulting output, as those partitions will now have a different GUID.
--- board/friendlyarm/nanopc-t4/genimage.cfg | 2 +- board/friendlyarm/nanopi-m4/genimage.cfg | 2 +- board/pine64/rockpro64/genimage.cfg | 2 +- board/radxa/rockpi-4/genimage.cfg | 2 +- board/radxa/rockpi-n10/genimage.cfg | 2 +- board/radxa/rockpi-n8/genimage.cfg | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-)
board/friendlyarm/nanopc-t4/genimage.cfg +1 -1
@@ -26,7 +26,7 @@ image sdcard.img { } partition boot { - partition-type-uuid = c12a7328-f81f-11d2-ba4b-00a0c93ec93b + partition-type-uuid = F bootable = "true" image = "boot.vfat" offset = 16M
board/friendlyarm/nanopi-m4/genimage.cfg +1 -1
@@ -26,7 +26,7 @@ image sdcard.img { } partition boot { - partition-type-uuid = c12a7328-f81f-11d2-ba4b-00a0c93ec93b + partition-type-uuid = F bootable = "true" image = "boot.vfat" offset = 16M
board/pine64/rockpro64/genimage.cfg +1 -1
@@ -26,7 +26,7 @@ image sdcard.img { } partition boot { - partition-type-uuid = c12a7328-f81f-11d2-ba4b-00a0c93ec93b + partition-type-uuid = F bootable = "true" image = "boot.vfat" offset = 16M
board/radxa/rockpi-4/genimage.cfg +1 -1
@@ -26,7 +26,7 @@ image sdcard.img { } partition boot { - partition-type-uuid = c12a7328-f81f-11d2-ba4b-00a0c93ec93b + partition-type-uuid = F bootable = "true" image = "boot.vfat" offset = 16M
board/radxa/rockpi-n10/genimage.cfg +1 -1
@@ -26,7 +26,7 @@ image sdcard.img { } partition boot { - partition-type-uuid = c12a7328-f81f-11d2-ba4b-00a0c93ec93b + partition-type-uuid = F bootable = "true" image = "boot.vfat" offset = 16M
board/radxa/rockpi-n8/genimage.cfg +1 -1
@@ -26,7 +26,7 @@ image sdcard.img { } partition boot { - partition-type-uuid = c12a7328-f81f-11d2-ba4b-00a0c93ec93b + partition-type-uuid = F bootable = "true" image = "boot.vfat" offset = 16M
Signature · 6 lines
2.37.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Yann E. MORIN
AppliedThomas, Giulio, All,
On 2022-07-22 22:21 +0200, Thomas Petazzoni via buildroot spake thusly:
Quoted 3 lines
This small series is a revamp of Giulio's series cleaning up genimage.cfg. This new version is the result of some discussion between Arnout and me to find a middle-ground situation.
Applied to master, Thanks!
I'll further reply to patch 3 with a very minor comment.
Regards,
Yann E. MORIN.
Quoted 68 lines
So what we propose is to:
- Use the U and F specifiers provided by genimage for the EFI System Partition and FAT32 partitions respectively.
- Use the L specifier (explicitly specified in genimage.cfg, even though it is the default), for the root filesystem or other Linux filesystems. This means we would not comply with the systemd-specific Discoverable Partitions Specification
(https://systemd.io/DISCOVERABLE_PARTITIONS/), but we don't see the point of this specification (which requires identifying root filesystems for different architecture by different GUID) in the context of Buildroot. However, while we recommend using L for all new genimage.cfg, we do not change existing genimage.cfg, to not break them.In this series, none of the patches except the last make any functional change. The last patch does introduce some functional
change: some partitions were identified as EFI System Partition even though they are not: the last commit converts them to use the "F" type, used for FAT filesystems.Best regards,
Thomas Petazzoni
Thomas Petazzoni (8):
board/orangepi/common/genimage.cfg: use quotes around "gpt" board/*/genimage.cfg: use partition-table-type = "gpt" docs/manual: update documentation about partition-type-uuid convention
in genimage.cfg
board/orangepi/orangepi-r1/genimage.cfg: remove double quotes around
partition-type-uuid values
board/orangepi/orangepi-r1/genimage.cfg: use correct partition type board/*/genimage.cfg: use partition-type-uuid U where relevant board/sifive/hifive-unleashed/genimage*: convert partition-type-uuid
values to lower-case
board/*/genimage.cfg: use partition-type-uuid = F for some FAT
partitionsboard/aarch64-efi/genimage-efi.cfg | 2 +- board/friendlyarm/nanopc-t4/genimage.cfg | 2 +- board/friendlyarm/nanopi-m4/genimage.cfg | 2 +- board/octavo/osd32mp1-brk/genimage.cfg | 2 +- board/octavo/osd32mp1-red/genimage.cfg | 2 +- board/olimex/stmp1_olinuxino/genimage.cfg | 2 +- board/orangepi/common/genimage.cfg | 2 +- board/orangepi/orangepi-r1/genimage.cfg | 4 ++-- board/pc/genimage-efi.cfg | 2 +- board/pine64/rockpro64/genimage.cfg | 2 +- board/qemu/aarch64-sbsa/genimage.cfg | 2 +- board/radxa/rockpi-4/genimage.cfg | 2 +- board/radxa/rockpi-n10/genimage.cfg | 2 +- board/radxa/rockpi-n8/genimage.cfg | 2 +- board/seeed/stm32mp157c-odyssey/genimage.cfg | 2 +- board/sifive/hifive-unleashed/genimage_sdcard.cfg | 6 +++--- board/sifive/hifive-unleashed/genimage_spi-nor.cfg | 4 ++-- .../common/stm32mp157/genimage.cfg.template | 2 +- docs/manual/writing-rules.txt | 12 ++++++++++++ 19 files changed, 34 insertions(+), 22 deletions(-)Signature · 6 lines
2.37.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot