diff options
Diffstat (limited to 'poky/meta/classes/staging.bbclass')
-rw-r--r-- | poky/meta/classes/staging.bbclass | 48 |
1 files changed, 41 insertions, 7 deletions
diff --git a/poky/meta/classes/staging.bbclass b/poky/meta/classes/staging.bbclass index 25f77c7735..ab827766be 100644 --- a/poky/meta/classes/staging.bbclass +++ b/poky/meta/classes/staging.bbclass @@ -24,7 +24,7 @@ SYSROOT_DIRS:append:class-cross = " ${SYSROOT_DIRS_NATIVE}" SYSROOT_DIRS:append:class-crosssdk = " ${SYSROOT_DIRS_NATIVE}" # These directories will not be staged in the sysroot -SYSROOT_DIRS_BLACKLIST = " \ +SYSROOT_DIRS_IGNORE = " \ ${mandir} \ ${docdir} \ ${infodir} \ @@ -49,9 +49,10 @@ sysroot_stage_dir() { fi mkdir -p "$dest" + rdest=$(realpath --relative-to="$src" "$dest") ( cd $src - find . -print0 | cpio --null -pdlu $dest + find . -print0 | cpio --null -pdlu $rdest ) } @@ -64,7 +65,7 @@ sysroot_stage_dirs() { done # Remove directories we do not care about - for dir in ${SYSROOT_DIRS_BLACKLIST}; do + for dir in ${SYSROOT_DIRS_IGNORE}; do rm -rf "$to$dir" done } @@ -103,7 +104,7 @@ python do_populate_sysroot () { for f in (d.getVar('SYSROOT_PREPROCESS_FUNCS') or '').split(): bb.build.exec_func(f, d) pn = d.getVar("PN") - multiprov = d.getVar("MULTI_PROVIDER_WHITELIST").split() + multiprov = d.getVar("BB_MULTI_PROVIDER_ALLOWED").split() provdir = d.expand("${SYSROOT_DESTDIR}${base_prefix}/sysroot-providers/") bb.utils.mkdirhier(provdir) for p in d.getVar("PROVIDES").split(): @@ -115,11 +116,11 @@ python do_populate_sysroot () { } do_populate_sysroot[vardeps] += "${SYSROOT_PREPROCESS_FUNCS}" -do_populate_sysroot[vardepsexclude] += "MULTI_PROVIDER_WHITELIST" +do_populate_sysroot[vardepsexclude] += "BB_MULTI_PROVIDER_ALLOWED" POPULATESYSROOTDEPS = "" -POPULATESYSROOTDEPS:class-target = "virtual/${MLPREFIX}${TARGET_PREFIX}binutils:do_populate_sysroot" -POPULATESYSROOTDEPS:class-nativesdk = "virtual/${TARGET_PREFIX}binutils-crosssdk:do_populate_sysroot" +POPULATESYSROOTDEPS:class-target = "virtual/${MLPREFIX}${HOST_PREFIX}binutils:do_populate_sysroot" +POPULATESYSROOTDEPS:class-nativesdk = "virtual/${HOST_PREFIX}binutils-crosssdk:do_populate_sysroot" do_populate_sysroot[depends] += "${POPULATESYSROOTDEPS}" SSTATETASKS += "do_populate_sysroot" @@ -624,3 +625,36 @@ python staging_taskhandler() { } staging_taskhandler[eventmask] = "bb.event.RecipeTaskPreProcess" addhandler staging_taskhandler + + +# +# Target build output, stored in do_populate_sysroot or do_package can depend +# not only upon direct dependencies but also indirect ones. A good example is +# linux-libc-headers. The toolchain depends on this but most target recipes do +# not. There are some headers which are not used by the toolchain build and do +# not change the toolchain task output, hence the task hashes can change without +# changing the sysroot output of that recipe yet they can influence others. +# +# A specific example is rtc.h which can change rtcwake.c in util-linux but is not +# used in the glibc or gcc build. To account for this, we need to account for the +# populate_sysroot hashes in the task output hashes. +# +python target_add_sysroot_deps () { + current_task = "do_" + d.getVar("BB_CURRENTTASK") + if current_task not in ["do_populate_sysroot", "do_package"]: + return + + pn = d.getVar("PN") + if pn.endswith("-native"): + return + + taskdepdata = d.getVar("BB_TASKDEPDATA", False) + deps = {} + for dep in taskdepdata.values(): + if dep[1] == "do_populate_sysroot" and not dep[0].endswith(("-native", "-initial")) and "-cross-" not in dep[0]: + deps[dep[0]] = dep[6] + + d.setVar("HASHEQUIV_EXTRA_SIGDATA", "\n".join("%s: %s" % (k, deps[k]) for k in sorted(deps.keys()))) +} +SSTATECREATEFUNCS += "target_add_sysroot_deps" + |