Block based OTA update needs mtdblock
Pintu Agarwal
pintu.ping at gmail.com
Wed Dec 4 01:58:34 PST 2024
Hello Richard,
On Tue, 3 Dec 2024 at 21:38, Richard Weinberger <richard at nod.at> wrote:
>
> ----- Ursprüngliche Mail -----
> > Von: "Miquel Raynal" <miquel.raynal at bootlin.com>
> > An: "Pintu Agarwal" <pintu.ping at gmail.com>
> > CC: "richard" <richard at nod.at>, "Vignesh Raghavendra" <vigneshr at ti.com>, "linux-mtd" <linux-mtd at lists.infradead.org>,
> > "chengzhihao1" <chengzhihao1 at huawei.com>, "linux-kernel" <linux-kernel at vger.kernel.org>
> > Gesendet: Dienstag, 3. Dezember 2024 15:17:06
> > Betreff: Re: Block based OTA update needs mtdblock
>
> > Hello,
> >
> > On 20/11/2024 at 12:52:57 +0530, Pintu Agarwal <pintu.ping at gmail.com> wrote:
> >
> >> Hi,
> >>
> >> On Mon, 4 Nov 2024 at 21:31, Pintu Agarwal <pintu.ping at gmail.com> wrote:
> >>>
> >>> Hi All,
> >>>
> >>> For one of our automotive products we have the following configuration:
> >>> QC chipset, arm64, Kernel-5.15, NAND Flash 1GB, A/B system, UBI
> >>> volumes (squashfs, ubifs), DM-verity for rootfs (squashfs), simple
> >>> busybox platform.
> >>>
> >>> For OTA updates we have a strong dependency with MTD_BLOCK.
> >>>
> >>> Till now, we were using ubiblock for mounting squashfs volumes and
> >>> completely got rid of mtd_block by configuring it as a loadable
> >>> module.
> >>> But, we also need to support OTA updates (Full, Incremental) on A/B
> >>> volumes using the same Android OTA framework.
> >>> https://source.android.com/docs/core/ota/nonab/block
> >>>
> >>> OTA update will be applied to the B (inactive) partition.
> >>> OTA updates prefer block based update over file based especially for
> >>> dm-verity enabled devices.
> >>>
> >>> Now, the problem is, on MTD we only have 2 options for block based
> >>> updates; ubi_block or mtd_block.
> >>> We cannot use ubiblock for OTA updates as it is read only.
> >>> For full update volume, we can use "ubiupdatevol" interface to
> >>> completely replace the volume content, but for partial or incremental
> >>> update we need to update only specific blocks and not entire
> >>> partitions.
> >>> Thus, we have to use the MTD_BLOCK (/dev/mtdblock) interface to
> >>> support block based OTA updates on UBI volumes.
> >>> Thus, during ota updates (only) we need to install the mtdblock
> >>> module, perform the update and then uninstall the module.
> >>>
> >>> That means, we cannot completely get rid of MTD_BLOCK from our product
> >>> especially for OTA use cases.
> >>>
> >>> Is this the only way, or do we have any other option to support OTA
> >>> updates over UBI volumes ?
> >>>
> >> Restarting this thread again...
> >> Any further comment on this ?
> >>
> >> Did anybody used block based OTA update NAND A/B system without using
> >> mtd_block ?
> >
> > Not on my side, it is actually a good question. Richard, any ideas?
>
> What about using ubiupdatevol?
>
As I explained above, ubiupdatevol actually performs a full volume
update, right ?
I think the partial/incremental update is not possible with this. Once
the update is triggered it should finish fully.
But for OTA updates (Delta/Incremental), only the delta changes can
also be applied.
Please refer to this [1] about updates mechanism.
[1] https://medium.com/@yigitpirildak/android-ota-update-mechanism-ecc8f6f69f71
[2] https://source.android.com/docs/core/ota/tools#:~:text=An%20incremental%20update%20is%20an,need%20to%20include%20unchanged%20files.
On our NAND target we support OTA updates, including incremental ota updates.
But without mtdblock the incremental OTA update (on A/B system) will not work.
This is the main issue.
For full updates on ubi volumes we are already using the
"ubiupdatevol" mechanism.
Thanks,
Pintu
More information about the linux-mtd
mailing list