diff options
Diffstat (limited to 'meta/classes/package.bbclass')
| -rw-r--r-- | meta/classes/package.bbclass | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index 9885d94101..1ac65510c7 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass | |||
| @@ -1132,6 +1132,20 @@ python emit_pkgdata() { | |||
| 1132 | size = 0 | 1132 | size = 0 |
| 1133 | return size | 1133 | return size |
| 1134 | 1134 | ||
| 1135 | def write_extra_pkgs(variants, pn, packages, pkgdatadir): | ||
| 1136 | for variant in variants: | ||
| 1137 | with open("%s/%s-%s" % (pkgdatadir, variant, pn), 'w') as fd: | ||
| 1138 | fd.write("PACKAGES: %s\n" % ' '.join( | ||
| 1139 | map(lambda pkg: '%s-%s' % (variant, pkg), packages.split()))) | ||
| 1140 | |||
| 1141 | def write_extra_runtime_pkgs(variants, packages, pkgdatadir): | ||
| 1142 | for variant in variants: | ||
| 1143 | for pkg in packages.split(): | ||
| 1144 | ml_pkg = "%s-%s" % (variant, pkg) | ||
| 1145 | subdata_file = "%s/runtime/%s" % (pkgdatadir, ml_pkg) | ||
| 1146 | with open(subdata_file, 'w') as fd: | ||
| 1147 | fd.write("PKG_%s: %s" % (ml_pkg, pkg)) | ||
| 1148 | |||
| 1135 | packages = d.getVar('PACKAGES', True) | 1149 | packages = d.getVar('PACKAGES', True) |
| 1136 | pkgdest = d.getVar('PKGDEST', True) | 1150 | pkgdest = d.getVar('PKGDEST', True) |
| 1137 | pkgdatadir = d.getVar('PKGDESTWORK', True) | 1151 | pkgdatadir = d.getVar('PKGDESTWORK', True) |
| @@ -1144,6 +1158,16 @@ python emit_pkgdata() { | |||
| 1144 | f.write("PACKAGES: %s\n" % packages) | 1158 | f.write("PACKAGES: %s\n" % packages) |
| 1145 | f.close() | 1159 | f.close() |
| 1146 | 1160 | ||
| 1161 | pn = d.getVar('PN', True) | ||
| 1162 | global_variants = (d.getVar('MULTILIB_GLOBAL_VARIANTS', True) or "").split() | ||
| 1163 | variants = (d.getVar('MULTILIB_VARIANTS', True) or "").split() | ||
| 1164 | |||
| 1165 | if bb.data.inherits_class('kernel', d) or bb.data.inherits_class('module-base', d): | ||
| 1166 | write_extra_pkgs(variants, pn, packages, pkgdatadir) | ||
| 1167 | |||
| 1168 | if (bb.data.inherits_class('allarch', d) and not bb.data.inherits_class('packagegroup', d)): | ||
| 1169 | write_extra_pkgs(global_variants, pn, packages, pkgdatadir) | ||
| 1170 | |||
| 1147 | workdir = d.getVar('WORKDIR', True) | 1171 | workdir = d.getVar('WORKDIR', True) |
| 1148 | 1172 | ||
| 1149 | for pkg in packages.split(): | 1173 | for pkg in packages.split(): |
| @@ -1198,6 +1222,12 @@ python emit_pkgdata() { | |||
| 1198 | packagedfile = pkgdatadir + '/runtime/%s.packaged' % pkg | 1222 | packagedfile = pkgdatadir + '/runtime/%s.packaged' % pkg |
| 1199 | file(packagedfile, 'w').close() | 1223 | file(packagedfile, 'w').close() |
| 1200 | 1224 | ||
| 1225 | if bb.data.inherits_class('kernel', d) or bb.data.inherits_class('module-base', d): | ||
| 1226 | write_extra_runtime_pkgs(variants, packages, pkgdatadir) | ||
| 1227 | |||
| 1228 | if bb.data.inherits_class('allarch', d) and not bb.data.inherits_class('packagegroup', d): | ||
| 1229 | write_extra_runtime_pkgs(global_variants, packages, pkgdatadir) | ||
| 1230 | |||
| 1201 | bb.utils.unlockfile(lf) | 1231 | bb.utils.unlockfile(lf) |
| 1202 | } | 1232 | } |
| 1203 | emit_pkgdata[dirs] = "${PKGDESTWORK}/runtime ${PKGDESTWORK}/runtime-reverse" | 1233 | emit_pkgdata[dirs] = "${PKGDESTWORK}/runtime ${PKGDESTWORK}/runtime-reverse" |
