cmd: gpt: initialize partition table
authorKishan Dudhatra <kishan.dudhatra@siliconsignals.io>
Mon, 22 Apr 2024 18:17:33 +0000 (23:47 +0530)
committerTom Rini <trini@konsulko.com>
Fri, 3 May 2024 18:22:58 +0000 (12:22 -0600)
Change in v2:
- Fix applies to all block devices, not just MMC.

If partition init is not completed within the gpt write,
the gpt partition list will not be updated.

Signed-off-by: Kishan Dudhatra <kishan.dudhatra@siliconsignals.io>
cmd/gpt.c

index d7e9652..7aaf188 100644 (file)
--- a/cmd/gpt.c
+++ b/cmd/gpt.c
@@ -643,6 +643,10 @@ static int gpt_default(struct blk_desc *blk_dev_desc, const char *str_part)
        free(str_disk_guid);
        free(partitions);
 
+       /* initialize partition table */
+       if (blk_enabled())
+               part_init(blk_dev_desc);
+
        return ret;
 }