diff options
author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2019-08-28 15:28:38 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-08-30 17:10:28 +0100 |
commit | 4c62122ecbf20f8f4057446aa74d2c7d089180d6 (patch) | |
tree | a3a75bc477d43348a9a678c5f12130411de848aa /meta | |
parent | c5a7f3eac647049d07c31d4533d4ffb158f93088 (diff) | |
download | poky-4c62122ecbf20f8f4057446aa74d2c7d089180d6.tar.gz |
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.
(From OE-Core rev: 6745088b6c9e5c70df59d667347ede470df9a91d)
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-kernel/linux/kernel-devsrc.bb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb index 3900489ac5..e17c0ea0ab 100644 --- a/meta/recipes-kernel/linux/kernel-devsrc.bb +++ b/meta/recipes-kernel/linux/kernel-devsrc.bb | |||
@@ -240,6 +240,15 @@ do_install() { | |||
240 | # Copy .config to include/config/auto.conf so "make prepare" is unnecessary. | 240 | # Copy .config to include/config/auto.conf so "make prepare" is unnecessary. |
241 | cp $kerneldir/build/.config $kerneldir/build/include/config/auto.conf | 241 | cp $kerneldir/build/.config $kerneldir/build/include/config/auto.conf |
242 | 242 | ||
243 | # make the scripts python3 safe. We won't be running these, and if they are | ||
244 | # left as /usr/bin/python rootfs assembly will fail, since we only have python3 | ||
245 | # in the RDEPENDS (and the python3 package does not include /usr/bin/python) | ||
246 | for ss in $(find $kerneldir/build/scripts -type f -name '*'); do | ||
247 | sed -i 's,/usr/bin/python2,/usr/bin/env python3,' "$ss" | ||
248 | sed -i 's,/usr/bin/env python2,/usr/bin/env python3,' "$ss" | ||
249 | sed -i 's,/usr/bin/python,/usr/bin/env python3,' "$ss" | ||
250 | done | ||
251 | |||
243 | chown -R root:root ${D} | 252 | chown -R root:root ${D} |
244 | } | 253 | } |
245 | 254 | ||
@@ -249,7 +258,7 @@ do_install[lockfiles] = "${TMPDIR}/kernel-scripts.lock" | |||
249 | FILES_${PN} = "${KERNEL_BUILD_ROOT} ${KERNEL_SRC_PATH}" | 258 | FILES_${PN} = "${KERNEL_BUILD_ROOT} ${KERNEL_SRC_PATH}" |
250 | FILES_${PN}-dbg += "${KERNEL_BUILD_ROOT}*/build/scripts/*/.debug/*" | 259 | FILES_${PN}-dbg += "${KERNEL_BUILD_ROOT}*/build/scripts/*/.debug/*" |
251 | 260 | ||
252 | RDEPENDS_${PN} = "bc python flex bison ${TCLIBC}-utils" | 261 | RDEPENDS_${PN} = "bc python3 flex bison ${TCLIBC}-utils" |
253 | # 4.15+ needs these next two RDEPENDS | 262 | # 4.15+ needs these next two RDEPENDS |
254 | RDEPENDS_${PN} += "openssl-dev util-linux" | 263 | RDEPENDS_${PN} += "openssl-dev util-linux" |
255 | # and x86 needs a bit more for 4.15+ | 264 | # and x86 needs a bit more for 4.15+ |