if bb.data.inherits_class('nativesdk', e.data) or bb.data.inherits_class('crosssdk', e.data):
raise bb.parse.SkipPackage("We can't extend nativesdk recipes")
+ if bb.data.inherits_class('allarch', e.data) and not bb.data.inherits_class('packagegroup', e.data):
+ raise bb.parse.SkipPackage("Don't extend allarch recipes which are not packagegroups")
+
save_var_name=e.data.getVar("MULTILIB_SAVE_VARNAME", True) or ""
for name in save_var_name.split():
val=e.data.getVar(name, True)
variant = e.data.getVar("BBEXTENDVARIANT", True)
if isinstance(e, bb.event.RecipeParsed) and not variant:
- if bb.data.inherits_class('kernel', e.data) or bb.data.inherits_class('module-base', e.data):
+ if bb.data.inherits_class('kernel', e.data) or \
+ bb.data.inherits_class('module-base', e.data) or \
+ (bb.data.inherits_class('allarch', e.data) and\
+ not bb.data.inherits_class('packagegroup', e.data)):
variants = (e.data.getVar("MULTILIB_VARIANTS", True) or "").split()
import oe.classextend
size = 0
return size
+ def write_extra_pkgs(variants, pn, packages, pkgdatadir):
+ for variant in variants:
+ with open("%s/%s-%s" % (pkgdatadir, variant, pn), 'w') as fd:
+ fd.write("PACKAGES: %s\n" % ' '.join(
+ map(lambda pkg: '%s-%s' % (variant, pkg), packages.split())))
+
+ def write_extra_runtime_pkgs(variants, packages, pkgdatadir):
+ for variant in variants:
+ for pkg in packages.split():
+ ml_pkg = "%s-%s" % (variant, pkg)
+ subdata_file = "%s/runtime/%s" % (pkgdatadir, ml_pkg)
+ with open(subdata_file, 'w') as fd:
+ fd.write("PKG_%s: %s" % (ml_pkg, pkg))
+
packages = d.getVar('PACKAGES', True)
pkgdest = d.getVar('PKGDEST', True)
pkgdatadir = d.getVar('PKGDESTWORK', True)
f.write("PACKAGES: %s\n" % packages)
f.close()
+ pn = d.getVar('PN', True)
+ global_variants = (d.getVar('MULTILIB_GLOBAL_VARIANTS', True) or "").split()
+ variants = (d.getVar('MULTILIB_VARIANTS', True) or "").split()
+
+ if bb.data.inherits_class('kernel', d) or bb.data.inherits_class('module-base', d):
+ write_extra_pkgs(variants, pn, packages, pkgdatadir)
+
+ if (bb.data.inherits_class('allarch', d) and not bb.data.inherits_class('packagegroup', d)):
+ write_extra_pkgs(global_variants, pn, packages, pkgdatadir)
+
workdir = d.getVar('WORKDIR', True)
for pkg in packages.split():
packagedfile = pkgdatadir + '/runtime/%s.packaged' % pkg
file(packagedfile, 'w').close()
+ if bb.data.inherits_class('kernel', d) or bb.data.inherits_class('module-base', d):
+ write_extra_runtime_pkgs(variants, packages, pkgdatadir)
+
+ if bb.data.inherits_class('allarch', d) and not bb.data.inherits_class('packagegroup', d):
+ write_extra_runtime_pkgs(global_variants, packages, pkgdatadir)
+
bb.utils.unlockfile(lf)
}
emit_pkgdata[dirs] = "${PKGDESTWORK}/runtime ${PKGDESTWORK}/runtime-reverse"
tune_error_set.append(tune_errors)
multilibs = (data.getVar("MULTILIB_VARIANTS", True) or "").split()
+ global_multilibs = (data.getVar("MULTILIB_GLOBAL_VARIANTS", True) or "").split()
+
if multilibs:
seen_libs = []
seen_tunes = []
tune_error_set.append("The multilib '%s' appears more than once." % lib)
else:
seen_libs.append(lib)
+ if not lib in global_multilibs:
+ tune_error_set.append("Multilib %s is not present in MULTILIB_GLOBAL_VARIANTS" % lib)
tune = data.getVar("DEFAULTTUNE_virtclass-multilib-%s" % lib, True)
if tune in seen_tunes:
tune_error_set.append("The tuning '%s' appears in more than one multilib." % tune)