diff options
author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2021-11-23 16:23:43 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-11-26 17:01:08 +0000 |
commit | 2566563ad49dab8043f2b11892d37e0abe621667 (patch) | |
tree | 118813dbbbc0079cb9a3f31d5e4863a956bb36b7 /meta | |
parent | 13527d2409a63e538475858a24a0e5f26ed491f0 (diff) | |
download | poky-2566563ad49dab8043f2b11892d37e0abe621667.tar.gz |
kernel: introduce python3-dtschema-wrapper
The 5.16 kernel introduced mandatory schema checking on any dtb file
built through the kernel.
That funcionality is provided via python3-dt-schema.
The dependencies to enable that functionality is not small, and may
not always be desired (in particular on architectures that do not
support dtbs, or in development cycles). It may also be useful for
allowing a non-conformant dts to be compiled.
This commit introduces a set of wrapper scripts that when added
as a depenency to the kernel, can pass both the validation testing
and validation steps of a dts.
We use the wrapper by default, while more dts file are brought up
to spec and the dt-validation matures upstream.
To enable valiation, simply add 'dt-valiation' to the PACKAGECONFIG
variable and the full dt-schema package will be selected and
validation will occur.
(From OE-Core rev: a8525391f8a519426c92f0e28895f426bfcb3f84)
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
5 files changed, 78 insertions, 0 deletions
diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc index 550352e947..88a2272555 100644 --- a/meta/conf/distro/include/maintainers.inc +++ b/meta/conf/distro/include/maintainers.inc | |||
@@ -598,6 +598,7 @@ RECIPE_MAINTAINER:pn-python3-dbus = "Zang Ruochen <zangrc.fnst@fujitsu.com>" | |||
598 | RECIPE_MAINTAINER:pn-python3-dbusmock = "Oleksandr Kravchuk <open.source@oleksandr-kravchuk.com>" | 598 | RECIPE_MAINTAINER:pn-python3-dbusmock = "Oleksandr Kravchuk <open.source@oleksandr-kravchuk.com>" |
599 | RECIPE_MAINTAINER:pn-python3-docutils = "Oleksandr Kravchuk <open.source@oleksandr-kravchuk.com>" | 599 | RECIPE_MAINTAINER:pn-python3-docutils = "Oleksandr Kravchuk <open.source@oleksandr-kravchuk.com>" |
600 | RECIPE_MAINTAINER:pn-python3-dtschema = "Bruce Ashfield <bruce.ashfield@gmail.com>" | 600 | RECIPE_MAINTAINER:pn-python3-dtschema = "Bruce Ashfield <bruce.ashfield@gmail.com>" |
601 | RECIPE_MAINTAINER:pn-python3-dtschema-wrapper = "Bruce Ashfield <bruce.ashfield@gmail.com>" | ||
601 | RECIPE_MAINTAINER:pn-python3-pycryptodome = "Joshua Watt <JPEWhacker@gmail.com>" | 602 | RECIPE_MAINTAINER:pn-python3-pycryptodome = "Joshua Watt <JPEWhacker@gmail.com>" |
602 | RECIPE_MAINTAINER:pn-python3-pycryptodomex = "Joshua Watt <JPEWhacker@gmail.com>" | 603 | RECIPE_MAINTAINER:pn-python3-pycryptodomex = "Joshua Watt <JPEWhacker@gmail.com>" |
603 | RECIPE_MAINTAINER:pn-python3-pyrsistent = "Bruce Ashfield <bruce.ashfield@gmail.com>" | 604 | RECIPE_MAINTAINER:pn-python3-pyrsistent = "Bruce Ashfield <bruce.ashfield@gmail.com>" |
diff --git a/meta/recipes-kernel/dtc/python3-dtschema-wrapper/dt-doc-validate b/meta/recipes-kernel/dtc/python3-dtschema-wrapper/dt-doc-validate new file mode 100644 index 0000000000..2aa57851c7 --- /dev/null +++ b/meta/recipes-kernel/dtc/python3-dtschema-wrapper/dt-doc-validate | |||
@@ -0,0 +1,20 @@ | |||
1 | #!/bin/sh | ||
2 | # dt-doc-validate wrapper to allow kernel dt-validation to pass | ||
3 | # | ||
4 | # Copyright (C) 2021 Bruce Ashfield <bruce.ashfield@gmail.com> | ||
5 | # License: MIT (see COPYING.MIT at the root of the repository for terms) | ||
6 | |||
7 | for arg; do | ||
8 | case "$arg" in | ||
9 | --version) | ||
10 | echo "v2021.10" | ||
11 | ;; | ||
12 | esac | ||
13 | done | ||
14 | |||
15 | # TBD: left for future consideration | ||
16 | # exec dt-doc-validate.real "$@" | ||
17 | |||
18 | # we always succeed | ||
19 | exit 0 | ||
20 | |||
diff --git a/meta/recipes-kernel/dtc/python3-dtschema-wrapper/dt-mk-schema b/meta/recipes-kernel/dtc/python3-dtschema-wrapper/dt-mk-schema new file mode 100644 index 0000000000..24b89d8619 --- /dev/null +++ b/meta/recipes-kernel/dtc/python3-dtschema-wrapper/dt-mk-schema | |||
@@ -0,0 +1,20 @@ | |||
1 | #!/bin/sh | ||
2 | # dt-mk-schema wrapper to allow kernel dt-validation to pass | ||
3 | # | ||
4 | # Copyright (C) 2021 Bruce Ashfield <bruce.ashfield@gmail.com> | ||
5 | # License: MIT (see COPYING.MIT at the root of the repository for terms) | ||
6 | |||
7 | for arg; do | ||
8 | case "$arg" in | ||
9 | --version) | ||
10 | echo "v2021.10" | ||
11 | ;; | ||
12 | esac | ||
13 | done | ||
14 | |||
15 | # TBD: left for future consideration | ||
16 | # exec dt-mk-schema.real "$@" | ||
17 | |||
18 | # we always succeed | ||
19 | exit 0 | ||
20 | |||
diff --git a/meta/recipes-kernel/dtc/python3-dtschema-wrapper/dt-validate b/meta/recipes-kernel/dtc/python3-dtschema-wrapper/dt-validate new file mode 100644 index 0000000000..8a4710a7ed --- /dev/null +++ b/meta/recipes-kernel/dtc/python3-dtschema-wrapper/dt-validate | |||
@@ -0,0 +1,20 @@ | |||
1 | #!/bin/sh | ||
2 | # dt-validate wrapper to allow kernel dt-validation to pass | ||
3 | # | ||
4 | # Copyright (C) 2021 Bruce Ashfield <bruce.ashfield@gmail.com> | ||
5 | # License: MIT (see COPYING.MIT at the root of the repository for terms) | ||
6 | |||
7 | for arg; do | ||
8 | case "$arg" in | ||
9 | --version) | ||
10 | echo "v2021.10" | ||
11 | ;; | ||
12 | esac | ||
13 | done | ||
14 | |||
15 | # TBD: left for future consideration | ||
16 | # exec dt-validate.real "$@" | ||
17 | |||
18 | # we always succeed | ||
19 | exit 0 | ||
20 | |||
diff --git a/meta/recipes-kernel/dtc/python3-dtschema-wrapper_2021.10.bb b/meta/recipes-kernel/dtc/python3-dtschema-wrapper_2021.10.bb new file mode 100644 index 0000000000..c869274d09 --- /dev/null +++ b/meta/recipes-kernel/dtc/python3-dtschema-wrapper_2021.10.bb | |||
@@ -0,0 +1,17 @@ | |||
1 | DESCRIPTION = "Wrapper for tooling for devicetree validation using YAML and jsonschema" | ||
2 | HOMEPAGE = "https://yoctoproject.org" | ||
3 | LICENSE = "MIT" | ||
4 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | ||
5 | |||
6 | SRC_URI = "file://dt-doc-validate \ | ||
7 | file://dt-mk-schema \ | ||
8 | file://dt-validate" | ||
9 | |||
10 | do_install() { | ||
11 | install -d ${D}${bindir}/ | ||
12 | install -m 755 ${WORKDIR}/dt-doc-validate ${D}${bindir}/ | ||
13 | install -m 755 ${WORKDIR}/dt-mk-schema ${D}${bindir}/ | ||
14 | install -m 755 ${WORKDIR}/dt-validate ${D}${bindir}/ | ||
15 | } | ||
16 | |||
17 | BBCLASSEXTEND = "native nativesdk" | ||