Hi Sergey,
I exchanged some mails with Richard more recently. Richard (he's the UBI
maintaioner) added a lot of new features (just the encryption is enough)
and a lot of changes into UBIFS. Discussing with him, he explained that
the status of UBIFS in U-Boot is very old and it has a lot of potential
problems. You can understand why: UBIFS was ported once from kernel to
U-Boot, but due to the differences with kernel (U-Boot is just a
bootloader, no OS), the efforts to improve and to fix what was fixed in
kernel is high. There are still differences with just UBI containers,
but they are small as UBI is much more stable as the filesystem.
So yes, my advice is to use UBI and not UBIFS.
> However, my use case requires an ability to choose between different
> device tree blobs at boot time. In case of UBI static volumes (if I
> understand correctly what you mean by "UBI containers"), I need to
> create N UBI static volumes for each DTB, and it doesn't look like
> flexible solution.
The use case is covered by switching to fitImage and embedded multiple
DT into it, and setting which configuration inside fitImage must be
started at boot time, see for example
doc/uImage.FIT/multi-with-loadables.its in U-Boot sources.
>
>>> 2. I wanted to reduce SWU size by using rdiff patches for my rootfs, but
>>> because rootfs (squashfs) is located in UBI I couldn't use *rdiff_image*
>>> handler. So, I forked rdiff_handler and now I have a new
>>> ubivol_rdiff_image handler (see patch 2) with 50% code from
>>> ubivol_handler and 50% code from rdiff_handler.
>>
>> Ok......
>>
>>> The same question: how can I avoid the duplication? I don't think that
>>> extending rdiff_image with UBI functionality or extending ubivol_image
>>> with rdiff support would be a good solution.
>>
>> It is not.
>>
>> You could try to use UBI block device if you do not change the volume size
>> (last thing should be done by the partitioner, if any), that is
>> /dev/ubiblockX_Y.
>
> Of course, I can use /dev/ubiblockX_Y as rdiffbase (even though I
> need to hardcode the path and hope that X and Y won't change), but
> what about the destination? IIRC, ubiblocks are read-only and I can't
> put /dev/ubi node as a destination, thus it requires additional glue
> code for using UBI volumes and rdiff handler together without
> hardcoding. Because of it I wrote this Frankenstein's monster from
> rdiff and ubivol handlers.
It looks more like that Frankenstein and Dracula had sex and this is
their son...:-D
This use case lets me think about how to chain handlers together.
Currently, this is possible only with Lua handler, If the rdiff handler
could write into a pipe and this is taken as input by the UBI handler,
we can cover this use case, too, and maybe some oter. Anyway, this
requires a detail analyses, also about how to extend this into
sw-description without breaking compatibility with the past.
Best regards,
Stefano Babic