[elbe-devel] [PATCH v2 3/8] finetuning: add artifact and rm_artifact command to project-finetuning

Manuel Traut manut at linutronix.de
Wed Dec 5 11:00:59 CET 2018


On 10:53 Wed 05 Dec     , Manuel Traut wrote:
> On 09:54 Wed 05 Dec     , Torben Hohn wrote:
> > make it possible to add files generated in project finetuning or
> > normal target files to the list of build artifacts, that get downloaded
> > when the elbe build copletes.
> 
> while trying this,
> 
> 	<artifact>/boot/*</artifact>
> 
> i found out, that this is not working as expected.
> 
> a) wildcards should be supported
> b) appending the artifacts to targetfs.images is wrong. Not every artifact is an
>     image, see elbepack/db.py
> 
>                 images = set(ep.targetfs.images or [])
>                 for img in images:
>                     _update_project_file(
>                         s, p.builddir, img,
>                         "application/octet-stream", "Image")
> 
>    IMHO we should allow specifying or guessing?? a filetype and add the artifact
>     to the project not to the targetfs
> 
> c) examples/arm64-qemu-virt.xml could be updated to extract the kernel from the
>     RFS

also 'armhf-qemu-vexpress.xml' mentions some manual steps in the description
that can be done by the artifact feature.

> > Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
> > ---
> >  elbepack/finetuning.py | 35 +++++++++++++++++++++++++++++++++++
> >  schema/dbsfed.xsd      | 23 +++++++++++++++++++++++
> >  2 files changed, 58 insertions(+)
> > 
> > diff --git a/elbepack/finetuning.py b/elbepack/finetuning.py
> > index 9fc0a2eb..e2ad0c8c 100644
> > --- a/elbepack/finetuning.py
> > +++ b/elbepack/finetuning.py
> > @@ -490,6 +490,41 @@ class ProjCmdAction(FinetuningAction):
> >  FinetuningAction.register(ProjCmdAction)
> >  
> >  
> > +class ArtifactAction(FinetuningAction):
> > +
> > +    tag = 'artifact'
> > +
> > +    def __init__(self, node):
> > +        FinetuningAction.__init__(self, node)
> > +
> > +    def execute(self, _log, _buildenv, target):
> > +        target.images.append('target' + self.node.et.text)
> > +
> > +    def execute_prj(self, _log, _buildenv, target, _builddir):
> > +        target.images.append(self.node.et.text)
> > +
> > +
> > +FinetuningAction.register(ArtifactAction)
> > +
> > +
> > +class RmArtifactAction(FinetuningAction):
> > +
> > +    tag = 'rm_artifact'
> > +
> > +    def __init__(self, node):
> > +        FinetuningAction.__init__(self, node)
> > +
> > +    def execute(self, _log, _buildenv, _target):
> > +        raise NotImplementedError("<rm_artifact> may only be "
> > +                                  "used in <project-finetuning>")
> > +
> > +    def execute_prj(self, _log, _buildenv, target, _builddir):
> > +        target.images.remove(self.node.et.text)
> > +
> > +
> > +FinetuningAction.register(ArtifactAction)
> > +
> > +
> >  def do_finetuning(xml, log, buildenv, target):
> >  
> >      if not xml.has('target/finetuning'):
> > diff --git a/schema/dbsfed.xsd b/schema/dbsfed.xsd
> > index 145d427a..55b1bb6d 100644
> > --- a/schema/dbsfed.xsd
> > +++ b/schema/dbsfed.xsd
> > @@ -1847,6 +1847,14 @@
> >            </documentation>
> >          </annotation>
> >        </element>
> > +      <element name="artifact" type="rfs:string" minOccurs="0">
> > +        <annotation>
> > +          <documentation>
> > +	    make the named file an artifact. The path is relative to the
> > +	    target root.
> > +          </documentation>
> > +        </annotation>
> > +      </element>
> >      </choice>
> >    </group>
> >  
> > @@ -1884,6 +1892,21 @@
> >            </documentation>
> >          </annotation>
> >        </element>
> > +      <element name="artifact" type="rfs:string" minOccurs="0">
> > +        <annotation>
> > +          <documentation>
> > +	    Make the named file an artifact. The path is relative
> > +	    to the project directory.
> > +          </documentation>
> > +        </annotation>
> > +      </element>
> > +      <element name="rm_artifact" type="rfs:string" minOccurs="0">
> > +        <annotation>
> > +          <documentation>
> > +	    Remove a project artifact from the list of artifacts.
> > +          </documentation>
> > +        </annotation>
> > +      </element>
> >      </choice>
> >    </group>
> >  
> > -- 
> > 2.11.0
> > 
> > 
> > _______________________________________________
> > elbe-devel mailing list
> > elbe-devel at linutronix.de
> > https://lists.linutronix.de/mailman/listinfo/elbe-devel
> 
> _______________________________________________
> 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