Yocto find the recipe or class that defines a task












0















I am a yocto noob, trying to decipher how the device tree is built from a Xilinx hardware definition (.hdf) file. But my question is more general.



Is there a yocto way to find the source of task?
Given a task name is it possible to find where the tasks source code lives? (presumably in a recipe or class)



As an example, where is the source for the Python task do_create_yaml which is called by recipes in the meta-xilinx-bsp layer that compile the device tree blob?



bitbake -e device-tree


Will dump the python source for do_create_yaml (amongst the rest of it prodigious output) but how can I find where that is coming from?










share|improve this question





























    0















    I am a yocto noob, trying to decipher how the device tree is built from a Xilinx hardware definition (.hdf) file. But my question is more general.



    Is there a yocto way to find the source of task?
    Given a task name is it possible to find where the tasks source code lives? (presumably in a recipe or class)



    As an example, where is the source for the Python task do_create_yaml which is called by recipes in the meta-xilinx-bsp layer that compile the device tree blob?



    bitbake -e device-tree


    Will dump the python source for do_create_yaml (amongst the rest of it prodigious output) but how can I find where that is coming from?










    share|improve this question



























      0












      0








      0








      I am a yocto noob, trying to decipher how the device tree is built from a Xilinx hardware definition (.hdf) file. But my question is more general.



      Is there a yocto way to find the source of task?
      Given a task name is it possible to find where the tasks source code lives? (presumably in a recipe or class)



      As an example, where is the source for the Python task do_create_yaml which is called by recipes in the meta-xilinx-bsp layer that compile the device tree blob?



      bitbake -e device-tree


      Will dump the python source for do_create_yaml (amongst the rest of it prodigious output) but how can I find where that is coming from?










      share|improve this question
















      I am a yocto noob, trying to decipher how the device tree is built from a Xilinx hardware definition (.hdf) file. But my question is more general.



      Is there a yocto way to find the source of task?
      Given a task name is it possible to find where the tasks source code lives? (presumably in a recipe or class)



      As an example, where is the source for the Python task do_create_yaml which is called by recipes in the meta-xilinx-bsp layer that compile the device tree blob?



      bitbake -e device-tree


      Will dump the python source for do_create_yaml (amongst the rest of it prodigious output) but how can I find where that is coming from?







      yocto xilinx device-tree






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 14 '18 at 20:18







      Codemonkey

















      asked Nov 13 '18 at 19:17









      CodemonkeyCodemonkey

      14




      14
























          2 Answers
          2






          active

          oldest

          votes


















          0














          Device tree is part of Linux Kernel. In Yocto, this is compiled from KERNEL_DEVICETREE variable value either defined as part of Linux Kernel recipe or machine configuration.



          For example, for cubieboard7 as defined here,



          KERNEL_DEVICETREE = "s700_cb7_linux.dtb"


          instructs the compilation to use this dts file for compilation. This is done by yocto by using various classes.



          In our example, we inherit kernel.bbclass which in turn inherits kernel-devicetree.bbclass, in this class (copied from kernel-devicetree.bbclass),



          do_compile_append() {
          for dtbf in ${KERNEL_DEVICETREE}; do
          dtb=`normalize_dtb "$dtbf"`
          oe_runmake $dtb
          done
          }

          do_install_append() {
          for dtbf in ${KERNEL_DEVICETREE}; do
          dtb=`normalize_dtb "$dtbf"`
          dtb_ext=${dtb##*.}
          dtb_base_name=`basename $dtb .$dtb_ext`
          dtb_path=`get_real_dtb_path_in_kernel "$dtb"`
          install -m 0644 $dtb_path ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext
          done
          }

          do_deploy_append() {
          for dtbf in ${KERNEL_DEVICETREE}; do
          dtb=`normalize_dtb "$dtbf"`


          this appends tasks to compile, install and deploy tasks. So defining KERNEL_DEVICETREE enables the automatic build of dtb.






          share|improve this answer
























          • Thanks for the response, I have changed the rewording of the question as it conflates the question with an example related to the device tree. My question is "Is there a way to find where a task is defined, where its source code lives?" BTW: For Xilinx SoCs the device-tree situation is complicated by the fact that devices can be implemented in the programmable logic (PL), the blob (.dtb) is compiled from a .dts constructed from .dtsi fragments one of which contains information from the hardware definition (.hdf) for the PL.

            – Codemonkey
            Nov 13 '18 at 21:35













          • @Codemonkey: So you want to know the location of do_compile, do_configure and similar tasks?

            – Parthiban
            Nov 14 '18 at 9:47











          • Yes, though I am more interested in the non OE default ones, the custom ones. The -e flag to bitbake gives you the environment for a recipe including the active task definitions, but no clue as to where the definition came from. I am wondering if there is a way to find that out.

            – Codemonkey
            Nov 14 '18 at 14:13





















          0














          I found that the datastore contains the filename for tasks as a VarFlag,
          from a devpyshell



          pydevshell> d.getVarFlags("do_create_yaml")


          gives



          {'filename': '.....yocto/sources/core/../meta-xilinx-tools/classes/xsctyaml.bbclass', 'lineno': '61', 'func': 1, 'task': 1, 'python': '1', 'deps':   ['do_prepare_recipe_sysroot']}


          So for the example in my question the active definition for the do_create_yaml task is in xsctyaml.bbclass.






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53288060%2fyocto-find-the-recipe-or-class-that-defines-a-task%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Device tree is part of Linux Kernel. In Yocto, this is compiled from KERNEL_DEVICETREE variable value either defined as part of Linux Kernel recipe or machine configuration.



            For example, for cubieboard7 as defined here,



            KERNEL_DEVICETREE = "s700_cb7_linux.dtb"


            instructs the compilation to use this dts file for compilation. This is done by yocto by using various classes.



            In our example, we inherit kernel.bbclass which in turn inherits kernel-devicetree.bbclass, in this class (copied from kernel-devicetree.bbclass),



            do_compile_append() {
            for dtbf in ${KERNEL_DEVICETREE}; do
            dtb=`normalize_dtb "$dtbf"`
            oe_runmake $dtb
            done
            }

            do_install_append() {
            for dtbf in ${KERNEL_DEVICETREE}; do
            dtb=`normalize_dtb "$dtbf"`
            dtb_ext=${dtb##*.}
            dtb_base_name=`basename $dtb .$dtb_ext`
            dtb_path=`get_real_dtb_path_in_kernel "$dtb"`
            install -m 0644 $dtb_path ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext
            done
            }

            do_deploy_append() {
            for dtbf in ${KERNEL_DEVICETREE}; do
            dtb=`normalize_dtb "$dtbf"`


            this appends tasks to compile, install and deploy tasks. So defining KERNEL_DEVICETREE enables the automatic build of dtb.






            share|improve this answer
























            • Thanks for the response, I have changed the rewording of the question as it conflates the question with an example related to the device tree. My question is "Is there a way to find where a task is defined, where its source code lives?" BTW: For Xilinx SoCs the device-tree situation is complicated by the fact that devices can be implemented in the programmable logic (PL), the blob (.dtb) is compiled from a .dts constructed from .dtsi fragments one of which contains information from the hardware definition (.hdf) for the PL.

              – Codemonkey
              Nov 13 '18 at 21:35













            • @Codemonkey: So you want to know the location of do_compile, do_configure and similar tasks?

              – Parthiban
              Nov 14 '18 at 9:47











            • Yes, though I am more interested in the non OE default ones, the custom ones. The -e flag to bitbake gives you the environment for a recipe including the active task definitions, but no clue as to where the definition came from. I am wondering if there is a way to find that out.

              – Codemonkey
              Nov 14 '18 at 14:13


















            0














            Device tree is part of Linux Kernel. In Yocto, this is compiled from KERNEL_DEVICETREE variable value either defined as part of Linux Kernel recipe or machine configuration.



            For example, for cubieboard7 as defined here,



            KERNEL_DEVICETREE = "s700_cb7_linux.dtb"


            instructs the compilation to use this dts file for compilation. This is done by yocto by using various classes.



            In our example, we inherit kernel.bbclass which in turn inherits kernel-devicetree.bbclass, in this class (copied from kernel-devicetree.bbclass),



            do_compile_append() {
            for dtbf in ${KERNEL_DEVICETREE}; do
            dtb=`normalize_dtb "$dtbf"`
            oe_runmake $dtb
            done
            }

            do_install_append() {
            for dtbf in ${KERNEL_DEVICETREE}; do
            dtb=`normalize_dtb "$dtbf"`
            dtb_ext=${dtb##*.}
            dtb_base_name=`basename $dtb .$dtb_ext`
            dtb_path=`get_real_dtb_path_in_kernel "$dtb"`
            install -m 0644 $dtb_path ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext
            done
            }

            do_deploy_append() {
            for dtbf in ${KERNEL_DEVICETREE}; do
            dtb=`normalize_dtb "$dtbf"`


            this appends tasks to compile, install and deploy tasks. So defining KERNEL_DEVICETREE enables the automatic build of dtb.






            share|improve this answer
























            • Thanks for the response, I have changed the rewording of the question as it conflates the question with an example related to the device tree. My question is "Is there a way to find where a task is defined, where its source code lives?" BTW: For Xilinx SoCs the device-tree situation is complicated by the fact that devices can be implemented in the programmable logic (PL), the blob (.dtb) is compiled from a .dts constructed from .dtsi fragments one of which contains information from the hardware definition (.hdf) for the PL.

              – Codemonkey
              Nov 13 '18 at 21:35













            • @Codemonkey: So you want to know the location of do_compile, do_configure and similar tasks?

              – Parthiban
              Nov 14 '18 at 9:47











            • Yes, though I am more interested in the non OE default ones, the custom ones. The -e flag to bitbake gives you the environment for a recipe including the active task definitions, but no clue as to where the definition came from. I am wondering if there is a way to find that out.

              – Codemonkey
              Nov 14 '18 at 14:13
















            0












            0








            0







            Device tree is part of Linux Kernel. In Yocto, this is compiled from KERNEL_DEVICETREE variable value either defined as part of Linux Kernel recipe or machine configuration.



            For example, for cubieboard7 as defined here,



            KERNEL_DEVICETREE = "s700_cb7_linux.dtb"


            instructs the compilation to use this dts file for compilation. This is done by yocto by using various classes.



            In our example, we inherit kernel.bbclass which in turn inherits kernel-devicetree.bbclass, in this class (copied from kernel-devicetree.bbclass),



            do_compile_append() {
            for dtbf in ${KERNEL_DEVICETREE}; do
            dtb=`normalize_dtb "$dtbf"`
            oe_runmake $dtb
            done
            }

            do_install_append() {
            for dtbf in ${KERNEL_DEVICETREE}; do
            dtb=`normalize_dtb "$dtbf"`
            dtb_ext=${dtb##*.}
            dtb_base_name=`basename $dtb .$dtb_ext`
            dtb_path=`get_real_dtb_path_in_kernel "$dtb"`
            install -m 0644 $dtb_path ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext
            done
            }

            do_deploy_append() {
            for dtbf in ${KERNEL_DEVICETREE}; do
            dtb=`normalize_dtb "$dtbf"`


            this appends tasks to compile, install and deploy tasks. So defining KERNEL_DEVICETREE enables the automatic build of dtb.






            share|improve this answer













            Device tree is part of Linux Kernel. In Yocto, this is compiled from KERNEL_DEVICETREE variable value either defined as part of Linux Kernel recipe or machine configuration.



            For example, for cubieboard7 as defined here,



            KERNEL_DEVICETREE = "s700_cb7_linux.dtb"


            instructs the compilation to use this dts file for compilation. This is done by yocto by using various classes.



            In our example, we inherit kernel.bbclass which in turn inherits kernel-devicetree.bbclass, in this class (copied from kernel-devicetree.bbclass),



            do_compile_append() {
            for dtbf in ${KERNEL_DEVICETREE}; do
            dtb=`normalize_dtb "$dtbf"`
            oe_runmake $dtb
            done
            }

            do_install_append() {
            for dtbf in ${KERNEL_DEVICETREE}; do
            dtb=`normalize_dtb "$dtbf"`
            dtb_ext=${dtb##*.}
            dtb_base_name=`basename $dtb .$dtb_ext`
            dtb_path=`get_real_dtb_path_in_kernel "$dtb"`
            install -m 0644 $dtb_path ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext
            done
            }

            do_deploy_append() {
            for dtbf in ${KERNEL_DEVICETREE}; do
            dtb=`normalize_dtb "$dtbf"`


            this appends tasks to compile, install and deploy tasks. So defining KERNEL_DEVICETREE enables the automatic build of dtb.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 13 '18 at 20:28









            ParthibanParthiban

            1,3442716




            1,3442716













            • Thanks for the response, I have changed the rewording of the question as it conflates the question with an example related to the device tree. My question is "Is there a way to find where a task is defined, where its source code lives?" BTW: For Xilinx SoCs the device-tree situation is complicated by the fact that devices can be implemented in the programmable logic (PL), the blob (.dtb) is compiled from a .dts constructed from .dtsi fragments one of which contains information from the hardware definition (.hdf) for the PL.

              – Codemonkey
              Nov 13 '18 at 21:35













            • @Codemonkey: So you want to know the location of do_compile, do_configure and similar tasks?

              – Parthiban
              Nov 14 '18 at 9:47











            • Yes, though I am more interested in the non OE default ones, the custom ones. The -e flag to bitbake gives you the environment for a recipe including the active task definitions, but no clue as to where the definition came from. I am wondering if there is a way to find that out.

              – Codemonkey
              Nov 14 '18 at 14:13





















            • Thanks for the response, I have changed the rewording of the question as it conflates the question with an example related to the device tree. My question is "Is there a way to find where a task is defined, where its source code lives?" BTW: For Xilinx SoCs the device-tree situation is complicated by the fact that devices can be implemented in the programmable logic (PL), the blob (.dtb) is compiled from a .dts constructed from .dtsi fragments one of which contains information from the hardware definition (.hdf) for the PL.

              – Codemonkey
              Nov 13 '18 at 21:35













            • @Codemonkey: So you want to know the location of do_compile, do_configure and similar tasks?

              – Parthiban
              Nov 14 '18 at 9:47











            • Yes, though I am more interested in the non OE default ones, the custom ones. The -e flag to bitbake gives you the environment for a recipe including the active task definitions, but no clue as to where the definition came from. I am wondering if there is a way to find that out.

              – Codemonkey
              Nov 14 '18 at 14:13



















            Thanks for the response, I have changed the rewording of the question as it conflates the question with an example related to the device tree. My question is "Is there a way to find where a task is defined, where its source code lives?" BTW: For Xilinx SoCs the device-tree situation is complicated by the fact that devices can be implemented in the programmable logic (PL), the blob (.dtb) is compiled from a .dts constructed from .dtsi fragments one of which contains information from the hardware definition (.hdf) for the PL.

            – Codemonkey
            Nov 13 '18 at 21:35







            Thanks for the response, I have changed the rewording of the question as it conflates the question with an example related to the device tree. My question is "Is there a way to find where a task is defined, where its source code lives?" BTW: For Xilinx SoCs the device-tree situation is complicated by the fact that devices can be implemented in the programmable logic (PL), the blob (.dtb) is compiled from a .dts constructed from .dtsi fragments one of which contains information from the hardware definition (.hdf) for the PL.

            – Codemonkey
            Nov 13 '18 at 21:35















            @Codemonkey: So you want to know the location of do_compile, do_configure and similar tasks?

            – Parthiban
            Nov 14 '18 at 9:47





            @Codemonkey: So you want to know the location of do_compile, do_configure and similar tasks?

            – Parthiban
            Nov 14 '18 at 9:47













            Yes, though I am more interested in the non OE default ones, the custom ones. The -e flag to bitbake gives you the environment for a recipe including the active task definitions, but no clue as to where the definition came from. I am wondering if there is a way to find that out.

            – Codemonkey
            Nov 14 '18 at 14:13







            Yes, though I am more interested in the non OE default ones, the custom ones. The -e flag to bitbake gives you the environment for a recipe including the active task definitions, but no clue as to where the definition came from. I am wondering if there is a way to find that out.

            – Codemonkey
            Nov 14 '18 at 14:13















            0














            I found that the datastore contains the filename for tasks as a VarFlag,
            from a devpyshell



            pydevshell> d.getVarFlags("do_create_yaml")


            gives



            {'filename': '.....yocto/sources/core/../meta-xilinx-tools/classes/xsctyaml.bbclass', 'lineno': '61', 'func': 1, 'task': 1, 'python': '1', 'deps':   ['do_prepare_recipe_sysroot']}


            So for the example in my question the active definition for the do_create_yaml task is in xsctyaml.bbclass.






            share|improve this answer




























              0














              I found that the datastore contains the filename for tasks as a VarFlag,
              from a devpyshell



              pydevshell> d.getVarFlags("do_create_yaml")


              gives



              {'filename': '.....yocto/sources/core/../meta-xilinx-tools/classes/xsctyaml.bbclass', 'lineno': '61', 'func': 1, 'task': 1, 'python': '1', 'deps':   ['do_prepare_recipe_sysroot']}


              So for the example in my question the active definition for the do_create_yaml task is in xsctyaml.bbclass.






              share|improve this answer


























                0












                0








                0







                I found that the datastore contains the filename for tasks as a VarFlag,
                from a devpyshell



                pydevshell> d.getVarFlags("do_create_yaml")


                gives



                {'filename': '.....yocto/sources/core/../meta-xilinx-tools/classes/xsctyaml.bbclass', 'lineno': '61', 'func': 1, 'task': 1, 'python': '1', 'deps':   ['do_prepare_recipe_sysroot']}


                So for the example in my question the active definition for the do_create_yaml task is in xsctyaml.bbclass.






                share|improve this answer













                I found that the datastore contains the filename for tasks as a VarFlag,
                from a devpyshell



                pydevshell> d.getVarFlags("do_create_yaml")


                gives



                {'filename': '.....yocto/sources/core/../meta-xilinx-tools/classes/xsctyaml.bbclass', 'lineno': '61', 'func': 1, 'task': 1, 'python': '1', 'deps':   ['do_prepare_recipe_sysroot']}


                So for the example in my question the active definition for the do_create_yaml task is in xsctyaml.bbclass.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 21 '18 at 21:55









                CodemonkeyCodemonkey

                14




                14






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53288060%2fyocto-find-the-recipe-or-class-that-defines-a-task%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    這個網誌中的熱門文章

                    Xamarin.form Move up view when keyboard appear

                    Post-Redirect-Get with Spring WebFlux and Thymeleaf

                    Anylogic : not able to use stopDelay()