summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Kiernan <alex.kiernan@gmail.com>2020-06-22 11:57:17 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-06-23 14:41:59 +0100
commit47c8681e1fde830b5a38b8e187e8ad171b061901 (patch)
tree8435e9b8d31d8586b03f4f0eca5a405efc70cc83
parent4e0f64cba6e9d3ef4837460c9a6b506c33344012 (diff)
downloadopenembedded-core-contrib-47c8681e1fde830b5a38b8e187e8ad171b061901.tar.gz
rootfs-postcommands: Enable rootfs_check_host_user_contaminated
Generate output for each contaminated path so it's visible in the main log file, then enable rootfs_check_host_user_contaminated by default. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/rootfs-postcommands.bbclass9
1 files changed, 4 insertions, 5 deletions
diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass
index 2f171836fa..8dde15fc34 100644
--- a/meta/classes/rootfs-postcommands.bbclass
+++ b/meta/classes/rootfs-postcommands.bbclass
@@ -37,7 +37,7 @@ POSTINST_LOGFILE ?= "${localstatedir}/log/postinstall.log"
SYSTEMD_DEFAULT_TARGET ?= '${@bb.utils.contains("IMAGE_FEATURES", "x11-base", "graphical.target", "multi-user.target", d)}'
ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("DISTRO_FEATURES", "systemd", "set_systemd_default_target; systemd_create_users;", "", d)}'
-ROOTFS_POSTPROCESS_COMMAND += 'empty_var_volatile;'
+ROOTFS_POSTPROCESS_COMMAND += 'empty_var_volatile; rootfs_check_host_user_contaminated;'
# Sort the user and group entries in /etc by ID in order to make the content
# deterministic. Package installs are not deterministic, causing the ordering
@@ -311,10 +311,9 @@ rootfs_check_host_user_contaminated () {
find "${IMAGE_ROOTFS}" -wholename "${IMAGE_ROOTFS}/home" -prune \
-user "$HOST_USER_UID" -o -group "$HOST_USER_GID" >"$contaminated"
- if [ -s "$contaminated" ]; then
- 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."
- cat "$contaminated" | sed "s,^, ,"
- fi
+ sed -e "s,${IMAGE_ROOTFS},," $contaminated | while read line; do
+ bbwarn "Path in the rootfs is owned by the same user or group as the user running bitbake:" $line
+ done
}
# Make any absolute links in a sysroot relative