0

I'm trying to get the list of inherited classes and, eventually, I will use it to determine whether to deploy some files or not.

The below one only returns the ones that were inherited via INHERIT variable.

bitbake-getvar -r my-recipe INHERIT

How can I get the list of classes inherited via inherit directive?


  • BitBake Build Tool Core version 1.52.0
  • Yocto v3.4.1 Honister

2 Answers 2

0

I couldn't get the exact list but I figured out how to check if a certain class was inherited or not using the syntax below.

do_install:append() {
    if [ "${@oe.utils.inherits(d, 'systemd')}" = "True" ]; then
        # Class inherited
    else
        # Class not inherited
    fi
}

See core/meta/lib/oe/utils.py for the implementation of inherits(..) method

def inherits(d, *classes):
    """Return True if the metadata inherits any of the specified classes"""
    return any(bb.data.inherits_class(cls, d) for cls in classes)
Sign up to request clarification or add additional context in comments.

Comments

0

There is a BBINCLUDED variable you can look at which will show all the files included by a given recipe and that will include classes.

1 Comment

I checked it via bitbake-getvar -r my-recipe BBINCLUDED. The output is too long to parse as it includes multiple entries for the same inherited class, .conf and .inc files. Anyway, thanks for the answer. You may want to consider implementing a simpler approach to achieve this in future releases.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.