From 1c7d6584a7811b7785ae5c1e378f14b5ba0971cf Mon Sep 17 00:00:00 2001 From: takeshi_hoshina Date: Mon, 2 Nov 2020 11:07:33 +0900 Subject: basesystem-jj recipes --- external/poky/meta/classes/staging.bbclass | 76 +++++++++++++++++++----------- 1 file changed, 48 insertions(+), 28 deletions(-) (limited to 'external/poky/meta/classes/staging.bbclass') diff --git a/external/poky/meta/classes/staging.bbclass b/external/poky/meta/classes/staging.bbclass index 84e13bab..5b04f88b 100644 --- a/external/poky/meta/classes/staging.bbclass +++ b/external/poky/meta/classes/staging.bbclass @@ -27,11 +27,12 @@ SYSROOT_DIRS_BLACKLIST = " \ ${mandir} \ ${docdir} \ ${infodir} \ - ${datadir}/locale \ ${datadir}/applications \ ${datadir}/fonts \ + ${datadir}/gtk-doc/html \ + ${datadir}/locale \ ${datadir}/pixmaps \ - ${libdir}/${PN}/ptest \ + ${libdir}/${BPN}/ptest \ " sysroot_stage_dir() { @@ -74,8 +75,8 @@ python sysroot_strip () { dstdir = d.getVar('SYSROOT_DESTDIR') pn = d.getVar('PN') - libdir = os.path.abspath(dstdir + os.sep + d.getVar("libdir")) - base_libdir = os.path.abspath(dstdir + os.sep + d.getVar("base_libdir")) + libdir = d.getVar("libdir") + base_libdir = d.getVar("base_libdir") qa_already_stripped = 'already-stripped' in (d.getVar('INSANE_SKIP_' + pn) or "").split() strip_cmd = d.getVar("STRIP") @@ -167,7 +168,7 @@ def staging_processfixme(fixme, target, recipesysroot, recipesysrootnative, d): if not fixme: return cmd = "sed -e 's:^[^/]*/:%s/:g' %s | xargs sed -i -e 's:FIXMESTAGINGDIRTARGET:%s:g; s:FIXMESTAGINGDIRHOST:%s:g'" % (target, " ".join(fixme), recipesysroot, recipesysrootnative) - for fixmevar in ['COMPONENTS_DIR', 'HOSTTOOLS_DIR', 'PKGDATA_DIR', 'PSEUDO_LOCALSTATEDIR', 'LOGFIFO']: + for fixmevar in ['PSEUDO_SYSROOT', 'HOSTTOOLS_DIR', 'PKGDATA_DIR', 'PSEUDO_LOCALSTATEDIR', 'LOGFIFO']: fixme_path = d.getVar(fixmevar) cmd += " -e 's:FIXME_%s:%s:g'" % (fixmevar, fixme_path) bb.debug(2, cmd) @@ -196,7 +197,11 @@ def staging_populate_sysroot_dir(targetsysroot, nativesysroot, native, d): for pkgarch in pkgarchs: for manifest in glob.glob(d.expand("${SSTATE_MANIFESTS}/manifest-%s-*.populate_sysroot" % pkgarch)): if manifest.endswith("-initial.populate_sysroot"): - # skip glibc-initial and libgcc-initial due to file overlap + # skip libgcc-initial due to file overlap + continue + if not native and (manifest.endswith("-native.populate_sysroot") or "nativesdk-" in manifest): + continue + if native and not (manifest.endswith("-native.populate_sysroot") or manifest.endswith("-cross.populate_sysroot") or "-cross-" in manifest): continue tmanifest = targetdir + "/" + os.path.basename(manifest) if os.path.exists(tmanifest): @@ -256,12 +261,10 @@ python extend_recipe_sysroot() { workdir = d.getVar("WORKDIR") #bb.warn(str(taskdepdata)) pn = d.getVar("PN") - mc = d.getVar("BB_CURRENT_MC") stagingdir = d.getVar("STAGING_DIR") sharedmanifests = d.getVar("COMPONENTS_DIR") + "/manifests" recipesysroot = d.getVar("RECIPE_SYSROOT") recipesysrootnative = d.getVar("RECIPE_SYSROOT_NATIVE") - current_variant = d.getVar("BBEXTENDVARIANT") # Detect bitbake -b usage nodeps = d.getVar("BB_LIMITEDDEPS") or False @@ -274,11 +277,13 @@ python extend_recipe_sysroot() { start = None configuredeps = [] + owntaskdeps = [] for dep in taskdepdata: data = taskdepdata[dep] if data[1] == mytaskname and data[0] == pn: start = dep - break + elif data[0] == pn: + owntaskdeps.append(data[1]) if start is None: bb.fatal("Couldn't find ourself in BB_TASKDEPDATA?") @@ -424,7 +429,7 @@ python extend_recipe_sysroot() { # Was likely already uninstalled continue potential.append(l) - # We need to ensure not other task needs this dependency. We hold the sysroot + # We need to ensure no other task needs this dependency. We hold the sysroot # lock so we ca search the indexes to check if potential: for i in glob.glob(depdir + "/index.*"): @@ -432,6 +437,11 @@ python extend_recipe_sysroot() { continue with open(i, "r") as f: for l in f: + if l.startswith("TaskDeps:"): + prevtasks = l.split()[1:] + if mytaskname in prevtasks: + # We're a dependency of this task so we can clear items out the sysroot + break l = l.strip() if l in potential: potential.remove(l) @@ -446,12 +456,8 @@ python extend_recipe_sysroot() { msg_exists = [] msg_adding = [] + # Handle all removals first since files may move between recipes for dep in configuredeps: - if mc != 'default': - # We should not care about other multiconfigs - depmc = dep.split(':')[1] - if depmc != mc: - continue c = setscenedeps[dep][0] if c not in installed: continue @@ -461,7 +467,6 @@ python extend_recipe_sysroot() { if os.path.exists(depdir + "/" + c): lnk = os.readlink(depdir + "/" + c) if lnk == c + "." + taskhash and os.path.exists(depdir + "/" + c + ".complete"): - msg_exists.append(c) continue else: bb.note("%s exists in sysroot, but is stale (%s vs. %s), removing." % (c, lnk, c + "." + taskhash)) @@ -472,6 +477,21 @@ python extend_recipe_sysroot() { elif os.path.lexists(depdir + "/" + c): os.unlink(depdir + "/" + c) + binfiles = {} + # Now handle installs + for dep in configuredeps: + c = setscenedeps[dep][0] + if c not in installed: + continue + taskhash = setscenedeps[dep][5] + taskmanifest = depdir + "/" + c + "." + taskhash + + if os.path.exists(depdir + "/" + c): + lnk = os.readlink(depdir + "/" + c) + if lnk == c + "." + taskhash and os.path.exists(depdir + "/" + c + ".complete"): + msg_exists.append(c) + continue + msg_adding.append(c) os.symlink(c + "." + taskhash, depdir + "/" + c) @@ -550,7 +570,16 @@ python extend_recipe_sysroot() { if l.endswith("/"): staging_copydir(l, targetdir, dest, seendirs) continue - staging_copyfile(l, targetdir, dest, postinsts, seendirs) + if "/bin/" in l or "/sbin/" in l: + # defer /*bin/* files until last in case they need libs + binfiles[l] = (targetdir, dest) + else: + staging_copyfile(l, targetdir, dest, postinsts, seendirs) + + # Handle deferred binfiles + for l in binfiles: + (targetdir, dest) = binfiles[l] + staging_copyfile(l, targetdir, dest, postinsts, seendirs) bb.note("Installed into sysroot: %s" % str(msg_adding)) bb.note("Skipping as already exists in sysroot: %s" % str(msg_exists)) @@ -566,6 +595,7 @@ python extend_recipe_sysroot() { os.symlink(manifests[dep], depdir + "/" + c + ".complete") with open(taskindex, "w") as f: + f.write("TaskDeps: " + " ".join(owntaskdeps) + "\n") for l in sorted(installed): f.write(l + "\n") @@ -573,22 +603,12 @@ python extend_recipe_sysroot() { } extend_recipe_sysroot[vardepsexclude] += "MACHINE_ARCH PACKAGE_EXTRA_ARCHS SDK_ARCH BUILD_ARCH SDK_OS BB_TASKDEPDATA" +do_prepare_recipe_sysroot[deptask] = "do_populate_sysroot" python do_prepare_recipe_sysroot () { bb.build.exec_func("extend_recipe_sysroot", d) } addtask do_prepare_recipe_sysroot before do_configure after do_fetch -# Clean out the recipe specific sysroots before do_fetch -# (use a prefunc so we can order before extend_recipe_sysroot if it gets added) -python clean_recipe_sysroot() { - # We remove these stamps since we're removing any content they'd have added with - # cleandirs. This removes the sigdata too, likely not a big deal, - oe.path.remove(d.getVar("STAMP") + "*addto_recipe_sysroot*") - return -} -clean_recipe_sysroot[cleandirs] += "${RECIPE_SYSROOT} ${RECIPE_SYSROOT_NATIVE}" -do_fetch[prefuncs] += "clean_recipe_sysroot" - python staging_taskhandler() { bbtasks = e.tasklist for task in bbtasks: -- cgit 1.2.3-korg