From 93e94e57ecbd008b7897434318a7cc86b430a706 Mon Sep 17 00:00:00 2001 From: Peter Hoyes Date: Fri, 16 Sep 2022 10:03:17 +0100 Subject: [PATCH] zephyr-core/classes: Remove West-based logic from zephyr.bbclass For a given release tag, ZEPHYR_MODULES is constant. It is therefore now populated by the generate-version.py script, the output of which is stored in the repository, so the build-time logic to populate ZEPHYR_MODULES is no longer needed. Remove the do_get_zmods task, but retain the Python dependencies which are still required by Python scripts in the Zephyr repository that are trigerred by CMake. The above means that West is now only required as a host dependency to run generate-version.py, so remove the West Yocto recipe. Signed-off-by: Peter Hoyes Tested-by: Jon Mason Signed-off-by: Naveen Saini --- meta-zephyr-core/classes/zephyr.bbclass | 32 +------------------ .../recipes-devtools/west/west_0.12.99.bb | 22 ------------- 2 files changed, 1 insertion(+), 53 deletions(-) delete mode 100644 meta-zephyr-core/recipes-devtools/west/west_0.12.99.bb diff --git a/meta-zephyr-core/classes/zephyr.bbclass b/meta-zephyr-core/classes/zephyr.bbclass index 8030456..5b71bda 100644 --- a/meta-zephyr-core/classes/zephyr.bbclass +++ b/meta-zephyr-core/classes/zephyr.bbclass @@ -2,6 +2,7 @@ inherit terminal inherit python3native PYTHONPATH="${STAGING_DIR_HOST}${libdir}/${PYTHON_DIR}/site-packages" +DEPENDS += "python3-pyelftools-native python3-pyyaml-native python3-pykwalify-native" OE_TERMINAL_EXPORTS += "HOST_EXTRACFLAGS HOSTLDFLAGS TERMINFO CROSS_CURSES_LIB CROSS_CURSES_INC" HOST_EXTRACFLAGS = "${BUILD_CFLAGS} ${BUILD_LDFLAGS}" @@ -24,39 +25,8 @@ python () { d.setVar('BOARD',board) } -do_get_zmods() { - - export PYTHONPATH="${RECIPE_SYSROOT_NATIVE}/${libdir}/${PYTHON_DIR}/site-packages:${RECIPE_SYSROOT_NATIVE}/${libdir}/${PYTHON_DIR}" - cd ${S} - - # I really dislike how tied in this is to west, but without reimplementing their script, this seems to be the - # easiest way to do this - rm -rf .west; mkdir .west - cat << EOF >> ${S}/.west/config -[manifest] -path = zephyr -file = west.yml -EOF - - # Get all available modules and add them to ZEPHYR_MODULES - for i in $(west list|awk 'NR>1 {print $2}'); do - ZEPHYR_MODULES="${S}/$i\;${ZEPHYR_MODULES}" - done - export ZEPHYR_MODULES -} - -do_get_zmods[nostamp] = "1" -do_get_zmods[dirs] = "${B}" - EXTRA_OECMAKE:append = " -DZEPHYR_MODULES=${ZEPHYR_MODULES}" -addtask get_zmods after do_patch before do_configure -do_get_zmods[depends] += "west-native:do_populate_sysroot" -do_get_zmods[depends] += "python3-pyyaml-native:do_populate_sysroot" -do_get_zmods[depends] += "python3-pykwalify-native:do_populate_sysroot" -do_get_zmods[depends] += "python3-colorama-native:do_populate_sysroot" -do_get_zmods[depends] += "python3-pyelftools-native:do_populate_sysroot" - python do_menuconfig() { os.chdir(d.getVar('ZEPHYR_SRC_DIR', True)) configdir = d.getVar('ZEPHYR_SRC_DIR', True) + '/outdir/' + d.getVar('BOARD', True) diff --git a/meta-zephyr-core/recipes-devtools/west/west_0.12.99.bb b/meta-zephyr-core/recipes-devtools/west/west_0.12.99.bb deleted file mode 100644 index 6a9f8bc..0000000 --- a/meta-zephyr-core/recipes-devtools/west/west_0.12.99.bb +++ /dev/null @@ -1,22 +0,0 @@ -# SPDX-FileCopyrightText: Huawei Inc. -# SPDX-License-Identifier: Apache-2.0 - -SUMMARY = "Zephyr RTOS Project meta-tool" -HOMEPAGE = "https://github.com/zephyrproject-rtos/west" -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" - -SRC_URI = "git://github.com/zephyrproject-rtos/west;protocol=https;branch=main" - -PV = "0.12.99" -SRCREV = "38e656b05ea8f4c8d80b953f6d88b1ed604d11f8" -PROVIDES = "virtual/west" - -S = "${WORKDIR}/git" - -inherit setuptools3 python3native - -DEPENDS_${PN} += "python3-pyyaml python3-core python3-packaging python3-colorama python3-pyparsing" -RDEPENDS_${PN} += "python3-pyyaml python3-core python3-packaging python3-colorama python3-pyparsing" -BBCLASSEXTEND = "native nativesdk" -TOOLCHAIN_HOST_TASK:append = " nativesdk-west"