yocto 项目 runqemu:找不到命令

发布于 2025-01-20 14:00:13 字数 1455 浏览 4 评论 0原文

我正在设置我的 yocto 项目,为此我遵循了以下步骤:

  1. 下载 Poky 源代码(ubuntu:/yocto/source

    $ git clone git://git.yoctoproject.org/poky
    
  2. 查看最新的分支/版本 (zeus)

    $ git checkout zeus
    
  3. 第 3 步:准备构建环境(ubuntu:/yocto/source/poky

    $ 源 oe-init-build-env ../../build
    

    上面的脚本将移动到构建文件夹中,并在conf文件夹内的conf文件夹中创建两个文件(local.confbblayers.conf

  4. 构建Linux发行版(unbuntu: /yocto/build)

    $ bitbake core-image-minimal
    
  5. 检查 runqemu (ubuntu: /yocto/source/poky/scripts)

    $ ls runqemu // 它就在那里
    
  6. 在qemu中运行生成的图像(ubuntu:/yocto/build)

    $ runqemu qemux86-64 core-image-minimal
    

为 qemu 打开其他窗口,并且图像运行良好。

问题

第一次使用后,当我关闭终端,并通过在 /yocto/build 中运行 runqemu qemux86-64 core-image-minimal 再次使用它时,会弹出错误

runqemu:找不到命令

,如果我在 poky 目录中写入 bitbake ,则会弹出相同的错误

bitbake:未找到命令。

注意:我已重复整个过程 3 次,以检查安装是否不正确,但我这边一切都做得很好。

yocto 项目层次结构:

在此处输入图像描述

I am setting up my yocto project, for that I have followed these below steps:

  1. download the Poky Source code (ubuntu: /yocto/source)

    $ git clone git://git.yoctoproject.org/poky
    
  2. Checkout the latest branch/release (zeus)

    $ git checkout zeus
    
  3. Step 3: Prepare the build environment (ubuntu: /yocto/source/poky)

    $ source oe-init-build-env ../../build
    

    The above script will move in a build folder and create two files in conf folder (local.conf, bblayers.conf) inside conf folder

  4. Building Linux Distribution (unbuntu: /yocto/build)

    $ bitbake core-image-minimal
    
  5. Checking the runqemu (ubuntu: /yocto/source/poky/scripts)

    $ ls runqemu   // and it is there
    
  6. Run generated image in qemu (ubuntu: /yocto/build)

    $ runqemu qemux86-64 core-image-minimal
    

other window open for qemu and image runs well.

Problem

After using the first time when I close the terminal, and use it again by running runqemu qemux86-64 core-image-minimal in /yocto/build the error pops up

runqemu: command not found

and if I write bitbake in poky directory the same error pops up

bitbake: command not found.

NOTE: I have repeat this whole process 3 times to check if the installation is not correct but i have done everything fine from my side.

yocto project hierarchy:

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夜声 2025-01-27 14:00:14

如果您关闭了狭小的环境终端,您始终必须重新source环境。

poky 的 oe-init-build-env 会为您设置所有命令,例如:

poky/scripts 中存在的 runqemu* 命令。

该脚本还从 poky/bitbake/bin 导出 bitbake* 命令。

负责该操作的行位于:

  • poky/scripts/oe-buildenv-internal(第99行):
# Make sure our paths are at the beginning of $PATH
for newpath in "$BITBAKEDIR/bin" "$OEROOT/scripts"; do
    # Remove any existences of $newpath from $PATH
    PATH=$(echo $PATH | sed -re "s#(^|:)$newpath(:|$)#\2#g;s#^:##")

    # Add $newpath to $PATH
    PATH="$newpath:$PATH"
done

因此,如果您打开新终端,则始终:

source /yocto/source/poky/oe-init-build-env /yoctu/build

编辑

如果您已经有构建文件夹,请确保为该文件夹提供到 oe-init-build-env 脚本的正确路径。

如果您提供不存在文件夹的新路径,则脚本将为您创建另一个版本。

编辑2

根据您的路径获取狭隘环境:

  • 相对:
cd ~/Documents/yocto/source/poky
source oe-init-build-env build
                           ^
                           |
(because build is in same folder as the script)
  • 绝对:
source /home/$USER/Documents/yocto/source/poky/oe-init-build-env /home/$USER/Documents/yocto/source/poky/build 

规则

source <path/to/oe-init-build-env> <path/to/build/folder>

如果存在,则,poky 将获取现有的构建环境。

如果 不存在,poky 将以相同的名称和路径创建新的构建。

If you close your poky environment terminal you always MUST re-source the environment.

The poky's oe-init-build-env setups up all commands for you, for instance:

runqemu* commands which are present in poky/scripts.

The script also export bitbake* commands from poky/bitbake/bin.

The line responsible for that is in:

  • poky/scripts/oe-buildenv-internal (line 99):
# Make sure our paths are at the beginning of $PATH
for newpath in "$BITBAKEDIR/bin" "$OEROOT/scripts"; do
    # Remove any existences of $newpath from $PATH
    PATH=$(echo $PATH | sed -re "s#(^|:)$newpath(:|$)#\2#g;s#^:##")

    # Add $newpath to $PATH
    PATH="$newpath:$PATH"
done

So, always if you open new terminal:

source /yocto/source/poky/oe-init-build-env /yoctu/build

EDIT

If you already have a build folder, make sure to provide the right path for that folder to the oe-init-build-env script.

If you provide new path to non-existing folder, than the script will create another build for you.

EDIT2

To source poky environment according to your path:

  • Relative:
cd ~/Documents/yocto/source/poky
source oe-init-build-env build
                           ^
                           |
(because build is in same folder as the script)
  • Absolute:
source /home/$USER/Documents/yocto/source/poky/oe-init-build-env /home/$USER/Documents/yocto/source/poky/build 

THE RULE

source <path/to/oe-init-build-env> <path/to/build/folder>

If <path/to/build/folder> exists then, poky will source the existing build environment.

If <path/to/build/folder> does not exist, poky will create new build under the same name and path.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文