generic-poky/scripts/sstate-sysroot-cruft.sh

200 lines
5.8 KiB
Bash
Raw Normal View History

#!/bin/sh
# Used to find files installed in sysroot which are not tracked by sstate manifest
# Global vars
tmpdir=
usage () {
cat << EOF
Welcome to sysroot cruft finding utility.
$0 <OPTION>
Options:
-h, --help
Display this help and exit.
--tmpdir=<tmpdir>
Specify tmpdir, will use the environment variable TMPDIR if it is not specified.
Something like /OE/oe-core/tmp-eglibc (no / at the end).
sstate-sysroot-cruft.sh: Improve to use it from CI * strip tmpdir prefix, so that we have shorter paths which aren't builder specific * use '#' for regexp delimiter so that we don't need to prefix forward slashes in paths * extend default whitelist to cover typical cases * add parameter for external whitelist file * use number of found paths as return code, so that CI can easily report error when new untracked files are found * use .txt suffix for all output files, so that they can be easily viewed in browser * add populate_sysroot task, because somewhere between dora and daisy the populate-sysroot files in sstate-control were renamed to have underscore instead of dash * only few entries not covered by this default whitelist were found in world build (but I'll leave these for people to whitelist, because they are not generated in most builds) * [^/]*/home/builder home directory from meta/recipes-graphics/builder/builder_0.1.bb * [^/]*/usr/src/kernel/patches * [^/]*/usr/lib/gdk-pixbuf-2.0/.*/loaders.cache 3 places are using this, not sure which one creates it meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.30.8.bb: GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache meta/recipes-gnome/gtk+/gtk-update-icon-cache-native_3.4.4.bb: GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache scripts/postinst-intercepts/update_pixbuf_cache: >$GDK_PIXBUF_MODULEDIR/../loaders.cache && \ sed -i -e "s:$D::g" $GDK_PIXBUF_MODULEDIR/../loaders.cache (From OE-Core rev: b1bfec63949e16abe8c11c34530dfbfb176c04cd) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-10 18:41:53 +00:00
--whitelist=<whitelist-file>
Text file, each line is regular expression for paths we want to ignore in resulting diff.
You can use diff file from the script output, if it contains only expected exceptions.
'#' is used as regexp delimiter, so you don't need to prefix forward slashes in paths.
^ and $ is automatically added, so provide only the middle part.
Lines starting with '#' are ignored as comments.
All paths are relative to "sysroots" directory.
Directories don't end with forward slash.
EOF
}
# Print error information and exit.
echo_error () {
echo "ERROR: $1" >&2
exit 1
}
while [ -n "$1" ]; do
case $1 in
--tmpdir=*)
tmpdir=`echo $1 | sed -e 's#^--tmpdir=##' | xargs readlink -e`
[ -d "$tmpdir" ] || echo_error "Invalid argument to --tmpdir"
shift
;;
sstate-sysroot-cruft.sh: Improve to use it from CI * strip tmpdir prefix, so that we have shorter paths which aren't builder specific * use '#' for regexp delimiter so that we don't need to prefix forward slashes in paths * extend default whitelist to cover typical cases * add parameter for external whitelist file * use number of found paths as return code, so that CI can easily report error when new untracked files are found * use .txt suffix for all output files, so that they can be easily viewed in browser * add populate_sysroot task, because somewhere between dora and daisy the populate-sysroot files in sstate-control were renamed to have underscore instead of dash * only few entries not covered by this default whitelist were found in world build (but I'll leave these for people to whitelist, because they are not generated in most builds) * [^/]*/home/builder home directory from meta/recipes-graphics/builder/builder_0.1.bb * [^/]*/usr/src/kernel/patches * [^/]*/usr/lib/gdk-pixbuf-2.0/.*/loaders.cache 3 places are using this, not sure which one creates it meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.30.8.bb: GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache meta/recipes-gnome/gtk+/gtk-update-icon-cache-native_3.4.4.bb: GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache scripts/postinst-intercepts/update_pixbuf_cache: >$GDK_PIXBUF_MODULEDIR/../loaders.cache && \ sed -i -e "s:$D::g" $GDK_PIXBUF_MODULEDIR/../loaders.cache (From OE-Core rev: b1bfec63949e16abe8c11c34530dfbfb176c04cd) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-10 18:41:53 +00:00
--whitelist=*)
fwhitelist=`echo $1 | sed -e 's#^--whitelist=##' | xargs readlink -e`
[ -f "$fwhitelist" ] || echo_error "Invalid argument to --whitelist"
shift
;;
--help|-h)
usage
exit 0
;;
*)
echo "Invalid arguments $*"
echo_error "Try '$0 -h' for more information."
;;
esac
done
# sstate cache directory, use environment variable TMPDIR
# if it was not specified, otherwise, error.
[ -n "$tmpdir" ] || tmpdir=$TMPDIR
[ -n "$tmpdir" ] || echo_error "No tmpdir found!"
[ -d "$tmpdir" ] || echo_error "Invalid tmpdir \"$tmpdir\""
OUTPUT=${tmpdir}/sysroot.cruft.`date "+%s"`
sstate-sysroot-cruft.sh: Improve to use it from CI * strip tmpdir prefix, so that we have shorter paths which aren't builder specific * use '#' for regexp delimiter so that we don't need to prefix forward slashes in paths * extend default whitelist to cover typical cases * add parameter for external whitelist file * use number of found paths as return code, so that CI can easily report error when new untracked files are found * use .txt suffix for all output files, so that they can be easily viewed in browser * add populate_sysroot task, because somewhere between dora and daisy the populate-sysroot files in sstate-control were renamed to have underscore instead of dash * only few entries not covered by this default whitelist were found in world build (but I'll leave these for people to whitelist, because they are not generated in most builds) * [^/]*/home/builder home directory from meta/recipes-graphics/builder/builder_0.1.bb * [^/]*/usr/src/kernel/patches * [^/]*/usr/lib/gdk-pixbuf-2.0/.*/loaders.cache 3 places are using this, not sure which one creates it meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.30.8.bb: GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache meta/recipes-gnome/gtk+/gtk-update-icon-cache-native_3.4.4.bb: GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache scripts/postinst-intercepts/update_pixbuf_cache: >$GDK_PIXBUF_MODULEDIR/../loaders.cache && \ sed -i -e "s:$D::g" $GDK_PIXBUF_MODULEDIR/../loaders.cache (From OE-Core rev: b1bfec63949e16abe8c11c34530dfbfb176c04cd) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-10 18:41:53 +00:00
# top level directories
WHITELIST="[^/]*"
# generated by base-passwd recipe
WHITELIST="${WHITELIST} \
.*/etc/group-\? \
.*/etc/passwd-\? \
"
# generated by pseudo-native
WHITELIST="${WHITELIST} \
.*/var/pseudo \
.*/var/pseudo/[^/]* \
"
# generated by package.bbclass:SHLIBSDIRS = "${PKGDATA_DIR}/${MLPREFIX}shlibs"
WHITELIST="${WHITELIST} \
.*/shlibs \
.*/pkgdata \
"
# generated by python
WHITELIST="${WHITELIST} \
.*\.pyc \
.*\.pyo \
.*/__pycache__ \
"
# generated by lua
WHITELIST="${WHITELIST} \
.*\.luac \
sstate-sysroot-cruft.sh: Improve to use it from CI * strip tmpdir prefix, so that we have shorter paths which aren't builder specific * use '#' for regexp delimiter so that we don't need to prefix forward slashes in paths * extend default whitelist to cover typical cases * add parameter for external whitelist file * use number of found paths as return code, so that CI can easily report error when new untracked files are found * use .txt suffix for all output files, so that they can be easily viewed in browser * add populate_sysroot task, because somewhere between dora and daisy the populate-sysroot files in sstate-control were renamed to have underscore instead of dash * only few entries not covered by this default whitelist were found in world build (but I'll leave these for people to whitelist, because they are not generated in most builds) * [^/]*/home/builder home directory from meta/recipes-graphics/builder/builder_0.1.bb * [^/]*/usr/src/kernel/patches * [^/]*/usr/lib/gdk-pixbuf-2.0/.*/loaders.cache 3 places are using this, not sure which one creates it meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.30.8.bb: GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache meta/recipes-gnome/gtk+/gtk-update-icon-cache-native_3.4.4.bb: GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache scripts/postinst-intercepts/update_pixbuf_cache: >$GDK_PIXBUF_MODULEDIR/../loaders.cache && \ sed -i -e "s:$D::g" $GDK_PIXBUF_MODULEDIR/../loaders.cache (From OE-Core rev: b1bfec63949e16abe8c11c34530dfbfb176c04cd) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-10 18:41:53 +00:00
"
# generated by sgml-common-native
WHITELIST="${WHITELIST} \
.*/etc/sgml/sgml-docbook.bak \
"
# generated by php
WHITELIST="${WHITELIST} \
.*/usr/lib/php5/php/.channels \
.*/usr/lib/php5/php/.channels/.* \
.*/usr/lib/php5/php/.registry \
.*/usr/lib/php5/php/.registry/.* \
.*/usr/lib/php5/php/.depdb \
.*/usr/lib/php5/php/.depdblock \
.*/usr/lib/php5/php/.filemap \
.*/usr/lib/php5/php/.lock \
"
sstate-sysroot-cruft.sh: Improve to use it from CI * strip tmpdir prefix, so that we have shorter paths which aren't builder specific * use '#' for regexp delimiter so that we don't need to prefix forward slashes in paths * extend default whitelist to cover typical cases * add parameter for external whitelist file * use number of found paths as return code, so that CI can easily report error when new untracked files are found * use .txt suffix for all output files, so that they can be easily viewed in browser * add populate_sysroot task, because somewhere between dora and daisy the populate-sysroot files in sstate-control were renamed to have underscore instead of dash * only few entries not covered by this default whitelist were found in world build (but I'll leave these for people to whitelist, because they are not generated in most builds) * [^/]*/home/builder home directory from meta/recipes-graphics/builder/builder_0.1.bb * [^/]*/usr/src/kernel/patches * [^/]*/usr/lib/gdk-pixbuf-2.0/.*/loaders.cache 3 places are using this, not sure which one creates it meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.30.8.bb: GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache meta/recipes-gnome/gtk+/gtk-update-icon-cache-native_3.4.4.bb: GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache scripts/postinst-intercepts/update_pixbuf_cache: >$GDK_PIXBUF_MODULEDIR/../loaders.cache && \ sed -i -e "s:$D::g" $GDK_PIXBUF_MODULEDIR/../loaders.cache (From OE-Core rev: b1bfec63949e16abe8c11c34530dfbfb176c04cd) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-10 18:41:53 +00:00
# generated by toolchain
WHITELIST="${WHITELIST} \
[^/]*-tcbootstrap/lib \
"
# generated by useradd.bbclass
WHITELIST="${WHITELIST} \
[^/]*/home \
[^/]*/home/xuser \
[^/]*/home/xuser/.bashrc \
[^/]*/home/xuser/.profile \
[^/]*/home/builder \
[^/]*/home/builder/.bashrc \
[^/]*/home/builder/.profile \
"
# generated by image.py for WIC
# introduced in oe-core commit 861ce6c5d4836df1a783be3b01d2de56117c9863
WHITELIST="${WHITELIST} \
[^/]*/imgdata \
[^/]*/imgdata/[^/]*\.env \
sstate-sysroot-cruft.sh: Improve to use it from CI * strip tmpdir prefix, so that we have shorter paths which aren't builder specific * use '#' for regexp delimiter so that we don't need to prefix forward slashes in paths * extend default whitelist to cover typical cases * add parameter for external whitelist file * use number of found paths as return code, so that CI can easily report error when new untracked files are found * use .txt suffix for all output files, so that they can be easily viewed in browser * add populate_sysroot task, because somewhere between dora and daisy the populate-sysroot files in sstate-control were renamed to have underscore instead of dash * only few entries not covered by this default whitelist were found in world build (but I'll leave these for people to whitelist, because they are not generated in most builds) * [^/]*/home/builder home directory from meta/recipes-graphics/builder/builder_0.1.bb * [^/]*/usr/src/kernel/patches * [^/]*/usr/lib/gdk-pixbuf-2.0/.*/loaders.cache 3 places are using this, not sure which one creates it meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.30.8.bb: GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache meta/recipes-gnome/gtk+/gtk-update-icon-cache-native_3.4.4.bb: GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache scripts/postinst-intercepts/update_pixbuf_cache: >$GDK_PIXBUF_MODULEDIR/../loaders.cache && \ sed -i -e "s:$D::g" $GDK_PIXBUF_MODULEDIR/../loaders.cache (From OE-Core rev: b1bfec63949e16abe8c11c34530dfbfb176c04cd) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-10 18:41:53 +00:00
"
# generated by fontcache.bbclass
WHITELIST="${WHITELIST} \
.*/var/cache/fontconfig/ \
"
# created by oe.utils.write_ld_so_conf which is used from few bbclasses and recipes:
# meta/classes/image-prelink.bbclass: oe.utils.write_ld_so_conf(d)
# meta/classes/insane.bbclass: oe.utils.write_ld_so_conf(d)
# meta/classes/insane.bbclass: oe.utils.write_ld_so_conf(d)
# meta/recipes-gnome/gobject-introspection/gobject-introspection_1.48.0.bb: oe.utils.write_ld_so_conf(d)
# meta/recipes-gnome/gobject-introspection/gobject-introspection_1.48.0.bb: oe.utils.write_ld_so_conf(d)
# introduced in oe-core commit 7fd1d7e639c2ed7e0699937a5cb245c187b7c811
# and more visible since added to gobject-introspection in 10e0c1a3a452baa05d160a92a54b2e33cf0fd061
WHITELIST="${WHITELIST} \
[^/]*/etc/ld.so.conf \
"
sstate-sysroot-cruft.sh: Improve to use it from CI * strip tmpdir prefix, so that we have shorter paths which aren't builder specific * use '#' for regexp delimiter so that we don't need to prefix forward slashes in paths * extend default whitelist to cover typical cases * add parameter for external whitelist file * use number of found paths as return code, so that CI can easily report error when new untracked files are found * use .txt suffix for all output files, so that they can be easily viewed in browser * add populate_sysroot task, because somewhere between dora and daisy the populate-sysroot files in sstate-control were renamed to have underscore instead of dash * only few entries not covered by this default whitelist were found in world build (but I'll leave these for people to whitelist, because they are not generated in most builds) * [^/]*/home/builder home directory from meta/recipes-graphics/builder/builder_0.1.bb * [^/]*/usr/src/kernel/patches * [^/]*/usr/lib/gdk-pixbuf-2.0/.*/loaders.cache 3 places are using this, not sure which one creates it meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.30.8.bb: GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache meta/recipes-gnome/gtk+/gtk-update-icon-cache-native_3.4.4.bb: GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache scripts/postinst-intercepts/update_pixbuf_cache: >$GDK_PIXBUF_MODULEDIR/../loaders.cache && \ sed -i -e "s:$D::g" $GDK_PIXBUF_MODULEDIR/../loaders.cache (From OE-Core rev: b1bfec63949e16abe8c11c34530dfbfb176c04cd) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-10 18:41:53 +00:00
SYSROOTS="`readlink -f ${tmpdir}`/sysroots/"
mkdir ${OUTPUT}
sstate-sysroot-cruft.sh: Improve to use it from CI * strip tmpdir prefix, so that we have shorter paths which aren't builder specific * use '#' for regexp delimiter so that we don't need to prefix forward slashes in paths * extend default whitelist to cover typical cases * add parameter for external whitelist file * use number of found paths as return code, so that CI can easily report error when new untracked files are found * use .txt suffix for all output files, so that they can be easily viewed in browser * add populate_sysroot task, because somewhere between dora and daisy the populate-sysroot files in sstate-control were renamed to have underscore instead of dash * only few entries not covered by this default whitelist were found in world build (but I'll leave these for people to whitelist, because they are not generated in most builds) * [^/]*/home/builder home directory from meta/recipes-graphics/builder/builder_0.1.bb * [^/]*/usr/src/kernel/patches * [^/]*/usr/lib/gdk-pixbuf-2.0/.*/loaders.cache 3 places are using this, not sure which one creates it meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.30.8.bb: GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache meta/recipes-gnome/gtk+/gtk-update-icon-cache-native_3.4.4.bb: GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache scripts/postinst-intercepts/update_pixbuf_cache: >$GDK_PIXBUF_MODULEDIR/../loaders.cache && \ sed -i -e "s:$D::g" $GDK_PIXBUF_MODULEDIR/../loaders.cache (From OE-Core rev: b1bfec63949e16abe8c11c34530dfbfb176c04cd) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-10 18:41:53 +00:00
find ${tmpdir}/sstate-control -name \*.populate-sysroot\* -o -name \*.populate_sysroot\* -o -name \*.package\* | xargs cat | grep sysroots | \
sed 's#/$##g; s#///*#/#g' | \
# work around for paths ending with / for directories and multiplied // (e.g. paths to native sysroot)
sstate-sysroot-cruft.sh: Improve to use it from CI * strip tmpdir prefix, so that we have shorter paths which aren't builder specific * use '#' for regexp delimiter so that we don't need to prefix forward slashes in paths * extend default whitelist to cover typical cases * add parameter for external whitelist file * use number of found paths as return code, so that CI can easily report error when new untracked files are found * use .txt suffix for all output files, so that they can be easily viewed in browser * add populate_sysroot task, because somewhere between dora and daisy the populate-sysroot files in sstate-control were renamed to have underscore instead of dash * only few entries not covered by this default whitelist were found in world build (but I'll leave these for people to whitelist, because they are not generated in most builds) * [^/]*/home/builder home directory from meta/recipes-graphics/builder/builder_0.1.bb * [^/]*/usr/src/kernel/patches * [^/]*/usr/lib/gdk-pixbuf-2.0/.*/loaders.cache 3 places are using this, not sure which one creates it meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.30.8.bb: GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache meta/recipes-gnome/gtk+/gtk-update-icon-cache-native_3.4.4.bb: GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache scripts/postinst-intercepts/update_pixbuf_cache: >$GDK_PIXBUF_MODULEDIR/../loaders.cache && \ sed -i -e "s:$D::g" $GDK_PIXBUF_MODULEDIR/../loaders.cache (From OE-Core rev: b1bfec63949e16abe8c11c34530dfbfb176c04cd) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-10 18:41:53 +00:00
sort | sed "s#^${SYSROOTS}##g" > ${OUTPUT}/master.list.all.txt
sort -u ${OUTPUT}/master.list.all.txt > ${OUTPUT}/master.list.txt # -u because some directories are listed for more recipes
find ${tmpdir}/sysroots/ | \
sstate-sysroot-cruft.sh: Improve to use it from CI * strip tmpdir prefix, so that we have shorter paths which aren't builder specific * use '#' for regexp delimiter so that we don't need to prefix forward slashes in paths * extend default whitelist to cover typical cases * add parameter for external whitelist file * use number of found paths as return code, so that CI can easily report error when new untracked files are found * use .txt suffix for all output files, so that they can be easily viewed in browser * add populate_sysroot task, because somewhere between dora and daisy the populate-sysroot files in sstate-control were renamed to have underscore instead of dash * only few entries not covered by this default whitelist were found in world build (but I'll leave these for people to whitelist, because they are not generated in most builds) * [^/]*/home/builder home directory from meta/recipes-graphics/builder/builder_0.1.bb * [^/]*/usr/src/kernel/patches * [^/]*/usr/lib/gdk-pixbuf-2.0/.*/loaders.cache 3 places are using this, not sure which one creates it meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.30.8.bb: GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache meta/recipes-gnome/gtk+/gtk-update-icon-cache-native_3.4.4.bb: GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache scripts/postinst-intercepts/update_pixbuf_cache: >$GDK_PIXBUF_MODULEDIR/../loaders.cache && \ sed -i -e "s:$D::g" $GDK_PIXBUF_MODULEDIR/../loaders.cache (From OE-Core rev: b1bfec63949e16abe8c11c34530dfbfb176c04cd) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-10 18:41:53 +00:00
sort | sed "s#^${SYSROOTS}##g" > ${OUTPUT}/sysroot.list.txt
sstate-sysroot-cruft.sh: Improve to use it from CI * strip tmpdir prefix, so that we have shorter paths which aren't builder specific * use '#' for regexp delimiter so that we don't need to prefix forward slashes in paths * extend default whitelist to cover typical cases * add parameter for external whitelist file * use number of found paths as return code, so that CI can easily report error when new untracked files are found * use .txt suffix for all output files, so that they can be easily viewed in browser * add populate_sysroot task, because somewhere between dora and daisy the populate-sysroot files in sstate-control were renamed to have underscore instead of dash * only few entries not covered by this default whitelist were found in world build (but I'll leave these for people to whitelist, because they are not generated in most builds) * [^/]*/home/builder home directory from meta/recipes-graphics/builder/builder_0.1.bb * [^/]*/usr/src/kernel/patches * [^/]*/usr/lib/gdk-pixbuf-2.0/.*/loaders.cache 3 places are using this, not sure which one creates it meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.30.8.bb: GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache meta/recipes-gnome/gtk+/gtk-update-icon-cache-native_3.4.4.bb: GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache scripts/postinst-intercepts/update_pixbuf_cache: >$GDK_PIXBUF_MODULEDIR/../loaders.cache && \ sed -i -e "s:$D::g" $GDK_PIXBUF_MODULEDIR/../loaders.cache (From OE-Core rev: b1bfec63949e16abe8c11c34530dfbfb176c04cd) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-10 18:41:53 +00:00
diff ${OUTPUT}/master.list.all.txt ${OUTPUT}/master.list.txt > ${OUTPUT}/duplicates.txt
diff ${OUTPUT}/master.list.txt ${OUTPUT}/sysroot.list.txt > ${OUTPUT}/diff.all.txt
sstate-sysroot-cruft.sh: Improve to use it from CI * strip tmpdir prefix, so that we have shorter paths which aren't builder specific * use '#' for regexp delimiter so that we don't need to prefix forward slashes in paths * extend default whitelist to cover typical cases * add parameter for external whitelist file * use number of found paths as return code, so that CI can easily report error when new untracked files are found * use .txt suffix for all output files, so that they can be easily viewed in browser * add populate_sysroot task, because somewhere between dora and daisy the populate-sysroot files in sstate-control were renamed to have underscore instead of dash * only few entries not covered by this default whitelist were found in world build (but I'll leave these for people to whitelist, because they are not generated in most builds) * [^/]*/home/builder home directory from meta/recipes-graphics/builder/builder_0.1.bb * [^/]*/usr/src/kernel/patches * [^/]*/usr/lib/gdk-pixbuf-2.0/.*/loaders.cache 3 places are using this, not sure which one creates it meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.30.8.bb: GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache meta/recipes-gnome/gtk+/gtk-update-icon-cache-native_3.4.4.bb: GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache scripts/postinst-intercepts/update_pixbuf_cache: >$GDK_PIXBUF_MODULEDIR/../loaders.cache && \ sed -i -e "s:$D::g" $GDK_PIXBUF_MODULEDIR/../loaders.cache (From OE-Core rev: b1bfec63949e16abe8c11c34530dfbfb176c04cd) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-10 18:41:53 +00:00
grep "^> ." ${OUTPUT}/diff.all.txt | sed 's/^> //g' > ${OUTPUT}/diff.txt
for item in ${WHITELIST}; do
sstate-sysroot-cruft.sh: Improve to use it from CI * strip tmpdir prefix, so that we have shorter paths which aren't builder specific * use '#' for regexp delimiter so that we don't need to prefix forward slashes in paths * extend default whitelist to cover typical cases * add parameter for external whitelist file * use number of found paths as return code, so that CI can easily report error when new untracked files are found * use .txt suffix for all output files, so that they can be easily viewed in browser * add populate_sysroot task, because somewhere between dora and daisy the populate-sysroot files in sstate-control were renamed to have underscore instead of dash * only few entries not covered by this default whitelist were found in world build (but I'll leave these for people to whitelist, because they are not generated in most builds) * [^/]*/home/builder home directory from meta/recipes-graphics/builder/builder_0.1.bb * [^/]*/usr/src/kernel/patches * [^/]*/usr/lib/gdk-pixbuf-2.0/.*/loaders.cache 3 places are using this, not sure which one creates it meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.30.8.bb: GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache meta/recipes-gnome/gtk+/gtk-update-icon-cache-native_3.4.4.bb: GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache scripts/postinst-intercepts/update_pixbuf_cache: >$GDK_PIXBUF_MODULEDIR/../loaders.cache && \ sed -i -e "s:$D::g" $GDK_PIXBUF_MODULEDIR/../loaders.cache (From OE-Core rev: b1bfec63949e16abe8c11c34530dfbfb176c04cd) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-10 18:41:53 +00:00
sed -i "\\#^${item}\$#d" ${OUTPUT}/diff.txt;
echo "${item}" >> ${OUTPUT}/used.whitelist.txt
done
sstate-sysroot-cruft.sh: Improve to use it from CI * strip tmpdir prefix, so that we have shorter paths which aren't builder specific * use '#' for regexp delimiter so that we don't need to prefix forward slashes in paths * extend default whitelist to cover typical cases * add parameter for external whitelist file * use number of found paths as return code, so that CI can easily report error when new untracked files are found * use .txt suffix for all output files, so that they can be easily viewed in browser * add populate_sysroot task, because somewhere between dora and daisy the populate-sysroot files in sstate-control were renamed to have underscore instead of dash * only few entries not covered by this default whitelist were found in world build (but I'll leave these for people to whitelist, because they are not generated in most builds) * [^/]*/home/builder home directory from meta/recipes-graphics/builder/builder_0.1.bb * [^/]*/usr/src/kernel/patches * [^/]*/usr/lib/gdk-pixbuf-2.0/.*/loaders.cache 3 places are using this, not sure which one creates it meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.30.8.bb: GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache meta/recipes-gnome/gtk+/gtk-update-icon-cache-native_3.4.4.bb: GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache scripts/postinst-intercepts/update_pixbuf_cache: >$GDK_PIXBUF_MODULEDIR/../loaders.cache && \ sed -i -e "s:$D::g" $GDK_PIXBUF_MODULEDIR/../loaders.cache (From OE-Core rev: b1bfec63949e16abe8c11c34530dfbfb176c04cd) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-10 18:41:53 +00:00
if [ -s "$fwhitelist" ] ; then
cat $fwhitelist >> ${OUTPUT}/used.whitelist.txt
cat $fwhitelist | grep -v '^#' | while read item; do
sed -i "\\#^${item}\$#d" ${OUTPUT}/diff.txt;
done
fi
# too many false positives for directories
# echo "Following files are installed in sysroot at least twice"
# cat ${OUTPUT}/duplicates
sstate-sysroot-cruft.sh: Improve to use it from CI * strip tmpdir prefix, so that we have shorter paths which aren't builder specific * use '#' for regexp delimiter so that we don't need to prefix forward slashes in paths * extend default whitelist to cover typical cases * add parameter for external whitelist file * use number of found paths as return code, so that CI can easily report error when new untracked files are found * use .txt suffix for all output files, so that they can be easily viewed in browser * add populate_sysroot task, because somewhere between dora and daisy the populate-sysroot files in sstate-control were renamed to have underscore instead of dash * only few entries not covered by this default whitelist were found in world build (but I'll leave these for people to whitelist, because they are not generated in most builds) * [^/]*/home/builder home directory from meta/recipes-graphics/builder/builder_0.1.bb * [^/]*/usr/src/kernel/patches * [^/]*/usr/lib/gdk-pixbuf-2.0/.*/loaders.cache 3 places are using this, not sure which one creates it meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.30.8.bb: GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache meta/recipes-gnome/gtk+/gtk-update-icon-cache-native_3.4.4.bb: GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache scripts/postinst-intercepts/update_pixbuf_cache: >$GDK_PIXBUF_MODULEDIR/../loaders.cache && \ sed -i -e "s:$D::g" $GDK_PIXBUF_MODULEDIR/../loaders.cache (From OE-Core rev: b1bfec63949e16abe8c11c34530dfbfb176c04cd) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-10 18:41:53 +00:00
RESULT=`cat ${OUTPUT}/diff.txt | wc -l`
if [ "${RESULT}" != "0" ] ; then
echo "ERROR: ${RESULT} issues were found."
echo "ERROR: Following files are installed in sysroot, but not tracked by sstate:"
cat ${OUTPUT}/diff.txt
else
echo "INFO: All files are tracked by sstate or were explicitly ignored by this script"
fi
echo "INFO: Output written in: ${OUTPUT}"
exit ${RESULT}