-E option in UBINIZE_OPTS

Hi there,

I found that, -E option in UBINIZE_OPTS is added in the following patch.201-ubinize-add-terminator-support.patch

But I can't figure out its goal, can you help me?


It adds EOF markers to the UBI partition. AFAICT, this tells the UBI system that after this marker, no sane data is to be expected. Hence, UBI treats the following area as uninitialized. Otherwise, there could be remnants from older UBI partitions that confuse the UBI layer.

This explanation is in interpretation from this patch.

Thanks a lot.

I have checked the patch which you pasted. But I can't understand the following words fully. My question is that how "EOF" marker ensures any old PEB after the marker are properly initialized?

"This problem has been solved in a more generic way by
the UBI EOF marker. This ensures that any old PEBs after the
marker are properly initialized."

So there is then this patch to libubigen to actually writes the EOF headers:


And this is then parsed by the kernel, support for it is added in this patch:

You can find similar patches for the 6.1 and 6.6 kernels in the OpenWrt source tree.

OK, this might not interest anyone else. But it bugged me.

I couldn't remember writing that patch. And wondered why the heck I would do somthing like that. It shouldn't harm leaving that code as it was.And I'm much too lazy to go changing code without a reason so I knew there had to be one..

The explanation has here:

This caused a real bug on the Linksys WRT1900ACv1. The other patches were just to keep the different copies of the same code in sync. But also to protect against similar unnecessary bugs in the future.

The commit messages could obviously have been better. I often find it harder to write a good explanation than fixing the code....

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.