[oe-commits] [openembedded-core] 04/08: kernel-devsrc: remove python2 dependency
git at git.openembedded.org
git at git.openembedded.org
Wed Aug 28 21:00:56 UTC 2019
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository openembedded-core.
commit da3d1295caaa69b1be8a8faa26c4f76e4ca91944
Author: Bruce Ashfield <bruce.ashfield at gmail.com>
AuthorDate: Wed Aug 28 15:28:38 2019 -0400
kernel-devsrc: remove python2 dependency
Witht the approaching EOL of python2, the kernel packages need to
be updated to depend on python3.
The core kernel scripts are now python3 safe, making the RDEPENDS
change relatively simple.
but
There are some scripts that are captured in the devsrc files that
are not used, but reference /usr/bin/python. The python3 package
does not provide /usr/bin/python so any package managers with
automatic dependency detection will fail to assemble a rootfs due
to the missing intepreter.
We could drop the scripts from the source capture, but that
risks dropping something that we need in certain operations and
we'd miss when they are updated in tree to explicitly call python3
(since they won't be revisited often). Light testing shows that the
scripts do run with python3, so rather than removing them, we change
the interpreter once they are copied, and automatic dependency
detection won't cause us rootfs assembly issues.
Signed-off-by: Bruce Ashfield <bruce.ashfield at gmail.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
meta/recipes-kernel/linux/kernel-devsrc.bb | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb
index 3900489..e17c0ea 100644
--- a/meta/recipes-kernel/linux/kernel-devsrc.bb
+++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
@@ -240,6 +240,15 @@ do_install() {
# Copy .config to include/config/auto.conf so "make prepare" is unnecessary.
cp $kerneldir/build/.config $kerneldir/build/include/config/auto.conf
+ # make the scripts python3 safe. We won't be running these, and if they are
+ # left as /usr/bin/python rootfs assembly will fail, since we only have python3
+ # in the RDEPENDS (and the python3 package does not include /usr/bin/python)
+ for ss in $(find $kerneldir/build/scripts -type f -name '*'); do
+ sed -i 's,/usr/bin/python2,/usr/bin/env python3,' "$ss"
+ sed -i 's,/usr/bin/env python2,/usr/bin/env python3,' "$ss"
+ sed -i 's,/usr/bin/python,/usr/bin/env python3,' "$ss"
+ done
+
chown -R root:root ${D}
}
@@ -249,7 +258,7 @@ do_install[lockfiles] = "${TMPDIR}/kernel-scripts.lock"
FILES_${PN} = "${KERNEL_BUILD_ROOT} ${KERNEL_SRC_PATH}"
FILES_${PN}-dbg += "${KERNEL_BUILD_ROOT}*/build/scripts/*/.debug/*"
-RDEPENDS_${PN} = "bc python flex bison ${TCLIBC}-utils"
+RDEPENDS_${PN} = "bc python3 flex bison ${TCLIBC}-utils"
# 4.15+ needs these next two RDEPENDS
RDEPENDS_${PN} += "openssl-dev util-linux"
# and x86 needs a bit more for 4.15+
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list