Yocto u-boot Custom Commands

*爱你&永不变心* 提交于 2021-02-10 19:56:52

问题


What is the correct way of adding custom commands to u-boot in a Yocto setup (currently using Petalinux 2016.4 by Xilinx)?

  1. 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?

  2. Is there a better way to do this during development to get a faster turn around.

  3. In what folder should the code be placed - under u-boot/board or added to u-boot/commands?

Thanks


回答1:


IMHO you have two options for adding the additional sourcecode to your YP build:

  1. If you have only a small number of changes: Add the patches to your layer and "activate" them via SRC_URI.
  2. 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



来源:https://stackoverflow.com/questions/42416296/yocto-u-boot-custom-commands

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!