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

Sergey Matyukevich geomatsi at gmail.com
Sat Dec 25 13:49:48 UTC 2021


Hello Peter,

> 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.
> 
> Signed-off-by: Peter Korsgaard <peter at korsgaard.com>

...

> diff --git a/board/orangepi/orangepi-zero-plus2/genimage.cfg b/board/orangepi/orangepi-zero-plus2/genimage.cfg
> index f51ce3f854..aee9719ae4 100644
> --- a/board/orangepi/orangepi-zero-plus2/genimage.cfg
> +++ b/board/orangepi/orangepi-zero-plus2/genimage.cfg
> @@ -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:

diff --git a/board/orangepi/orangepi-pc-plus/genimage.cfg b/board/orangepi/orangepi-pc-plus/genimage.cfg
index 7c3b4cd746..8930adfc2a 100644
--- a/board/orangepi/orangepi-pc-plus/genimage.cfg
+++ b/board/orangepi/orangepi-pc-plus/genimage.cfg
@@ -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





More information about the buildroot mailing list