Block based OTA update needs mtdblock
Pintu Agarwal
pintu.ping at gmail.com
Mon Nov 4 23:01:01 PST 2024
Hi,
On Tue, 5 Nov 2024 at 07:45, Zhihao Cheng <chengzhihao1 at huawei.com> wrote:
>
> 在 2024/11/5 0:01, Pintu Agarwal 写道:
> > 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.
>
> Hi Pintu, how do you export the mtdblock device over on an UBI volume?
> By the gluebi?
> >
Yes, we have the below configs enabled.
CONFIG_MTD_BLOCK=m
CONFIG_MTD_UBI_GLUEBI=m
CONFIG_MTD_UBI_BLOCK=y
More information about the linux-mtd
mailing list