[elbe-devel] [PATCH] hdimg: use correct size prefix for specifying partition sizes

Kurt Kanzenbach kurt at linutronix.de
Thu Jul 6 18:20:27 CEST 2017


Hi Manu,

On Wed, Jul 05, 2017 at 07:31:16PM +0200, Manuel Traut wrote:
> Hi Kurt,
>
> > I've just stumbled across an interesting issue: For partition sizes elbe uses
> > kiB as size prefix. If you try to use KiB, the XML schema validation fails.
> >
> > However for specifying the physical erase block (PEB) size for UBI images you
> > have to use KiB as prefix. Using kiB results in a error when elbe invokes
> > ubinize (at the end of the Elbe-Build). This way I ended up using KiB for PEB
> > size and using kiB for UBI volume sizes in the same XML file.
>
> have you updated ubinize / mtd-utils inside the initvm? I can't see these issues
> i current test-builds of e.g. armel-versatile-ubi-tightenmode.xml (see attached
> shortened log)

No, I didn't update mtd-utils. I've created the InitVM yesterday using
current Elbe v1.9.24.

>
> I'm afraid your patch will break the current working examples.

Yes, it does.

>
> > Regarding to IEC standard, KiB is actually correct. This patch adjusts the hdimg
> > code and the XML schema accordingly.
>
> However if this is really an issue we need or should fix for newer mtd-utils
> or whatever reason, we don't want to brick existing XML files. Maybe someone
> uses kiB for msdoshd or gpt partitions. So i'd like to support both variants.
>
> Could we than please use sth. like
> peb = ubivg.text("physicaleraseblocksize").replace("kiB", "KiB")
> ??

Yea, we can do that. I'll send a second version of the patch if nobody
finds a better solution ;).

>
> Can you please explain your problem more detailed?

Sure. I've used a PEB size given with kiB. The error message is:

running cmd +ubinize -s 512 -o /var/cache/elbe/18328ffd-e029-4b52-a4e9-a790d704cde8/nand-ubi.img -p 128kiB -m 2048 /var/cache/elbe/18328ffd-e029-4b52-a4e9-a790d704cde8/nand-ubi.img_UBI.cfg+
------------------------------------------------------------------------------
bad size specifier: "kiB" - should be 'KiB', 'MiB' or 'GiB'
ubinize: error!: bad physical eraseblock size: "128kiB"
------------------------------------------------------------------------------

BTW: Your build uses KiB for the PEB size. That's why it's successful.

Thanks,
Kurt




More information about the elbe-devel mailing list