git - 如何设置 Yocto 配方以从本地 git 源构建?

标签 git cmake yocto bitbake

你好

我正在玩 Yocto、Raspberry Pi 和我编写的一些代码。现在我希望 Yocto 正在构建包含我编写的程序的图像。我想知道如何设置 fetcher 以从本地 git repro 中获取。

我的设置很简单。代码在目录中:

/home/user/git/myTest

我将该目录链接到我的 Yocto 元层的食谱目录中。

/home/user/poky/meta-test/myApp/myTest

因为是本地git repro,所以有“.git”文件夹。

/home/user/git/myTest/.git

还有更多文件:

/home/user/git/myTest/CMakeLists.txt
/home/user/git/myTest/src/main.cpp
/home/user/git/myTest/src/...

我想知道如何设置我的食谱以使用 git fetcher:

SUMMARY = "test"
SECTION = "app"
LICENSE = "CLOSED"

inherit cmake

SRCREV = "${AUTOREV}"

SRC_URI = "git://.git"

S = "${WORKDIR}/git"

我确实检查了 Yocto/Bitbake 文档。但是我没有找到如何做的例子。 有什么想法吗?

最佳答案

bitbake 中的 GIT Fetcher supports different protocols但具有相当奇特和非标准的语法。在你的情况下,它应该是这样的

SRC_URI = "git:///home/user/git/myTest/;protocol=file"

关于git - 如何设置 Yocto 配方以从本地 git 源构建?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49535881/

相关文章:

.net-core - 如何将正确的 libssl 版本包含到 yocto-build 中以运行 .net-core 应用程序?

linux - yocto zeus 上的元工具链 qt5,gcc-cross-canatian-aarch64 失败

windows - MSysGit 与 Git for Windows

git - 如何重命名 .git 目录?

c++ - 在 Linux 上使用 CMake 时,如何告诉 PVS-Studio 忽略第三方库中的所有文件

c++ - 无法使用 Visual Studio 和 CMake 将 __cplusplus 设置为 C++17 标准

python - Openembedded:如何将 python-robotframework 添加到 Yocto

Git 没有移动到特定的分支

git - 从 GitHub 克隆特定分支 - fatal error

c++ - 如何使用 cmake 在项目构建期间构建 SDL2?