Skip to contentSkip to conversation

board/orangepi/orangepi-r1/genimage.cfg: fix build after move to genimage 15

PATCH Applied Peter Korsgaard 3 participants 7 messages Dec 19, 2021 – Dec 27, 2021 SiFive drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 board/orangepi/orangepi-r1/genimage.cfg: fix build after move to genimage 15

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/1865935239

ERROR: hdimage(sdcard.img): part boot: 'partition-type' is only valid for mbr and hybrid partition-table-type

So change to partition-type-uuid instead. With that fixed, genimage-15 then also complains about the overlap between the u-boot partition and the GPT:

ERROR: hdimage(sdcard.img): partition [GPT array] (offset 0x100000, size 0x4000) overlaps previous partition u-boot (offset 0x2000, size 0x102000)

So adjust the u-boot partition to end just before the GPT.

---
 board/orangepi/orangepi-r1/genimage.cfg | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
board/orangepi/orangepi-r1/genimage.cfg +3 -3
index a2ad618557..e42c37d5fd 100644
@@ -24,11 +24,11 @@ image sdcard.img {
 		in-partition-table = "no"
 		image = "u-boot-sunxi-with-spl.bin"
 		offset = 8K
-		size = 1032K # 1MB - 8KB + 16KB(GPT)
+		size = 1016K # 1MB - 8KB
 	}
 
 	partition boot {
-		partition-type = 0xC
+		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 = 0x83
+		partition-type-uuid = "L"
 		image = "rootfs.ext4"
 		size = 512M
 	}
Signature · 6 lines
2.20.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH 2/2 board/*/genimage.cfg: use partition-table-type = "gpt" for genimage-15

Genimage 15 deprecated the gpt option and now prints a warning when it is used:

INFO: hdimage(sdcard.img): The option 'gpt' is deprecated. Use 'partition-table-type' instead

So change the genimage configuration files to use that instead.

---
 board/aarch64-efi/genimage-efi.cfg                 | 2 +-
 board/beaglev/genimage.cfg                         | 2 +-
 board/friendlyarm/nanopc-t4/genimage.cfg           | 2 +-
 board/friendlyarm/nanopi-m4/genimage.cfg           | 2 +-
 board/kontron/smarc-sal28/genimage.cfg             | 2 +-
 board/minnowboard/genimage.cfg                     | 2 +-
 board/orangepi/orangepi-pc-plus/genimage.cfg       | 2 +-
 board/orangepi/orangepi-r1/genimage.cfg            | 2 +-
 board/orangepi/orangepi-rk3399/genimage.cfg        | 2 +-
 board/orangepi/orangepi-zero-plus2/genimage.cfg    | 2 +-
 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/sifive/hifive-unleashed/genimage_sdcard.cfg  | 2 +-
 board/sifive/hifive-unleashed/genimage_spi-nor.cfg | 2 +-
 18 files changed, 18 insertions(+), 18 deletions(-)
board/aarch64-efi/genimage-efi.cfg +1 -1
index 13d69e5e42..87e85816bc 100644
@@ -13,7 +13,7 @@ image efi-part.vfat {
 
 image disk.img {
 	hdimage {
-		gpt = true
+		partition-table-type = "gpt"
 	}
 
 	partition boot {
board/beaglev/genimage.cfg +1 -1
index 3b28e8dbb6..deefdbc110 100644
@@ -1,6 +1,6 @@
 image sdcard.img {
 	hdimage {
-		gpt = true
+		partition-table-type = "gpt"
 	}
 
 	partition rootfs {
board/friendlyarm/nanopc-t4/genimage.cfg +1 -1
index e616be6349..d63c293ab4 100644
@@ -12,7 +12,7 @@ image boot.vfat {
 
 image sdcard.img {
 	hdimage {
-		gpt = true
+		partition-table-type = "gpt"
 	}
 
 	partition loader1 {
board/friendlyarm/nanopi-m4/genimage.cfg +1 -1
index 03f39adfab..35d056ae6e 100644
@@ -12,7 +12,7 @@ image boot.vfat {
 
 image sdcard.img {
 	hdimage {
-		gpt = true
+		partition-table-type = "gpt"
 	}
 
 	partition loader1 {
board/kontron/smarc-sal28/genimage.cfg +1 -1
index 8c8a7baaae..0ad020b347 100644
@@ -1,6 +1,6 @@
 image sdcard-emmc.img {
 	hdimage {
-		gpt = true
+		partition-table-type = "gpt"
 	}
 
 	partition rcw {
board/minnowboard/genimage.cfg +1 -1
index 2eccce2de4..b169d1d067 100644
@@ -17,7 +17,7 @@ image efi-part.vfat {
 #  * the efi-partition created above
 image sdcard.img {
 	hdimage {
-		gpt = true
+		partition-table-type = "gpt"
 	}
 
 	partition boot {
board/orangepi/orangepi-pc-plus/genimage.cfg +1 -1
index 7c3b4cd746..e730b38096 100644
@@ -15,7 +15,7 @@ image boot.vfat {
 image sdcard.img {
 	hdimage {
 		# for root=PARTLABEL support
-		gpt = true
+		partition-table-type = "gpt"
 		# default GPT location conflicts with bootloaders, move it after
 		gpt-location = 1M
 	}
board/orangepi/orangepi-r1/genimage.cfg +1 -1
index e42c37d5fd..e93e802bd9 100644
@@ -15,7 +15,7 @@ image boot.vfat {
 image sdcard.img {
 	hdimage {
 		# for root=PARTLABEL support
-		gpt = true
+		partition-table-type = "gpt"
 		# default GPT location conflicts with spl, move it after
 		gpt-location = 1M
 	}
board/orangepi/orangepi-rk3399/genimage.cfg +1 -1
index ceab37963d..c94e0bc7cc 100644
@@ -12,7 +12,7 @@ image boot.vfat {
 
 image sdcard.img {
 	hdimage {
-		gpt = true
+		partition-table-type = "gpt"
 	}
 
 	partition loader1 {
board/orangepi/orangepi-zero-plus2/genimage.cfg +1 -1
index f51ce3f854..aee9719ae4 100644
@@ -13,7 +13,7 @@ image boot.vfat {
 image sdcard.img {
 	hdimage {
 		# for root=PARTLABEL support
-		gpt = true
+		partition-table-type = "gpt"
 		# default GPT location conflicts with bootloaders, move it after
 		gpt-location = 1M
 	}
board/pc/genimage-efi.cfg +1 -1
index 9cf701b798..035a077a78 100644
@@ -14,7 +14,7 @@ image efi-part.vfat {
 
 image disk.img {
 	hdimage {
-		gpt = true
+		partition-table-type = "gpt"
 	}
 
 	partition boot {
board/pine64/rockpro64/genimage.cfg +1 -1
index aa2095b916..14dd0e1d18 100644
@@ -12,7 +12,7 @@ image boot.vfat {
 
 image sdcard.img {
 	hdimage {
-		gpt = true
+		partition-table-type = "gpt"
 	}
 
 	partition loader1 {
board/qemu/aarch64-sbsa/genimage.cfg +1 -1
index 957f1a0530..121ae9f37b 100644
@@ -14,7 +14,7 @@ image efi-part.vfat {
 
 image disk.img {
 	hdimage {
-		gpt = true
+		partition-table-type = "gpt"
 	}
 
 	partition boot {
board/radxa/rockpi-4/genimage.cfg +1 -1
index 197968320e..a5100af420 100644
@@ -12,7 +12,7 @@ image boot.vfat {
 
 image sdcard.img {
 	hdimage {
-		gpt = true
+		partition-table-type = "gpt"
 	}
 
 	partition loader1 {
board/radxa/rockpi-n10/genimage.cfg +1 -1
index b3ade327d6..652e75db11 100644
@@ -12,7 +12,7 @@ image boot.vfat {
 
 image sdcard.img {
 	hdimage {
-		gpt = true
+		partition-table-type = "gpt"
 	}
 
 	partition loader1 {
board/radxa/rockpi-n8/genimage.cfg +1 -1
index 3329576b76..2e064d48c0 100644
@@ -12,7 +12,7 @@ image boot.vfat {
 
 image sdcard.img {
 	hdimage {
-		gpt = true
+		partition-table-type = "gpt"
 	}
 
 	partition loader1 {
board/sifive/hifive-unleashed/genimage_sdcard.cfg +1 -1
index e7f98a47ce..e66f221d73 100644
@@ -1,6 +1,6 @@
 image sdcard.img {
 	hdimage {
-		gpt = true
+		partition-table-type = "gpt"
 	}
 
 	partition u-boot-spl {
board/sifive/hifive-unleashed/genimage_spi-nor.cfg +1 -1
index 2e5d89bfe8..903e675a90 100644
@@ -2,7 +2,7 @@ image spi-nor.img {
 	size = 32M
 
 	hdimage {
-		gpt = true
+		partition-table-type = "gpt"
 	}
 
 	partition u-boot-spl {
Signature · 6 lines
2.20.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Re: [Buildroot] [PATCH 2/2] board/*/genimage.cfg: use partition-table-type = "gpt" for genimage-15

Hello Peter,

Quoted 8 lines

Genimage 15 deprecated the gpt option and now prints a warning when it is used:

INFO: hdimage(sdcard.img): The option 'gpt' is deprecated. Use 'partition-table-type' instead

So change the genimage configuration files to use that instead.

...

board/orangepi/orangepi-zero-plus2/genimage.cfg image boot.vfat { · line 19

Quoted 13 lines
board/orangepi/orangepi-zero-plus2/genimage.cfg +1 -1
index f51ce3f854..aee9719ae4 100644
@@ -13,7 +13,7 @@ image boot.vfat {
 image sdcard.img {
 	hdimage {
 		# for root=PARTLABEL support
-		gpt = true
+		partition-table-type = "gpt"
 		# default GPT location conflicts with bootloaders, move it after
 		gpt-location = 1M
 	}

Build still fails for orangepi-zero-plus2 with this patch. I get the following subsequent error messages from genimage:

ERROR: hdimage(sdcard.img): part boot: 'partition-type' is only valid for mbr and hybrid partition-table-type

After changing 'partition-type' entries to the appropriate 'partition-type-uuid', genimage complains about overlaps:

ERROR: hdimage(sdcard.img): partition [GPT array] (offset 0x100000, size 0x4000) overlaps previous partition u-boot (offset 0x2000, size 0x102000)
ERROR: hdimage(sdcard.img): bootloaders, etc. that overlap with the partition table must declare the overlapping area as a hole.

It looks like new genimage is able to keep track of partition table. IIUC this can be fixed either using new 'holes' feature or just updating size of the bootloader file. For instance, with the following patch applied orangepi-pc-plus builds and boots fine:

board/orangepi/orangepi-pc-plus/genimage.cfg +4 -4
index 7c3b4cd746..8930adfc2a 100644
@@ -15,7 +15,7 @@ image boot.vfat {
 image sdcard.img {
        hdimage {
                # for root=PARTLABEL support
-               gpt = true
+               partition-table-type = "gpt"
                # default GPT location conflicts with bootloaders, move it after
                gpt-location = 1M
        }
@@ -24,11 +24,11 @@ image sdcard.img {
                in-partition-table = "no"
                image = "u-boot-sunxi-with-spl.bin"
                offset = 8K
-               size = 1032K # 1MB - 8KB + 16KB(GPT)
+               size = 1016K # 1MB - 8KB
        }
 
        partition boot {
-               partition-type = 0xC
+               partition-type-uuid  = F
                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 = 0x83
+               partition-type-uuid = L
                image = "rootfs.ext4"
                size = 512M
        }

Do you want me to send this orange-pc-plus patch separately or you plan to respin yours ?

Regards,
Sergey

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw

Re: [Buildroot] [PATCH 2/2] board/*/genimage.cfg: use partition-table-type = "gpt" for genimage-15

Quoted 11 lines
Quoted 8 lines

Genimage 15 deprecated the gpt option and now prints a warning when it is used:

INFO: hdimage(sdcard.img): The option 'gpt' is deprecated. Use 'partition-table-type' instead

So change the genimage configuration files to use that instead.

...

Quoted 16 lines

board/orangepi/orangepi-zero-plus2/genimage.cfg image boot.vfat { · line 19

Quoted 13 lines
board/orangepi/orangepi-zero-plus2/genimage.cfg +1 -1
index f51ce3f854..aee9719ae4 100644
@@ -13,7 +13,7 @@ image boot.vfat {
 image sdcard.img {
 	hdimage {
 		# for root=PARTLABEL support
-		gpt = true
+		partition-table-type = "gpt"
 		# default GPT location conflicts with bootloaders, move it after
 		gpt-location = 1M
 	}

Build still fails for orangepi-zero-plus2 with this patch. I get the following subsequent error messages from genimage:

Sorry, I meant orangepi-pc-plus board.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#4 lore raw

Re: [Buildroot] [PATCH 2/2] board/*/genimage.cfg: use partition-table-type = "gpt" for genimage-15

In reply to Sergey Matyukevich

Hello Sergey,

Quoted 8 lines · On Sat, 25 Dec 2021 16:49:48 +0300 Sergey Matyukevich <[email protected]>…

Build still fails for orangepi-zero-plus2 with this patch. I get the following subsequent error messages from genimage:

ERROR: hdimage(sdcard.img): part boot: 'partition-type' is only valid for mbr and hybrid partition-table-type

After changing 'partition-type' entries to the appropriate 'partition-type-uuid', genimage complains about overlaps:

Quoted 7 lines

ERROR: hdimage(sdcard.img): partition [GPT array] (offset 0x100000, size 0x4000) overlaps previous partition u-boot (offset 0x2000, size 0x102000)
ERROR: hdimage(sdcard.img): bootloaders, etc. that overlap with the partition table must declare the overlapping area as a hole.

It looks like new genimage is able to keep track of partition table. IIUC this can be fixed either using new 'holes' feature or just updating size of the bootloader file. For instance, with the following patch applied orangepi-pc-plus builds and boots fine:

Have you looked at
https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/
which is PATCH 1/2 of this series? It fixes exactly the problem you're pointing to, just for a different board.

Do not hesitate to send patches to fix other boards.

Thanks a lot!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#5 lore raw

Re: [Buildroot] [PATCH 2/2] board/*/genimage.cfg: use partition-table-type = "gpt" for genimage-15

In reply to Peter Korsgaard
Quoted 20 lines · On Sun, 19 Dec 2021 15:20:33 +0100 Peter Korsgaard <[email protected]> wrote:

Genimage 15 deprecated the gpt option and now prints a warning when it is used:

INFO: hdimage(sdcard.img): The option 'gpt' is deprecated. Use 'partition-table-type' instead

So change the genimage configuration files to use that instead.

---
 board/aarch64-efi/genimage-efi.cfg                 | 2 +-
 board/beaglev/genimage.cfg                         | 2 +-
 board/friendlyarm/nanopc-t4/genimage.cfg           | 2 +-
 board/friendlyarm/nanopi-m4/genimage.cfg           | 2 +-
 board/kontron/smarc-sal28/genimage.cfg             | 2 +-
 board/minnowboard/genimage.cfg                     | 2 +-
 board/orangepi/orangepi-pc-plus/genimage.cfg       | 2 +-
 board/orangepi/orangepi-r1/genimage.cfg            | 2 +-
 board/orangepi/orangepi-rk3399/genimage.cfg        | 2 +-
 board/orangepi/orangepi-zero-plus2/genimage.cfg    | 2 +-
 board/pc/genimage-efi.cfg                          | 2 +-
Quoted 8 lines
 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/sifive/hifive-unleashed/genimage_sdcard.cfg  | 2 +-
 board/sifive/hifive-unleashed/genimage_spi-nor.cfg | 2 +-
 18 files changed, 18 insertions(+), 18 deletions(-)

Applied to master, thanks.

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#6 lore raw
In reply to Peter Korsgaard
Quoted 8 lines · On Sun, 19 Dec 2021 15:20:32 +0100 Peter Korsgaard <[email protected]> wrote:

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/1865935239

ERROR: hdimage(sdcard.img): part boot: 'partition-type' is only valid for mbr and hybrid partition-table-type

So change to partition-type-uuid instead. With that fixed, genimage-15 then also complains about the overlap between the u-boot partition and the GPT:

Quoted 8 lines

ERROR: hdimage(sdcard.img): partition [GPT array] (offset 0x100000, size 0x4000) overlaps previous partition u-boot (offset 0x2000, size 0x102000)

So adjust the u-boot partition to end just before the GPT.

---
 board/orangepi/orangepi-r1/genimage.cfg | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Applied to master, thanks.

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot