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

Manuel Traut manuel.traut at linutronix.de
Thu Jul 6 22:16:36 CEST 2017


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 ;).

see below, maybe changing the schema. But i'm not sure what's the worse
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.

Ok, now i understand. I thought <physicaleraseblocksize is also of the type
rfs:part_size_restriction but it's of type string. That confused me..

Maybe we should introduce a new type ubi_size_restriction for
physicaleraseblocksize, etc. ?!

Thanks!

  Manuel

> Thanks,
> Kurt
> 
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel




More information about the elbe-devel mailing list