[yocto] export command in bitbake

Zoran Stojsavljevic zoran.stojsavljevic at gmail.com
Fri Nov 10 08:01:01 PST 2017


> Just to see if I understood correctly.
> Are saying here that you can't pass a custom environmental variable to a
child
> process of the parent process is the python interpreter?

It is actually vice versa, but it does not matter. You did not understand
what I wanted to say/point here.

> The oe-init-build-env is just a bash scritp. You could try running it
with -x to see
> if the file you're referring to is actually being used.

I have not at all idea what you tried to say/convey to me here. Could you
be more specific?

> The environment variables that you get when you source oe-init-build-env,
> are the variables that have been set. You know about grepping env?
> If they aren't there it means, that the haven't been exported and
> are set only for a particular building step you execute.

You missed the point, completely,. All Cool. I'll continue my research as
it comes... Alone.

Be Well,
Zoran

On Fri, Nov 10, 2017 at 9:11 AM, Alan Martinovic <alan.martinovic at senic.com>
wrote:

> Hi
>
>>
>> I have both python (2.7.14) and python3.6 (3.6.2). But, as far as I can
>> see/say, both interpreters do NOT support export declaration (supported
>> with /bin/bash). In other words, every child shell will (with export
>> declaration on certain variables) inherit parent's environment.
>>
>> [user at 192 conf]$ python
>> Python 2.7.14 (default, Nov  2 2017, 18:42:05)
>> [GCC 7.2.1 20170915 (Red Hat 7.2.1-2)] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>>
>> [user at 192 conf]$ python3.6
>> Python 3.6.2 (default, Oct  2 2017, 16:51:32)
>> [GCC 7.2.1 20170915 (Red Hat 7.2.1-2)] on linux
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>>
>> [user at 192 conf]$
>
>
> Just to see if I understood correctly.
> Are saying here that you can't pass a custom environmental variable to a
> child
> process of the parent process is the python interpreter?
>
>
> I assume this file: ...poky/meta/conf/bitbake.conf mandatory executes when
>> I source the oe-init-build-env file. Command: . oe-init-build-env
>>
>
> The oe-init-build-env is just a bash scritp. You could try running it with
> -x to see
> if the file you're referring to is actually being used.
>
> https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/oe-init-build-env
>
>
> I need advise here: how I can query bitbake environment variables set by .
>> oe-init-build-env, using /bin/bash? Or should I use some special written
>> python procedure to do this?
>>
>
>
> The environment variables that you get when you source oe-init-build-env,
> are the variables that have been set. You know about grepping env?
> If they aren't there it means, that the haven't been exported and
> are set only for a particular building step you execute.
>
> If you need custom variables, you can set them by modifying the
> oe-init-build-env
> with your own exports.
>
>
> On Fri, Nov 10, 2017 at 7:44 AM, Zoran Stojsavljevic <
> zoran.stojsavljevic at gmail.com> wrote:
>
>> Hello to all YOCTO users,
>>
>> I have one (I should say naive) question considering/querying environment
>> variables, initially set with bitbake scripts.
>>
>> I have both python (2.7.14) and python3.6 (3.6.2). But, as far as I can
>> see/say, both interpreters do NOT support export declaration (supported
>> with /bin/bash). In other words, every child shell will (with export
>> declaration on certain variables) inherit parent's environment.
>>
>> [user at 192 conf]$ python
>> Python 2.7.14 (default, Nov  2 2017, 18:42:05)
>> [GCC 7.2.1 20170915 (Red Hat 7.2.1-2)] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>>
>> [user at 192 conf]$ python3.6
>> Python 3.6.2 (default, Oct  2 2017, 16:51:32)
>> [GCC 7.2.1 20170915 (Red Hat 7.2.1-2)] on linux
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>>
>> [user at 192 conf]$
>>
>> Now, I see that bitbake (written in python language) supports export.
>> From here:
>> ...poky/meta/conf/bitbake.conf
>>
>> Excerpt from the file:
>> # Path prefixes
>> export base_prefix = ""
>> export prefix = "/usr"
>> export exec_prefix = "${prefix}"
>>
>> root_prefix = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge',
>> '${exec_prefix}', '${base_prefix}', d)}"
>>
>> # Base paths
>> export base_bindir = "${root_prefix}/bin"
>> export base_sbindir = "${root_prefix}/sbin"
>> export base_libdir = "${root_prefix}/${baselib}"
>> export nonarch_base_libdir = "${root_prefix}/lib"
>>
>> I assume this file: ...poky/meta/conf/bitbake.conf mandatory executes
>> when I source the oe-init-build-env file. Command: . oe-init-build-env
>>
>> After that I would like to access these environment variables from the
>> /bin/bash, and query them, but it seems that this is NOT possible?!
>>
>> I need advise here: how I can query bitbake environment variables set by
>> . oe-init-build-env, using /bin/bash? Or should I use some special written
>> python procedure to do this?
>>
>> Help required/needed!?
>>
>> I hope what I write here does make sense, does'n it?
>>
>> Thank you,
>> Zoran
>>
>>
>>
>> --
>> _______________________________________________
>> yocto mailing list
>> yocto at yoctoproject.org
>> https://lists.yoctoproject.org/listinfo/yocto
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20171110/360f860b/attachment.html>


More information about the yocto mailing list