快速开始使用Yocto

本文档介绍了在Red Hat Enterprise Linux Server 7.5环境下使用Yocto的步骤,包括配置python环境,构建core-image-minimal目标,创建并完善新recipe(myapp.bb)的过程,如设置LICENSE、SRC_URI、SRCREV,处理编译和安装任务。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

环境:

Red Hat Enterprise Linux Server release 7.5 (Maipo)

git version 1.8.3.1
Python 2.7.6

tar (GNU tar) 1.26
 

操作步骤:

git clone git://git.yoctoproject.org/poky

  cd poky/

source oe-init-build-env

  bitbake  core-image-minimal 报错:

Traceback (most recent call last):
  File "/var/fpwork/alice/poky/bitbake/bin/bitbake", line 31, in <module>
    import bb
  File "/var/fpwork/alice/poky/bitbake/lib/bb/__init__.py", line 77, in <module>
    import bb.msg
  File "/var/fpwork/alice/poky/bitbake/lib/bb/msg.py", line 32, in <module>
    import bb.event
  File "/var/fpwork/alice/poky/bitbake/lib/bb/event.py", line 35, in <module>
    import bb.utils
  File "/var/fpwork/alice/poky/bitbake/lib/bb/utils.py", line 37, in <module>
    from commands import getstatusoutput
ImportError: cannot import name getstatusoutput

 检查并重新配置python环境, 重新执行core-image-minimal target,执行成功:

$ python -V
Python 2.7.5
$ unset PYTHONPATH
$ export PATH="${PATH}:/build/ltesdkroot/Tools/Tools/python/python-3.3.2/bin/"
$ export PATH=/build/ltesdkroot/Tools/Tools/7za/7za-9.20/:$PATH
$ export PATH=/build/ltesdkroot/Tools/Tools/python/python-2.7.6/bin/:$PATH
$ source oe-init-build-env
$ bitbake core-image-minimal

创建新的recipe:

  尝试创建空的myapp.bb,报错:

$ mkdir meta/recipes-devtools/myapp
$ touch meta/recipes-devtools/myapp/myapp.bb
$ bitbake myapp
WARNING: Host distribution "RedHatEnterpriseLinuxServer-7.5" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Loading cache: 100% |############################################################################################################################################################################| ETA:  00:00:00
Loaded 1309 entries from dependency cache.
ERROR: /var/fpwork/alice/poky/meta/recipes-devtools/myapp/myapp.bb: This recipe does not have the LICENSE field set (myapp)                                                                      | ETA:  --:--:--
ERROR: Failed to parse recipe: /var/fpwork/alice/poky/meta/recipes-devtools/myapp/myapp.bb

Summary: There was 1 WARNING message shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.

配置license,参考https://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html#var-LICENSE

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值