summaryrefslogtreecommitdiffstats
path: root/meta/classes/image.bbclass
diff options
context:
space:
mode:
authorChristopher Larson <chris_larson@mentor.com>2015-09-01 15:23:04 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-04 16:23:48 +0100
commit635d38594c7b4c780d2c123146e4bf09722932aa (patch)
tree69195413e580e69cb4c4b35c8bc02a5dbf00dff8 /meta/classes/image.bbclass
parent2d4976772c9d9c718607ab31097b1a993e514b7d (diff)
downloadpoky-635d38594c7b4c780d2c123146e4bf09722932aa.tar.gz
image.bbclass: add rootfs_check_host_user_contaminated
This function is intended to be used in ROOTFS_POSTPROCESS_COMMAND, and checks for any paths outside of /home which are owned by the user running bitbake. (From OE-Core rev: 72903f7534cccad35886f2cad8aac98a59392ec7) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/image.bbclass')
-rw-r--r--meta/classes/image.bbclass14
1 files changed, 14 insertions, 0 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 4e66535407..fc7d64d7e5 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -460,6 +460,20 @@ rootfs_trim_schemas () {
460 done 460 done
461} 461}
462 462
463rootfs_check_host_user_contaminated () {
464 contaminated="${WORKDIR}/host-user-contaminated.txt"
465 HOST_USER_UID="$(PSEUDO_UNLOAD=1 id -u)"
466 HOST_USER_GID="$(PSEUDO_UNLOAD=1 id -g)"
467
468 find "${IMAGE_ROOTFS}" -wholename "${IMAGE_ROOTFS}/home" -prune \
469 -user "$HOST_USER_UID" -o -group "$HOST_USER_GID" >"$contaminated"
470
471 if [ -s "$contaminated" ]; then
472 echo "WARNING: Paths in the rootfs are owned by the same user or group as the user running bitbake. See the logfile for the specific paths."
473 cat "$contaminated" | sed "s,^, ,"
474 fi
475}
476
463# Make any absolute links in a sysroot relative 477# Make any absolute links in a sysroot relative
464rootfs_sysroot_relativelinks () { 478rootfs_sysroot_relativelinks () {
465 sysroot-relativelinks.py ${SDK_OUTPUT}/${SDKTARGETSYSROOT} 479 sysroot-relativelinks.py ${SDK_OUTPUT}/${SDKTARGETSYSROOT}