phosphor-tiny: Reduce python.bb .py files
Only the .pyc files are needed from the python recipe.
There was some discussion of natively supporting this
in the python recipe within this bug:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=6434
But nothing ever came of it so for now bbappend a file
that removes the unneeded .py files during install.
This saves us 800KB of rofs space.
Testing: Verified the python apps still started without
issue in QEMU.
Resolves: openbmc/openbmc#3372
Change-Id: I0bd7a29217b540d4abd21a36ff0e42f92283c930
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/recipes-devtools/python/python_2.%.bbappend b/recipes-devtools/python/python_2.%.bbappend
index 6d0ff69..12e1955 100644
--- a/recipes-devtools/python/python_2.%.bbappend
+++ b/recipes-devtools/python/python_2.%.bbappend
@@ -12,3 +12,13 @@
${libdir}/python${PYTHON_MAJMIN}/lib-dynload/spwd.so \
${libdir}/python${PYTHON_MAJMIN}/lib-dynload/grp.so \
"
+# Remove all python .py files from python recipe. Only the .pyc
+# files are required. Only do this if the openbmc-phosphor-tiny
+# distro feature is enabled
+do_install_append_openbmc-phosphor-tiny() {
+ find ${D}${libdir}/python${PYTHON_MAJMIN} -name \*.py -exec rm {} \;
+ # This is a system configuration file generated during build time.
+ # It's used in the yocto packaging process so it is required to
+ # remain in the image.
+ cp ${WORKDIR}/recipe-sysroot-native/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py ${D}${libdir}/python${PYTHON_MAJMIN}/
+}