From: Davidlohr Bueso <dave@stgolabs.net>
To: Daniel Golle <daniel@makrotopia.org>
Cc: Jens Axboe <axboe@kernel.dk>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
Matthew Wilcox <willy@infradead.org>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Chaitanya Kulkarni <kch@nvidia.com>,
Ming Lei <ming.lei@redhat.com>,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mtd@lists.infradead.org, linux-efi@vger.kernel.org
Subject: Re: [PATCH v4 3/5] partitions/efi: add support for uImage.FIT sub-partitions
Date: Thu, 8 Dec 2022 17:45:12 -0800 [thread overview]
Message-ID: <20221209014512.dos7666lkvmfhahs@offworld> (raw)
In-Reply-To: <Y2rgVIbtuDsySzBr@makrotopia.org>
On Tue, 08 Nov 2022, Daniel Golle wrote:
>Add new GUID allowing to parse uImage.FIT stored in a GPT partition
>and map filesystem sub-image as sub-partitions.
>
>Signed-off-by: Daniel Golle <daniel@makrotopia.org>
>---
> block/partitions/efi.c | 9 +++++++++
> block/partitions/efi.h | 3 +++
> 2 files changed, 12 insertions(+)
>
>diff --git a/block/partitions/efi.c b/block/partitions/efi.c
>index 5e9be13a56a8..bf87893eabe4 100644
>--- a/block/partitions/efi.c
>+++ b/block/partitions/efi.c
>@@ -716,6 +716,9 @@ int efi_partition(struct parsed_partitions *state)
> gpt_entry *ptes = NULL;
> u32 i;
> unsigned ssz = queue_logical_block_size(state->disk->queue) / 512;
>+#ifdef CONFIG_FIT_PARTITION
>+ u32 extra_slot = 65;
>+#endif
You can move this in the branch below where you call parse_fit_partitions().
>
> if (!find_valid_gpt(state, &gpt, &ptes) || !gpt || !ptes) {
> kfree(gpt);
>@@ -749,6 +752,12 @@ int efi_partition(struct parsed_partitions *state)
> ARRAY_SIZE(ptes[i].partition_name));
> utf16_le_to_7bit(ptes[i].partition_name, label_max, info->volname);
> state->parts[i + 1].has_info = true;
>+ /* If this is a U-Boot FIT volume it may have subpartitions */
>+#ifdef CONFIG_FIT_PARTITION
>+ if (!efi_guidcmp(ptes[i].partition_type_guid, PARTITION_LINUX_FIT_GUID))
>+ (void) parse_fit_partitions(state, start * ssz, size * ssz,
>+ &extra_slot, 127, 1);
>+#endif
> }
> kfree(ptes);
> kfree(gpt);
>diff --git a/block/partitions/efi.h b/block/partitions/efi.h
>index 84b9f36b9e47..06c11f6ae398 100644
>--- a/block/partitions/efi.h
>+++ b/block/partitions/efi.h
>@@ -51,6 +51,9 @@
> #define PARTITION_LINUX_LVM_GUID \
> EFI_GUID( 0xe6d6d379, 0xf507, 0x44c2, \
> 0xa2, 0x3c, 0x23, 0x8f, 0x2a, 0x3d, 0xf9, 0x28)
>+#define PARTITION_LINUX_FIT_GUID \
>+ EFI_GUID( 0xcae9be83, 0xb15f, 0x49cc, \
>+ 0x86, 0x3f, 0x08, 0x1b, 0x74, 0x4a, 0x2d, 0x93)
>
> typedef struct _gpt_header {
> __le64 signature;
>--
>2.38.1
>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
prev parent reply other threads:[~2022-12-09 2:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-08 23:03 [PATCH v4 3/5] partitions/efi: add support for uImage.FIT sub-partitions Daniel Golle
2022-11-09 9:13 ` Ard Biesheuvel
2022-11-09 11:40 ` Daniel Golle
2022-12-09 1:45 ` Davidlohr Bueso [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221209014512.dos7666lkvmfhahs@offworld \
--to=dave@stgolabs.net \
--cc=axboe@kernel.dk \
--cc=daniel@makrotopia.org \
--cc=kch@nvidia.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=martin.petersen@oracle.com \
--cc=ming.lei@redhat.com \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=vigneshr@ti.com \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox