From d3e603c2061e45fad8a5cbfa29b6fabbb322171e Mon Sep 17 00:00:00 2001 From: gurrev01 Date: Fri, 8 Sep 2023 16:28:35 +0530 Subject: [PATCH 1/2] edk2-test-parser integrated with IR,SR,ES ACS Signed-off-by: gurrev01 --- IR/Yocto/build-scripts/get_source.sh | 43 +++++++---------- .../edk2-test-parser/edk2-test-parser.bb | 18 +++++++ .../edk2-test-parser/python3-junit-xml_1.9.bb | 12 +++++ .../recipes-acs/install-files/files/init.sh | 8 ++++ .../recipes-images/images/woden-image.bb | 1 + common/config/buildroot_sbsa_defconfig | 4 ++ common/config/common_config.cfg | 3 ++ common/config/sr_es_common_config.cfg | 2 + common/ramdisk/init.sh | 8 ++++ common/scripts/build-buildroot.sh | 1 + common/scripts/build-linux-sbsa.sh | 10 ++-- common/scripts/get_source.sh | 47 +++++++++---------- 12 files changed, 103 insertions(+), 54 deletions(-) create mode 100644 IR/Yocto/meta-woden/recipes-acs/edk2-test-parser/edk2-test-parser.bb create mode 100644 IR/Yocto/meta-woden/recipes-acs/edk2-test-parser/python3-junit-xml_1.9.bb diff --git a/IR/Yocto/build-scripts/get_source.sh b/IR/Yocto/build-scripts/get_source.sh index 4ff3e01..d83a81d 100755 --- a/IR/Yocto/build-scripts/get_source.sh +++ b/IR/Yocto/build-scripts/get_source.sh @@ -1,32 +1,20 @@ #!/usr/bin/env bash +# @file +# Copyright (c) 2021-2023, Arm Limited or its affiliates. All rights reserved. +# SPDX-License-Identifier : Apache-2.0 -# Copyright (c) 2022-2023, ARM Limited and Contributors. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: +# http://www.apache.org/licenses/LICENSE-2.0 # -# Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# -# Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# -# Neither the name of ARM nor the names of its contributors may be used -# to endorse or promote products derived from this software without specific -# prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + set -x TOP_DIR=`pwd` @@ -119,7 +107,10 @@ copy_recipes() if [ ! -z "$ARM_LINUX_ACS_TAG" ]; then sed -i -E 's/SRCREV_linux-acs\s+=\s+"\$\{AUTOREV\}"/SRCREV_linux-acs = \"'${ARM_LINUX_ACS_TAG}'"/g' $TOP_DIR/meta-woden/recipes-acs/bsa-acs-drv/bsa-acs-drv.bb fi - + + if [ ! -z "$EDK2_TEST_PARSER_TAG" ]; then + sed -i -E 's/SRCREV_edk2-test-parser\s+=\s+"\$\{AUTOREV\}"/SRCREV_edk2-test-parser = \"'${EDK2_TEST_PARSER_TAG}'"/g' $TOP_DIR/meta-woden/recipes-acs/edk2-test-parser/edk2-test-parser.bb + fi # create a bsa-acs patches directory in meta-woden/recipes-acs/bsa-acs-uefi and copy requires BSA patches mkdir $TOP_DIR/meta-woden/recipes-acs/bsa-acs-uefi/bsa-acs cp $TOP_DIR/../patches/* $TOP_DIR/meta-woden/recipes-acs/bsa-acs-uefi/bsa-acs/. diff --git a/IR/Yocto/meta-woden/recipes-acs/edk2-test-parser/edk2-test-parser.bb b/IR/Yocto/meta-woden/recipes-acs/edk2-test-parser/edk2-test-parser.bb new file mode 100644 index 0000000..4c47cb6 --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-acs/edk2-test-parser/edk2-test-parser.bb @@ -0,0 +1,18 @@ +LICENSE = "BSD-2-Clause" +LIC_FILES_CHKSUM = "file://edk2-test-parser/LICENSE;md5=c0550be4b3b9c0223efd0eaa70dc9085" +S = "${WORKDIR}" + +SRC_URI = "git://git.gitlab.arm.com/systemready/edk2-test-parser.git;destsuffix=edk2-test-parser;protocol=https;branch=main;name=edk2-test-parser \ +" + +SRCREV_edk2-test-parser = "${AUTOREV}" + +RDEPENDS:${PN} += "bash python3-pyyaml python3-junit-xml python3-packaging" + +do_install(){ + install -d ${D}${bindir} + mkdir -p ${D}/${bindir}/edk2-test-parser + cp -r ${S}/edk2-test-parser/* ${D}/${bindir}/edk2-test-parser/ + +} +FILES:${PN} += "${bindir}/edk2-test-parser/*" \ No newline at end of file diff --git a/IR/Yocto/meta-woden/recipes-acs/edk2-test-parser/python3-junit-xml_1.9.bb b/IR/Yocto/meta-woden/recipes-acs/edk2-test-parser/python3-junit-xml_1.9.bb new file mode 100644 index 0000000..6062cf8 --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-acs/edk2-test-parser/python3-junit-xml_1.9.bb @@ -0,0 +1,12 @@ +DESCRIPTION = "Tooling for devicetree validation using YAML and jsonschema" +HOMEPAGE = "https://github.com/kyrus/python-junit-xml" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=0ec4326265b988497f17c3bf20d2898c" +inherit pypi setuptools3 +SRC_URI[sha256sum] = "de16a051990d4e25a3982b2dd9e89d671067548718866416faec14d9de56db9f" + +PYPI_PACKAGE = "junit-xml" + +DEPENDS += "python3-setuptools-scm-native" + +BBCLASSEXTEND = "native nativesdk" \ No newline at end of file diff --git a/IR/Yocto/meta-woden/recipes-acs/install-files/files/init.sh b/IR/Yocto/meta-woden/recipes-acs/install-files/files/init.sh index 8d29d8f..818d0f5 100644 --- a/IR/Yocto/meta-woden/recipes-acs/install-files/files/init.sh +++ b/IR/Yocto/meta-woden/recipes-acs/install-files/files/init.sh @@ -122,6 +122,14 @@ if [ $ADDITIONAL_CMD_OPTION != "noacs" ]; then else echo $'Error: The FDT devicetree file, fdt, does not exist at /sys/firmware/fdt. Cannot run dt-schema tool ' | tee /mnt/acs_results/linux_tools/dt-validate.log fi + if [ -d "/mnt/acs_results/sct_results" ]; then + echo "Running edk2-test-parser tool " + mkdir -p /mnt/acs_results/edk2-test-parser + cd /usr/bin/edk2-test-parser + ./parser.py --md /mnt/acs_results/edk2-test-parser/edk2-test-parser.log /mnt/acs_results/sct_results/Overall/Summary.ekl /mnt/acs_results/sct_results/Sequence/EBBR.seq + else + echo "SCT result does not exist, cannot run edk2-test-parser tool cannot run" + fi else echo "" echo "Additional option set to not run ACS Tests. Skipping ACS tests on Linux" diff --git a/IR/Yocto/meta-woden/recipes-images/images/woden-image.bb b/IR/Yocto/meta-woden/recipes-images/images/woden-image.bb index dcee9b8..0c360a9 100644 --- a/IR/Yocto/meta-woden/recipes-images/images/woden-image.bb +++ b/IR/Yocto/meta-woden/recipes-images/images/woden-image.bb @@ -145,6 +145,7 @@ IMAGE_INSTALL:append = "systemd-init-install \ util-linux \ lshw \ usbutils \ + edk2-test-parser \ " addtask dir_deploy before do_populate_lic_deploy after do_image_complete diff --git a/common/config/buildroot_sbsa_defconfig b/common/config/buildroot_sbsa_defconfig index d8ac238..a6693d4 100644 --- a/common/config/buildroot_sbsa_defconfig +++ b/common/config/buildroot_sbsa_defconfig @@ -7,3 +7,7 @@ BR2_TOOLCHAIN_BUILDROOT_GLIBC=y #Additional packages BR2_PACKAGE_PYTHON3=y +BR2_PACKAGE_PYTHON_PACKAGING=y +BR2_PACKAGE_PYTHON3_CURSES=y +BR2_PACKAGE_LIBXML2=y +BR2_PACKAGE_PYTHON_PYYAML=y diff --git a/common/config/common_config.cfg b/common/config/common_config.cfg index a21ffe7..c9a1dfd 100644 --- a/common/config/common_config.cfg +++ b/common/config/common_config.cfg @@ -78,3 +78,6 @@ BUILDROOT_SRC_TAG=2022.08.1 # export GCC toolchain path GCC=tools/gcc-linaro-${LINARO_TOOLS_VERSION}-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- + +#edk2-test-parser version +EDK2_TEST_PARSER_TAG=e8cdb692592d2a152cb87cf4d9fbd7ba2ae8b405 \ No newline at end of file diff --git a/common/config/sr_es_common_config.cfg b/common/config/sr_es_common_config.cfg index b1aea05..68bc9ca 100644 --- a/common/config/sr_es_common_config.cfg +++ b/common/config/sr_es_common_config.cfg @@ -69,3 +69,5 @@ CROSS_COMPILER_URL=https://developer.arm.com/-/media/Files/downloads/gnu-a/${GCC #Export Tool chain path GCC=tools/gcc-arm-${GCC_TOOLS_VERSION}-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu- +#edk2-test-parser version +EDK2_TEST_PARSER_TAG=v2023.04 diff --git a/common/ramdisk/init.sh b/common/ramdisk/init.sh index 2a184e2..65e671d 100644 --- a/common/ramdisk/init.sh +++ b/common/ramdisk/init.sh @@ -140,6 +140,14 @@ if [ $ADDITIONAL_CMD_OPTION != "noacs" ]; then fi fi fi + if [ -d "/mnt/acs_results/sct_results" ]; then + echo "Running edk2-test-parser tool " + mkdir -p /mnt/acs_results/edk2-test-parser + cd /usr/bin/edk2-test-parser + ./parser.py --md /mnt/acs_results/edk2-test-parser/edk2-test-parser.log /mnt/acs_results/sct_results/Overall/Summary.ekl /mnt/acs_results/sct_results/Sequence/BBSR.seq + else + echo "SCT result does not exist, cannot run edk2-test-parser tool cannot run" + fi else echo "" echo "Additional option set to not run ACS Tests. Skipping ACS tests on Linux" diff --git a/common/scripts/build-buildroot.sh b/common/scripts/build-buildroot.sh index f670231..7847b9a 100755 --- a/common/scripts/build-buildroot.sh +++ b/common/scripts/build-buildroot.sh @@ -72,6 +72,7 @@ do_build () mkdir -p root_fs_overlay/lib/modules mkdir -p root_fs_overlay/usr/bin + cp -r $TOP_DIR/edk2-test-parser root_fs_overlay/usr/bin/ cp $TOP_DIR/ramdisk/linux-bsa/bsa root_fs_overlay/bin/ cp $TOP_DIR/ramdisk/linux-bsa/bsa_acs.ko root_fs_overlay/lib/modules/ cp $TOP_DIR/ramdisk/drivers/* root_fs_overlay/lib/modules/ diff --git a/common/scripts/build-linux-sbsa.sh b/common/scripts/build-linux-sbsa.sh index c658039..038bab5 100755 --- a/common/scripts/build-linux-sbsa.sh +++ b/common/scripts/build-linux-sbsa.sh @@ -79,6 +79,7 @@ build_pmu_app() export CROSS_COMPILE=$TOP_DIR/$GCC fi export PYTHON=$TOP_DIR/${BUILDROOT_PATH}/$BUILDROOT_OUT_DIR/host/usr/bin/python + export PYTHONPATH=$TOP_DIR/${BUILDROOT_PATH}/$BUILDROOT_OUT_DIR/target/lib/python3.10/site-packages/ export CROSSBASE=$TOP_DIR/${BUILDROOT_PATH}/$BUILDROOT_OUT_DIR/target source build_pmu.sh popd @@ -117,9 +118,13 @@ pack_in_ramdisk() rm -rf $TOP_DIR/${BUILDROOT_PATH}/$BUILDROOT_OUT_DIR/target/lib/python3.10/site-packages/pysweep.so rm -rf $TOP_DIR/${BUILDROOT_PATH}/$BUILDROOT_OUT_DIR/target/lib/python3.10/site-packages/pyperf/perf_events.so + cp -r $TOP_DIR/${BUILDROOT_PATH}/$BUILDROOT_OUT_DIR/target/lib/python3.10/site-packages/PyPerf-0.0.0-py3.10-linux-x86_64.egg/pyperf \ + $TOP_DIR/${BUILDROOT_PATH}/$BUILDROOT_OUT_DIR/target/lib/python3.10/site-packages/ + cp $TOP_DIR/${BUILDROOT_PATH}/$BUILDROOT_OUT_DIR/target/lib/python3.10/site-packages/PySweep-0.0.0-py3.10-linux-x86_64.egg/pysweep.cpython-310-x86_64-linux-gnu.so \ + $TOP_DIR/${BUILDROOT_PATH}/$BUILDROOT_OUT_DIR/target/lib/python3.10/site-packages/ cp $TOP_DIR/${BUILDROOT_PATH}/$BUILDROOT_OUT_DIR/target/lib/python3.10/site-packages/pysweep.* \ $TOP_DIR/${BUILDROOT_PATH}/$BUILDROOT_OUT_DIR/target/lib/python3.10/site-packages/pysweep.so - cp $TOP_DIR/${BUILDROOT_PATH}/$BUILDROOT_OUT_DIR/target/lib/python3.10/site-packages/pyperf/perf_events.* \ + cp $TOP_DIR/${BUILDROOT_PATH}/$BUILDROOT_OUT_DIR/target/lib/python3.10/site-packages/pyperf/perf_events.cpython-310-x86_64-linux-gnu.so \ $TOP_DIR/${BUILDROOT_PATH}/$BUILDROOT_OUT_DIR/target/lib/python3.10/site-packages/pyperf/perf_events.so } @@ -127,5 +132,4 @@ build_sbsa_kernel_driver build_sbsa_app build_pmu_app build_mte_test -pack_in_ramdisk - +pack_in_ramdisk \ No newline at end of file diff --git a/common/scripts/get_source.sh b/common/scripts/get_source.sh index 7ab0ce8..7e46f26 100755 --- a/common/scripts/get_source.sh +++ b/common/scripts/get_source.sh @@ -1,32 +1,19 @@ #!/usr/bin/env bash +# @file +# Copyright (c) 2021-2023, Arm Limited or its affiliates. All rights reserved. +# SPDX-License-Identifier : Apache-2.0 -# Copyright (c) 2021-2023, ARM Limited and Contributors. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: +# http://www.apache.org/licenses/LICENSE-2.0 # -# Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# -# Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# -# Neither the name of ARM nor the names of its contributors may be used -# to endorse or promote products derived from this software without specific -# prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. TOP_DIR=`pwd` @@ -253,6 +240,15 @@ get_efitools_src() fi } +get_edk2-test-parser_src() +{ + echo "Downloading edk2-test-parser source code. TAG : $EDK2_TEST_PARSER_TAG" + git clone https://git.gitlab.arm.com/systemready/edk2-test-parser.git + pushd $TOP_DIR/edk2-test-parser/ + git checkout $EDK2_TEST_PARSER_TAG + popd +} + source /etc/lsb-release sudo apt install git curl mtools gdisk gcc \ @@ -287,6 +283,7 @@ fi if [ $BAND == "SR" ] || [ $BAND == "ES" ]; then get_buildroot_src get_cross_compiler2 + get_edk2-test-parser_src else get_busybox_src get_fwts_src From fa8dae82eae12537c26cc53b15f453a8b46f87d4 Mon Sep 17 00:00:00 2001 From: gurrev01 Date: Fri, 8 Sep 2023 16:42:50 +0530 Subject: [PATCH 2/2] dtschema upgraded to 2023.7, Linux kernel bindings upgraded to v6.5 Signed-off-by: gurrev01 --- IR/Yocto/meta-woden/conf/distro/woden.conf | 1 + .../recipes-acs/process-schema/process-schema.bb | 6 +++--- .../python3-dtschema/python3-dtschema_2023.7.bb | 15 +++++++++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 IR/Yocto/meta-woden/recipes-acs/python3-dtschema/python3-dtschema_2023.7.bb diff --git a/IR/Yocto/meta-woden/conf/distro/woden.conf b/IR/Yocto/meta-woden/conf/distro/woden.conf index 1145d36..2637661 100644 --- a/IR/Yocto/meta-woden/conf/distro/woden.conf +++ b/IR/Yocto/meta-woden/conf/distro/woden.conf @@ -36,3 +36,4 @@ EFI_PROVIDER = "grub-efi" TCLIBCAPPEND = "" PREFERRED_VERSION_linux-yocto = "6.4%" PREFERRED_VERSION_fwts = "23.07.00" +PREFERRED_VERSION_python3-dtschema = "2023.7" \ No newline at end of file diff --git a/IR/Yocto/meta-woden/recipes-acs/process-schema/process-schema.bb b/IR/Yocto/meta-woden/recipes-acs/process-schema/process-schema.bb index 6e83fad..bd7855a 100644 --- a/IR/Yocto/meta-woden/recipes-acs/process-schema/process-schema.bb +++ b/IR/Yocto/meta-woden/recipes-acs/process-schema/process-schema.bb @@ -4,12 +4,12 @@ S = "${WORKDIR}" DEPENDS = "python3-native python3-dtschema-native python3-pylibfdt-native" -SRC_URI = "https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.1.2.tar.xz" -SRC_URI[sha256sum] = "ee41f3c4f599b2f46f08aae428c9243db403e7292eb2c9f04ee34909b038d1ae" +SRC_URI = "https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.5.tar.xz" +SRC_URI[sha256sum] = "7a574bbc20802ea76b52ca7faf07267f72045e861b18915c5272a98c27abf884" do_install(){ install -d ${D}${bindir} - cp -r ${S}/linux-6.1.2/Documentation/devicetree/bindings ${D}/${bindir}/ + cp -r ${S}/linux-6.5/Documentation/devicetree/bindings ${D}/${bindir}/ dt-mk-schema -j ${D}/${bindir}/bindings > processed_schema.json cp -r ${S}/processed_schema.json ${D}/${bindir}/ } diff --git a/IR/Yocto/meta-woden/recipes-acs/python3-dtschema/python3-dtschema_2023.7.bb b/IR/Yocto/meta-woden/recipes-acs/python3-dtschema/python3-dtschema_2023.7.bb new file mode 100644 index 0000000..dc3e846 --- /dev/null +++ b/IR/Yocto/meta-woden/recipes-acs/python3-dtschema/python3-dtschema_2023.7.bb @@ -0,0 +1,15 @@ +DESCRIPTION = "Tooling for devicetree validation using YAML and jsonschema" +HOMEPAGE = "https://github.com/devicetree-org/dt-schema" +LICENSE = "BSD-2-Clause" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=457495c8fa03540db4a576bf7869e811" + +inherit pypi setuptools3 + +SRC_URI[sha256sum] = "de7cd73a35244cf76a8cdd9919bbeb31f362aa5744f3c76c80e0e612489dd0c0" + +PYPI_PACKAGE = "dtschema" + +DEPENDS += "python3-setuptools-scm-native" +RDEPENDS:${PN} += "python3-ruamel-yaml python3-jsonschema python3-rfc3987 python3-pylibfdt" + +BBCLASSEXTEND = "native nativesdk" \ No newline at end of file