[elbe-devel] [PATCH] elbepack: hdimg: copy partition binary blobs from target

Thomas Weißschuh thomas.weissschuh at linutronix.de
Mon Jan 13 09:50:23 CET 2025


On Sat, Jan 11, 2025 at 09:35:53AM +0106, John Ogness wrote:
> On 2025-01-10, Thomas Weißschuh <thomas.weissschuh at linutronix.de> wrote:
> >>          if part.text('binary')[0] == '/':
> >> -            tmp = target + '/' + 'chroot' + part.text('binary')
> >> +            tmp = target + '/' + 'target' + part.text('binary')
> >
> > There is yet another copy of this in build_image_mtd().
> 
> Oh man. It seems I am the one who introduced this deviation:
> 
> commit 8ed5a9061225 ("hdimg/mtd: fix handling of ubi static volumes")
> 
> With the justification:
> 
>     "use buildenv as root for copying ubi static volumes specified with
>      an absolute path (this allows the files to be removed in
>      finetuning)"
> 
> > This now breaks if the file is only really available in the
> > buildenvironment, however unlikely.
> 
> Perhaps all 3 sites should adopt a generic implementation that first
> checks target/ and then falls back to chroot/.

I prefer explicit configuration over fallbacks mechanisms.

> > I really dislike the usage of "/" to distinguish the source.
> 
> Agreed. I strongly question the users that are not specifying an
> absolute path.

Agreed.

> > It's not even documented for this specific element as its schema is
> > rfs:type and not rfs:binaryblob.
> > What do you think about having an XML attribute the specifies the
> > source properly?
> 
> Sure. It should be rfs:binaryblob. The documentation of rfs:binaryblob
> should also be updated to make it clear that it is not just about dd(1).

rfs:binaryblob also supports offset and blocksize, which IMO don't make
sense for UBI volumes.
It would also be great to use the new generic functionality for the
finetuning commands. Currently we have <cp>, <buildenv_cp>, <b2t_cp>,
<t2b_cp>.

Somethig like the (completely untested):

<simpleType name="system-reference">
  <restriction base="string>
    <enumeration value="target" />
    ...
  </restriction>
</simpleType>

And then use this in the various <binary> attributes.
Maybe with some intermediate types.
Also as mentioned before I would really like to have the current
"/"-based logic deprecated and completely moved into the preprocessing.

> I can submit a new patch implementing these changes if you like.

That would be very welcome.


Thomas


More information about the elbe-devel mailing list