diff options
author | Andrew Geissler <geissonator@yahoo.com> | 2020-04-15 18:26:16 +0300 |
---|---|---|
committer | Andrew Geissler <geissonator@yahoo.com> | 2020-04-23 21:36:15 +0300 |
commit | a5f677422b224441f9ef8ac4e2bbf1e209c8f85c (patch) | |
tree | 9feec025ba748968d97d23c921110aad4a41286b /meta-phosphor | |
parent | b2808374702ec7cf5902258f27a055b4e3411039 (diff) | |
download | openbmc-a5f677422b224441f9ef8ac4e2bbf1e209c8f85c.tar.xz |
dunfell: remove .py files from rootfs
Only the .pyc files are needed so save some space in the image by
removing the .py files.
With the move to python3, machines that bring python into their image no
longer build due to the squashfs being too large. This fixes that issue.
A similar function as this used to be under the tiny-distro feature but
it just needs to be mandatory now until someone feels like they need
the .py files in the image.
(From meta-phosphor rev: f846a8387abdb409c3d1b6bb66746d5d7b859bd3)
Change-Id: I8a4de733e30e38ee90f9aa8eb2d7cb10204fcad2
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Diffstat (limited to 'meta-phosphor')
-rw-r--r-- | meta-phosphor/recipes-devtools/python/python3_%.bbappend | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/meta-phosphor/recipes-devtools/python/python3_%.bbappend b/meta-phosphor/recipes-devtools/python/python3_%.bbappend index 5d5e38a7b..69f4e9ab0 100644 --- a/meta-phosphor/recipes-devtools/python/python3_%.bbappend +++ b/meta-phosphor/recipes-devtools/python/python3_%.bbappend @@ -4,8 +4,17 @@ ALTERNATIVE_${PN}-core += "python" ALTERNATIVE_LINK_NAME[python] = "${bindir}/python" ALTERNATIVE_TARGET[python] = "${bindir}/python3" -# Even though python3 is built with --without-ensurepip, it still installs -# a large, compressed version of pip. Remove it to free up the space. +# python3 takes up a lot of space that most embedded systems +# do not have, so remove some un-needed files from the rootfs do_install_append_class-target() { + # Even though python3 is built with --without-ensurepip, it still installs + # a large, compressed version of pip. Remove it to free up the space. rm -rf ${D}${libdir}/python${PYTHON_MAJMIN}/ensurepip + + # Remove all python .py files from python recipe. Only the .pyc + # files are required. + # The _sysconfigdata*.py files are system configuration files generated + # during build time. It's used in the yocto packaging process so + # it is required to remain in the image. + find ${D}${libdir}/python${PYTHON_MAJMIN} -name \*.py ! -name _sysconfigdata*.py -exec rm {} \; } |