[elbe-devel] [PATCH 04/10] elbeproject: add <hostsdk-pkg-list> to define packages for host sysroot

Manuel Traut manut at linutronix.de
Thu Apr 11 08:37:56 CEST 2019


On 17:42 Wed 10 Apr     , Torben Hohn wrote:
> On Wed, Apr 10, 2019 at 10:40:57AM +0200, Manuel Traut wrote:
> > On 15:42 Mon 08 Apr     , Torben Hohn wrote:
> > > use the extract_pkg machinery to install specific packages into the
> > > host sysroot. This allows, for example, to install a specific qt version
> > > into the host sysroot.
> > > 
> > > When no <hostsdk-pkg-list> is specified, it falls back to evaluating
> > > self.xml.defs["sdkarch"] and installing 'g++-$sdkarch' and 'gdb-multiarch'
> > 
> > Shouldn't we keep both g++ and gdb as 'defaults' in the list and extend the
> > it with the values from hostsdk-pkg-list?
> 
> no. maybe one wants to install some cross clang, and doesnt want
> gcc in the host sdk.
>
> if i can specify the list of packages that shall be installed,
> i would not expect that its only added to some default packages.

ok, with these arguments i'm fine with this behaviour.

> > 
> > > Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>

Reviewed-by: Manuel Traut <manut at linutronix.de>


> > > ---
> > >  elbepack/elbeproject.py | 38 ++++++++++++++++++++------------------
> > >  schema/dbsfed.xsd       |  8 ++++++++
> > >  2 files changed, 28 insertions(+), 18 deletions(-)
> > > 
> > > diff --git a/elbepack/elbeproject.py b/elbepack/elbeproject.py
> > > index 59fd9b04..73f917e9 100644
> > > --- a/elbepack/elbeproject.py
> > > +++ b/elbepack/elbeproject.py
> > > @@ -301,10 +301,18 @@ class ElbeProject (object):
> > >      def build_sdk(self):
> > >          triplet = self.xml.defs["triplet"]
> > >  
> > > -        try:
> > > -            crosstoolchainpkg = "g++-%s" % self.xml.defs["sdkarch"]
> > > -        except KeyError:
> > > -            raise UnsupportedSDKException(triplet)
> > > +        host_pkglist = []
> > > +        if self.xml.tgt.has('hostsdk-pkg-list'):
> > > +            for p in self.xml.tgt.node('hostsdk-pkg-list'):
> > > +                if p.tag == 'pkg':
> > > +                    host_pkglist.append(p.et.text.strip())
> > > +        else:
> > > +            try:
> > > +                host_pkglist.append("g++-%s" % self.xml.defs["sdkarch"])
> > > +            except KeyError:
> > > +                raise UnsupportedSDKException(triplet)
> > > +
> > > +            host_pkglist.append('gdb-multiarch')
> > >  
> > >          # build target sysroot including libs and headers for the target
> > >          self.build_sysroot()
> > > @@ -315,20 +323,14 @@ class ElbeProject (object):
> > >          # build host sysroot including cross compiler
> > >          hostsysrootpath = os.path.join(self.sdkpath, 'sysroots', 'host')
> > >          self.log.do('mkdir -p "%s"' % hostsysrootpath)
> > > -        extract_pkg(self.xml.prj,
> > > -                    hostsysrootpath,
> > > -                    self.xml.defs,
> > > -                    crosstoolchainpkg,
> > > -                    'amd64',
> > > -                    self.log,
> > > -                    True)
> > > -        extract_pkg(self.xml.prj,
> > > -                    hostsysrootpath,
> > > -                    self.xml.defs,
> > > -                    'gdb-multiarch',
> > > -                    'amd64',
> > > -                    self.log,
> > > -                    True)
> > > +        for p in host_pkglist:
> > > +            extract_pkg(self.xml.prj,
> > > +                        hostsysrootpath,
> > > +                        self.xml.defs,
> > > +                        p,
> > > +                        'amd64',
> > > +                        self.log,
> > > +                        True)
> > >  
> > >          n = gen_sdk_scripts(triplet,
> > >                              self.name,
> > > diff --git a/schema/dbsfed.xsd b/schema/dbsfed.xsd
> > > index ccab23be..333c0a8b 100644
> > > --- a/schema/dbsfed.xsd
> > > +++ b/schema/dbsfed.xsd
> > > @@ -873,6 +873,14 @@
> > >            </documentation>
> > >          </annotation>
> > >        </element>
> > > +      <element name="hostsdk-pkg-list" type="rfs:pkg-list" minOccurs="0" maxOccurs="1">
> > > +        <annotation>
> > > +          <documentation>
> > > +	    install the given packages into the hostsdk. (ignores pin and versions,
> > > +	    with the current implementation)
> > > +          </documentation>
> > > +        </annotation>
> > > +      </element>
> > >      </all>
> > >      <attribute ref="xml:base"/>
> > >    </complexType>
> > > -- 
> > > 2.11.0
> > > 
> > > 
> > > _______________________________________________
> > > elbe-devel mailing list
> > > elbe-devel at linutronix.de
> > > https://lists.linutronix.de/mailman/listinfo/elbe-devel
> 
> -- 
> Torben Hohn
> Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
> Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99
> 
> Hinweise zum Datenschutz finden Sie hier (Informations on data privacy 
> can be found here): https://linutronix.de/kontakt/Datenschutz.php
> 
> Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen | 
> Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700 
> 806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner





More information about the elbe-devel mailing list