如何将父环境变量导出到bitbake shell任务?

时间:2018-02-16 19:08:33

标签: yocto bitbake

在bitbake配方中,我的 shell任务需要将http_proxy导出到它调用的进程。 http_proxy已在BB_ENV_EXTRAWHITE列入白名单,因此从bitbake开始${http_proxy}的shell中导出的值在export http_proxy = ${http_proxy} my_process 中可用。

要将其导出到子任务,我正在执行

File "/usr/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 515, in spawn_worker worker.init_process() File "/usr/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 122, in init_process self.load_wsgi() File "/usr/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 130, in load_wsgi self.wsgi = self.app.wsgi() File "/usr/lib/python2.7/dist-packages/gunicorn/app/base.py", line 67, in wsgi self.callable = self.load() File "/usr/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load return self.load_wsgiapp() File "/usr/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp return util.import_app(self.app_uri) File "/usr/lib/python2.7/dist-packages/gunicorn/util.py", line 366, in import_app import(module) ImportError: No module named travel_buddy.wsgi

这样可行,但给我留下了冗余语法的感觉。这是将父环境变量传递给bitbake任务的正确方法吗?

1 个答案:

答案 0 :(得分:2)

我认为这是在bitbake任务中从环境访问变量的正确方法,请参阅http://www.yoctoproject.org/docs/2.4.1/bitbake-user-manual/bitbake-user-manual.html#exporting-variables-to-the-environment。并且(在我看来) Bitbake 旨在与用户环境隔离,而冗余语法是归档此功能的代价。