问题
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
回答1:
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
来源:https://stackoverflow.com/questions/42416296/yocto-u-boot-custom-commands