[yocto] how to add a task via anonymous python function

Joshua Immanuel josh at hipro.co.in
Thu Nov 1 00:46:21 PDT 2012


Hello,

I want to do the following in anonymous python function

        addtask some_task after do_compile before do_install

Getting some clue from externalsrc.bbclass I did the following

        python __anonymous () {
            tasks = d.getVar('__BBTASKS')
            tasks.insert(tasks.index('do_install'), 'do_some_task')
            d.setVar('__BBTASKS', tasks)
            d.setVarFlag('do_some_task', 'deps', 'do_compile')
            d.setVarFlag('do_install', 'deps', 'do_some_task')
            tasklist = filter(lambda k: d.getVarFlag(k, "task"),
        d.keys())
            print tasklist
        }
        
The above printed tasklist doesn't contain 'do_some_task'. I am able to
run the task manually via

        bitbake -c some_task <recipe_name>
        
But, the task doesn't gets executed automatically after the do_compile
task. Is there anything else that should be done?

-- 
Joshua Immanuel
HiPro IT Solutions Private Limited
http://hipro.co.in
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20121101/7f7edccd/attachment.pgp>


More information about the yocto mailing list