Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edk2-test-parser integrated , dtschema and linux bindings upgraded #98

Merged
merged 2 commits into from
Sep 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 17 additions & 26 deletions IR/Yocto/build-scripts/get_source.sh
Original file line number Diff line number Diff line change
@@ -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`

Expand Down Expand Up @@ -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/.
Expand Down
1 change: 1 addition & 0 deletions IR/Yocto/meta-woden/conf/distro/woden.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Original file line number Diff line number Diff line change
@@ -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/*"
Original file line number Diff line number Diff line change
@@ -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"
8 changes: 8 additions & 0 deletions IR/Yocto/meta-woden/recipes-acs/install-files/files/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}/
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
1 change: 1 addition & 0 deletions IR/Yocto/meta-woden/recipes-images/images/woden-image.bb
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions common/config/buildroot_sbsa_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions common/config/common_config.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions common/config/sr_es_common_config.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 8 additions & 0 deletions common/ramdisk/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions common/scripts/build-buildroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
10 changes: 7 additions & 3 deletions common/scripts/build-linux-sbsa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -117,15 +118,18 @@ 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
}

build_sbsa_kernel_driver
build_sbsa_app
build_pmu_app
build_mte_test
pack_in_ramdisk

pack_in_ramdisk
47 changes: 22 additions & 25 deletions common/scripts/get_source.sh
Original file line number Diff line number Diff line change
@@ -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`

Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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
Expand Down