0

To update a ubifs volume by replacing it with entirely new content, ubiupdatevol from mtd-utils can be used:

ubiupdatevol /dev/ubiX_Y /path/to/ubifs.img

Is there a way to apply patch on ubifs volume instead of relacing the complete content? For instance, apply only the binary diff b/w ubifs_base.img and ubifs_dest.img on /dev/ubiX_Y.

sg1993
  • 335
  • 2
  • 19

1 Answers1

0

I don't think you can do this. UBI volume write informations with flash sector rotation to avoid writing all the time the same blocks. IMHO the best way to provide partial update to you volume is by applying a tarball over you existing filesystem and using a script to remove unwanted files or by using a package manager.

DavidP
  • 116
  • 3
  • Thank you for your suggestion. In fact, for updating individual files/executables from an zip is exactly what we were doing till now. The problem arises here: – sg1993 Jun 28 '18 at 10:30
  • The problem arises here: I use mkfs.ubifs to create the ubifs image which is then flashed on the nand device. But since mkfs.ubifs knows the rootfs content beforehand, the compression achieved is very good. When applying updates by extracting from zip/tar, this compression is no longer achieved (it will be not optimal because of on-the-fly compression) and soon we fill up the disk space, leading to ENOSPC errors. – sg1993 Jun 28 '18 at 10:35
  • I understand. has said before, the only way I know is to fully reformat your ubifs partition, sorry. if your partition is in read only (no logs or customer data's on it), you can maybe create a software who can apply a diff, but you need to take care to bad blocks in you flash...here start the hard part. If your partition contain customer data, I don't kow how you can make a diff with you production. even the specialized OTA software don't make partial update -> [rauc](https://github.com/rauc/rauc) – DavidP Jun 29 '18 at 09:45