From: Martin Jansa <martin.jansa@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCHv2] scripts/sstate-sysroot-cruft.sh: add simple script to find files in sysroots not tracked by sstate
Date: Wed, 24 Oct 2012 10:10:58 +0200 [thread overview]
Message-ID: <1351066258-19437-1-git-send-email-Martin.Jansa@gmail.com> (raw)
In-Reply-To: <1351032689-20431-1-git-send-email-Martin.Jansa@gmail.com>
* it's not very universal, but works with default oe-core setup and
shows basic HOW-TO. It can be improved later.
* eglibc-initial should be fixed, but for now better to add that
work around then to show a lot of false positives
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
V2: added .pyo to WHITELIST
shorter filenames
TMPDIR
added duplicates but not shown
scripts/sstate-sysroot-cruft.sh | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
create mode 100755 scripts/sstate-sysroot-cruft.sh
diff --git a/scripts/sstate-sysroot-cruft.sh b/scripts/sstate-sysroot-cruft.sh
new file mode 100755
index 0000000..7bfb8f4
--- /dev/null
+++ b/scripts/sstate-sysroot-cruft.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+# Used to find files installed in sysroot which are not tracked by sstate manifest
+# Update BASE
+
+BASE="/OE/oe-core"
+TMPDIR="${BASE}/tmp-eglibc"
+
+OUTPUT=${BASE}/sysroot.cruft.`date "+%s"`
+WHITELIST="\/var\/pseudo\/*[^\/]*$ \/shlibs$ \.pyc$ \.pyo$"
+
+mkdir ${OUTPUT}
+find ${TMPDIR}/sstate-control -name \*populate-sysroot -o -name \*package | xargs cat | grep sysroots | \
+ sed 's#tcbootstrapusr#tcbootstrap/usr#g; s#/$##g; s#///*#/#g' | \
+ # work around for missing / in manifest for eglibc-initial, paths ending with / for directories and multiplied // (e.g. paths to native sysroot)
+ sort > ${OUTPUT}/master.list.all
+sort -u ${OUTPUT}/master.list.all > ${OUTPUT}/master.list # -u because some directories are listed for more recipes
+find ${TMPDIR}/sysroots/ | \
+ sort > ${OUTPUT}/sysroot.list
+
+diff ${OUTPUT}/master.list.all ${OUTPUT}/master.list > ${OUTPUT}/duplicates
+diff ${OUTPUT}/master.list ${OUTPUT}/sysroot.list > ${OUTPUT}/diff.all
+
+cp ${OUTPUT}/diff.all ${OUTPUT}/diff
+for item in ${WHITELIST}; do
+ sed -i "/${item}/d" ${OUTPUT}/diff;
+done
+
+# too many false positives for directories
+# echo "Following files are installed in sysroot at least twice"
+# cat ${OUTPUT}/duplicates
+
+echo "Following files are installed in sysroot, but not tracked by sstate"
+cat ${OUTPUT}/diff
--
1.7.12.4
next prev parent reply other threads:[~2012-10-24 8:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-23 22:51 [PATCH] scripts/sstate-sysroot-cruft.sh: add simple script to find files in sysroots not tracked by sstate Martin Jansa
2012-10-24 8:10 ` Martin Jansa [this message]
2012-10-24 11:15 ` [PATCHv3] " Martin Jansa
2012-11-15 7:30 ` [PATCHv4] " Martin Jansa
2012-11-15 15:25 ` Chris Larson
2012-11-15 16:19 ` Martin Jansa
2012-11-15 16:27 ` Chris Larson
2012-11-15 17:09 ` Martin Jansa
2012-11-15 16:49 ` Paul Eggleton
2012-11-15 17:03 ` Martin Jansa
2012-11-15 16:34 ` [PATCHv5] " Martin Jansa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1351066258-19437-1-git-send-email-Martin.Jansa@gmail.com \
--to=martin.jansa@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox