Yocto u-boot 自定义命令 [英] Yocto u-boot Custom Commands
问题描述
在 Yocto 设置(目前使用赛灵思的 Petalinux 2016.4)中向 u-boot 添加自定义命令的正确方法是什么?
是否应该通过recipe/patch将相关源文件添加到u-boot源中,以包含在u-boot的编译中?
是否有更好的方法在开发过程中执行此操作以加快周转速度.
代码应该放在哪个文件夹中 - 在 u-boot/board 下或添加到 u-boot/commands 中?
谢谢
恕我直言,您有两个选项可以将额外的源代码添加到您的 YP 版本中:
- 如果您只有少量更改:将补丁添加到您的图层并通过
SRC_URI
激活"它们. - 如果您有更多更改:为您的"U-Boot 版本创建一个单独的 git 分支/存储库.
测试更改的最快方法可能是在某处签出单独的 U-Boot 存储库并使用生成的 SDK.另一种方法可能是使用 devshell
[1]
我不是 U-Boot 源代码布局的专家,但我会说这取决于它是哪种类型的命令.如果它是像 date
这样的通用"目录,cmd/
子目录会是最好的.
如果您正在寻找可以作为工作基础的示例,cmd/misc.c
中的 timer
命令可能是一个好的开始.>
[1] http://www.openembedded.org/wiki/Devshell
What is the correct way of adding custom commands to u-boot in a Yocto setup (currently using Petalinux 2016.4 by Xilinx)?
Should I add the relevant source files to the u-boot source through a recipe/patch, to be included in the compilation of u-boot?
Is there a better way to do this during development to get a faster turn around.
In what folder should the code be placed - under u-boot/board or added to u-boot/commands?
Thanks
IMHO you have two options for adding the additional sourcecode to your YP build:
- If you have only a small number of changes: Add the patches to your layer and "activate" them via
SRC_URI
. - If you have more changes: create a separate git branch/repo for "your" U-Boot version.
The fastest way of testing your changes may be to checkout a separate U-Boot repo somewhere and use a generated SDK. Another way may be to use the devshell
[1]
I'm not an expert on U-Boot's source layout, but I would say it depends which type of command it is. If it's a "generic" one like date
the cmd/
subdirectory would be best.
If you're looking for an example on which you can base your work maybe the timer
command in cmd/misc.c
would be a good start.
[1] http://www.openembedded.org/wiki/Devshell
这篇关于Yocto u-boot 自定义命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!