[PATCH v5 3/4] partitions/efi: add support for uImage.FIT sub-partitions

Daniel Golle daniel at makrotopia.org
Wed Nov 16 16:19:10 PST 2022


Hi Christoph,

On Tue, Nov 15, 2022 at 10:01:05PM -0800, Christoph Hellwig wrote:
> On Tue, Nov 15, 2022 at 09:47:06PM +0000, Daniel Golle wrote:
> > Add new GUID allowing to parse uImage.FIT stored in a GPT partition
> > and map filesystem sub-image as sub-partitions.
> 
> NAK, we should not go out from the partition code to parse random
> weird image formats.

While weirdness is certainly subjective, uImage.FIT is not just a
random image format but used by a great majority of headless embedded
Linux devices out there. It's the default image format of many of the
SDKs distributed by chip vendors such as Allwinner, Marvell, MediaTek,
NXP, Qualcomm/Atheros, ...

Having better support for it in Linux hence doesn't seem too far-fetched
to me, especially given that we got partition parsers for all sorts of
historic (Acorn, Amiga, Atari, ...) or actually exotic (Karma?) formats.
Even Microsoft Windows' Logical Disk Manager is supported natively by
the kernel...

> If you want to support uImage.FIT just write a tiny stackable block
> driver or dm table for it.

As this is used on rather tiny embedded devices my hope was to keep
things simple and not having to enable device mapper on systems which
have anyway only very small amounts of storage and won't ever need
most of the device mapper features.

Using a tiny block driver instead is an option, I've implemented this
approach in the past couple of hours and it works just as fine.

In this case I would introduce a new kernel cmdline option allowing
to specify which block device (ie. a partition on eMMC, or mtdblock
or ubiblock device) to launch the uImage.FIT parser on.

Allowing this new driver to add block partitions by exporting a new
helper functions for that in block/partition/core.c would greatly
simplify things, as then the existing partitioning code could still
be used (instead of basically having to re-implement loopdev and
introduce a whole new type of block devices).

I will post an RFC series illustrating this approach.

Please let me know if this sounds acceptable, so I won't put effort
into implementing something which will then be rejected again after 5
iterations on the mailing list for reasons which could have been
expressed from the beginning. An RFC for this series was posted on
2022-04-25 [1], I wouldn't have worked months to fix all requests of
other maintainers and tested it on a variety of different hardware
knowing that the whole approach will be NACK'ed...

And, of course, thank you anyway for reviewing!


Cheers


Daniel

[1]: https://patchwork.kernel.org/project/linux-block/list/?series=635369&state=*



More information about the linux-mtd mailing list