From 8999dcbafa3d1cb5349e95caf33485e8d7baf57a Mon Sep 17 00:00:00 2001 From: Khang Nguyen Date: Mon, 4 May 2020 18:07:55 +0900 Subject: rcar-gen3: Switch to python3 This updates recipes to use Python3 instead of Python2 which is deprecated in Yocto. Signed-off-by: Khang Nguyen Signed-off-by: Takamitsu Honda Change-Id: Id2594e5bb0e0003b22af8d183bef340587a9c1aa --- .../recipes-bsp/optee/optee-client_git.bb | 2 +- ...001-scripts-update-scripts-to-use-python3.patch | 427 +++++++++++++++++++++ meta-rcar-gen3/recipes-bsp/optee/optee-os_git.bb | 5 +- meta-rcar-gen3/recipes-bsp/u-boot/u-boot.inc | 2 +- 4 files changed, 432 insertions(+), 4 deletions(-) create mode 100644 meta-rcar-gen3/recipes-bsp/optee/optee-os/0001-scripts-update-scripts-to-use-python3.patch diff --git a/meta-rcar-gen3/recipes-bsp/optee/optee-client_git.bb b/meta-rcar-gen3/recipes-bsp/optee/optee-client_git.bb index 0a484e4..0319f21 100644 --- a/meta-rcar-gen3/recipes-bsp/optee/optee-client_git.bb +++ b/meta-rcar-gen3/recipes-bsp/optee/optee-client_git.bb @@ -14,7 +14,7 @@ SRC_URI += " \ file://0001-Fix-for-teec_trace.c-snprintf-Werror-format-truncati.patch \ " -inherit pythonnative systemd +inherit python3native systemd SYSTEMD_SERVICE_${PN} = "optee.service" COMPATIBLE_MACHINE = "salvator-x|h3ulcb|m3ulcb|m3nulcb|ebisu" diff --git a/meta-rcar-gen3/recipes-bsp/optee/optee-os/0001-scripts-update-scripts-to-use-python3.patch b/meta-rcar-gen3/recipes-bsp/optee/optee-os/0001-scripts-update-scripts-to-use-python3.patch new file mode 100644 index 0000000..9621cf6 --- /dev/null +++ b/meta-rcar-gen3/recipes-bsp/optee/optee-os/0001-scripts-update-scripts-to-use-python3.patch @@ -0,0 +1,427 @@ +From 0d4941123b5a88351f5954f6de00892f85ed5abc Mon Sep 17 00:00:00 2001 +From: Andrey Zhizhikin +Date: Mon, 20 Jan 2020 22:32:13 +0000 +Subject: [PATCH] scripts: update scripts to use python3 + +Python2 is deprecated effective Jan. 2020, and is not available in +several distributions. + +Update scripts here to re-target then onto python version 3. + +Upstream-Status: Pending + +Signed-off-by: Andrey Zhizhikin +--- + scripts/gen_hashed_bin.py | 282 ++++++++++++++++++++------------------ + scripts/gen_ld_sects.py | 8 +- + scripts/pem_to_pub_c.py | 2 +- + scripts/sign.py | 2 +- + scripts/symbolize.py | 2 +- + scripts/ta_bin_to_c.py | 2 +- + scripts/tee_bin_parser.py | 2 +- + 7 files changed, 157 insertions(+), 143 deletions(-) + +diff --git a/scripts/gen_hashed_bin.py b/scripts/gen_hashed_bin.py +index 32350a47..a76a62cc 100755 +--- a/scripts/gen_hashed_bin.py ++++ b/scripts/gen_hashed_bin.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # SPDX-License-Identifier: BSD-2-Clause + # + # Copyright (c) 2014-2017, Linaro Limited +@@ -14,163 +14,177 @@ import hashlib + arch_id = {'arm32': 0, 'arm64': 1} + image_id = {'pager': 0, 'paged': 1} + ++ + def write_header_v1(outf, init_size, args, paged_size): +- magic = 0x4554504f # 'OPTE' +- version = 1; +- outf.write(struct.pack(' [...]".format( \ +- sys.argv[0]) ++ print("Usage: {0}
[...]".format( \ ++ sys.argv[0])) + sys.exit (1) + + def main(): +@@ -55,7 +55,7 @@ def main(): + if sect_name in skip_sections : + continue + +- print '\t*({0})'.format(sect_name) ++ print ('\t*({0})'.format(sect_name)) + + if __name__ == "__main__": + main() +diff --git a/scripts/pem_to_pub_c.py b/scripts/pem_to_pub_c.py +index 6b8fa365..0b03d62e 100755 +--- a/scripts/pem_to_pub_c.py ++++ b/scripts/pem_to_pub_c.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # SPDX-License-Identifier: BSD-2-Clause + # + # Copyright (c) 2015, Linaro Limited +diff --git a/scripts/sign.py b/scripts/sign.py +index ad47479b..348b40a2 100755 +--- a/scripts/sign.py ++++ b/scripts/sign.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # + # Copyright (c) 2015, 2017, Linaro Limited + # +diff --git a/scripts/symbolize.py b/scripts/symbolize.py +index 1eecf758..0e9bd3ed 100755 +--- a/scripts/symbolize.py ++++ b/scripts/symbolize.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # SPDX-License-Identifier: BSD-2-Clause + # + # Copyright (c) 2017, Linaro Limited +diff --git a/scripts/ta_bin_to_c.py b/scripts/ta_bin_to_c.py +index cabddbbd..f325fda0 100755 +--- a/scripts/ta_bin_to_c.py ++++ b/scripts/ta_bin_to_c.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # SPDX-License-Identifier: BSD-2-Clause + # + # Copyright (c) 2017, Linaro Limited +diff --git a/scripts/tee_bin_parser.py b/scripts/tee_bin_parser.py +index 5f7dd3f0..07da5791 100755 +--- a/scripts/tee_bin_parser.py ++++ b/scripts/tee_bin_parser.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # SPDX-License-Identifier: BSD-2-Clause + # + # Copyright (c) 2016, Linaro Limited +-- +2.17.1 + diff --git a/meta-rcar-gen3/recipes-bsp/optee/optee-os_git.bb b/meta-rcar-gen3/recipes-bsp/optee/optee-os_git.bb index 553174b..90fc18f 100644 --- a/meta-rcar-gen3/recipes-bsp/optee/optee-os_git.bb +++ b/meta-rcar-gen3/recipes-bsp/optee/optee-os_git.bb @@ -8,7 +8,7 @@ LIC_FILES_CHKSUM = " \ PACKAGE_ARCH = "${MACHINE_ARCH}" -inherit deploy pythonnative +inherit deploy python3native PV = "3.1.0+renesas+git${SRCPV}" @@ -24,12 +24,13 @@ SRC_URI = " \ SRC_URI_append = " \ file://0001-core-define-syscall_t-as-void-void.patch \ + file://0001-scripts-update-scripts-to-use-python3.patch \ " COMPATIBLE_MACHINE = "(salvator-x|h3ulcb|m3ulcb|m3nulcb|ebisu)" PLATFORM = "rcar" -DEPENDS = "python-pycrypto-native" +DEPENDS = "python3-pycrypto-native" export CROSS_COMPILE64="${TARGET_PREFIX}" diff --git a/meta-rcar-gen3/recipes-bsp/u-boot/u-boot.inc b/meta-rcar-gen3/recipes-bsp/u-boot/u-boot.inc index 48fbc57..f009d18 100644 --- a/meta-rcar-gen3/recipes-bsp/u-boot/u-boot.inc +++ b/meta-rcar-gen3/recipes-bsp/u-boot/u-boot.inc @@ -7,7 +7,7 @@ PACKAGE_ARCH = "${MACHINE_ARCH}" inherit uboot-config uboot-extlinux-config uboot-sign deploy -DEPENDS += "swig-native python-native" +DEPENDS += "swig-native python3-native" EXTRA_OEMAKE = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}" V=1' EXTRA_OEMAKE += 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"' -- cgit 1.2.3-korg