[oe] bitbake: environments getting lost inside python callback function

Chris Larson clarson at kergoth.com
Tue Jun 29 17:40:24 UTC 2010


exported bitbake variables are emitted into the run. shell script when the
task is executed.  They are not exported into the actual environment of the
bitbake process, so they do not end up in the child processes spawned by
os.system().  See the oe_popen/oe_system wrapper functions.

On Mon, Jun 28, 2010 at 5:02 AM, Anand Sivaram <aspnair at gmail.com> wrote:

> Dear All,
>
> I am using OE to make a davinci dm6446 build.  The build machine is an
> Athlon X4 with Ubuntu 10.04 amd64 installed.  Everything is building fine
> (palmtop-image, x11-gpe-image etc.), now I am moving onto gstreamer-ti
> related recipes.
>
> As a part of that I tried the following
> bitbake -v -b ./recipes/ti/ti-dspbios_5.41.00.06.bb -f
> This downloads bios_setuplinux_5_41_00_06.bin from TI site and trying to
> unpack it for which it uses recipes/ti/ti-eula-unpack.inc
>
> Since it was not working, I tried to understand
> recipes/ti/ti-eula-unpack.inc, used the following debug code snippets.
>
> Updated the first python callback "python do_unpack" to the following to
> get
> the list of environments
> python do_unpack () {
>    os.system("/usr/bin/env > /tmp/env_py.txt 2>&1")
>    os.system("/bin/echo env complete >> /tmp/env.txt")
>    bb.build.exec_func('base_do_unpack', d)
>    bb.build.exec_func('ti_bin_do_unpack', d)
> }
>
> Now going through the output of "cat /tmp/env_py.txt" from a shell.
> *Every* *environment* *is* *lost* *with* *the* *exception* of PWD,
> SHLVwhere PWD is showing the complete path of workdir,SHLV=1 (like a
> top level shell)
> This was causing the rest of the script file to give errors.
>
> Next I commented out the whole python do_unpack() callback put a new custom
> do_unpack() shell callback, just for finding the environment list.
> do_unpack() {
>   echo unpacking..................
>   env > /tmp/env_shell.txt 2>&1
>   sleep 100
> }
> Now cat /tmp/env_shell.txt is showing proper environments.
>
> Could anyone throw some light on this?
>
> Thanks and Regards
>
> Anand
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel at lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>



-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics



More information about the Openembedded-devel mailing list