[18/20] linux-yocto-dev: introduce dt-validation PACKAGECONFIG

Message ID b3ce9655ef17f09c39e374d234cd494580f92674.1637703810.git.bruce.ashfield@gmail.com
State Accepted, archived
Commit c12a91827e88230b4ec702a88534d4c51c1aabe3
Headers show
Series [01/20] linux-yocto/5.15: update to v5.15.2 | expand

Commit Message

Bruce Ashfield Nov. 23, 2021, 9:57 p.m. UTC
From: Bruce Ashfield <bruce.ashfield@gmail.com>

Add a PACKAGECONFIG to control which type of dt-validation
is installed (full, or wrapped).

This is currently in linux-yocto-dev, as 5.16 introduces
the functionality of required dt schema validation.

Other v5.16 providing recipes can use the base functionality
as they desire (with or without PACKAGECONFIG).

Over time, we can migrate the support the the core
kernel classes .. in particular when more providers are at
v5.16+

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
---
 meta/recipes-kernel/linux/linux-yocto-dev.bb | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Comments

Bruce Ashfield Nov. 24, 2021, 3:22 p.m. UTC | #1
On Tue, Nov 23, 2021 at 4:58 PM <bruce.ashfield@gmail.com> wrote:
>
> From: Bruce Ashfield <bruce.ashfield@gmail.com>
>
> Add a PACKAGECONFIG to control which type of dt-validation
> is installed (full, or wrapped).
>
> This is currently in linux-yocto-dev, as 5.16 introduces
> the functionality of required dt schema validation.
>
> Other v5.16 providing recipes can use the base functionality
> as they desire (with or without PACKAGECONFIG).
>
> Over time, we can migrate the support the the core
> kernel classes .. in particular when more providers are at
> v5.16+
>
> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
> ---
>  meta/recipes-kernel/linux/linux-yocto-dev.bb | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-kernel/linux/linux-yocto-dev.bb b/meta/recipes-kernel/linux/linux-yocto-dev.bb
> index ed94ab2517..858772ba41 100644
> --- a/meta/recipes-kernel/linux/linux-yocto-dev.bb
> +++ b/meta/recipes-kernel/linux/linux-yocto-dev.bb
> @@ -39,8 +39,14 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
>  DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}"
>  DEPENDS += "openssl-native util-linux-native"
>  DEPENDS += "gmp-native libmpc-native"
> -# yaml and dtschema are required for 5.16+ device tree validation
> -DEPENDS += "libyaml-native python3-dtschema-native"
> +
> +# yaml and dtschema are required for 5.16+ device tree validation, libyaml is checked
> +# via pkgconfig, so must always be present, but we can wrap the others to make them
> +# conditional
> +DEPENDS += "libyaml-native"
> +
> +PACKAGECONFIG ??= ""
> +DEPENDS += "${@bb.utils.contains('PACKAGECONFIG', 'dt-validation', 'python3-dtschema-native', 'python3-dtschema-wrapper-native', d)}"

In my recently updated master, I get the QA warning:

WARNING: linux-yocto-dev-5.16++gitAUTOINC+ac97e62b64_c425b06bc1-r0
do_configure: QA Issue: linux-yocto-dev: invalid PACKAGECONFIG:
dt-validation [invalid-packageconfig]

I can re-work this to use PACKAGECONFIG's rdepends for the full
validation case, and test and add the wrapper rdepends in the
no-validation case, alternatively, I could add a
"dt-validation-inhibit" PACKAGECONFIG, and put the rdepends on the
wrappers there.

I'm open to either, and will pick the first fow now :D

Bruce

>
>  COMPATIBLE_MACHINE = "(qemuarm|qemux86|qemuppc|qemumips|qemumips64|qemux86-64|qemuriscv64)"
>
> --
> 2.19.1
>

Patch

diff --git a/meta/recipes-kernel/linux/linux-yocto-dev.bb b/meta/recipes-kernel/linux/linux-yocto-dev.bb
index ed94ab2517..858772ba41 100644
--- a/meta/recipes-kernel/linux/linux-yocto-dev.bb
+++ b/meta/recipes-kernel/linux/linux-yocto-dev.bb
@@ -39,8 +39,14 @@  LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
 DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}"
 DEPENDS += "openssl-native util-linux-native"
 DEPENDS += "gmp-native libmpc-native"
-# yaml and dtschema are required for 5.16+ device tree validation
-DEPENDS += "libyaml-native python3-dtschema-native"
+
+# yaml and dtschema are required for 5.16+ device tree validation, libyaml is checked
+# via pkgconfig, so must always be present, but we can wrap the others to make them
+# conditional
+DEPENDS += "libyaml-native"
+
+PACKAGECONFIG ??= ""
+DEPENDS += "${@bb.utils.contains('PACKAGECONFIG', 'dt-validation', 'python3-dtschema-native', 'python3-dtschema-wrapper-native', d)}"
 
 COMPATIBLE_MACHINE = "(qemuarm|qemux86|qemuppc|qemumips|qemumips64|qemux86-64|qemuriscv64)"