yocto-第14篇-devtool edit-recipe命令(编辑bb文件命令)

By: fu linux
E-mail: fulinux@sina.com
Blog: https://blog.csdn.net/fulinus
喜欢的盆友欢迎订阅!
你的喜欢就是我写作的动力!

返回总目录 Yocto开发讲解系列 - 总目录

devtool edit-recipe命令

使用devtool edit-recipe命令对指定recipe进行编辑(对应的文件是bb文件),该编辑器是vim,不知道读者盆友是什么,有个EDITOR变量来控制使用哪个编辑器。可以这么说,没有这个命令你去编辑一个bb文件很麻烦,麻烦之处在于你不知道这个bb文件位于什么位置。有了他之后,只需知道recipe名就可以开始编辑bb文件。so easy~

查看帮助信息

build]$ devtool edit-recipe --help
NOTE: Starting bitbake server...
usage: devtool edit-recipe [-h] [--any-recipe] recipename

Runs the default editor (as specified by the EDITOR variable) on the specified
recipe. Note that this will be quicker for recipes in the workspace as the
cache does not need to be loaded in that case.

arguments:
  recipename        Recipe to edit

options:
  -h, --help        show this help message and exit
  --any-recipe, -a  Does nothing (exists for backwards-compatibility) #该参数向后兼容保留
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14

其中-a选项保留只是为了向下兼容。老版本中devtool edit-recipe只能用来编辑workspace中的recipe,但是加-a可以编辑任意目录下的recipe。

编辑learnyocto的recipe

build]$ devtool edit-recipe learnyocto
  • 1

在这里插入图片描述

编辑alsa-utils的recipe

build]$ devtool edit-recipe alsa-utils
#编辑
  • 1
  • 2

会打开poky/meta/recipes-multimedia/alsa/alsa-utils_1.2.1.bb文件

编辑dbus的recipe

build]$ devtool edit-recipe dbus
#编辑
  • 1
  • 2

会打开poky/meta/recipes-core/dbus/dbus_1.12.16.bb

结语

该命令确实很有用,大家应当掌握。本文暂时不对bb文件的内容进行讲解。后续在介绍。

谢谢阅读!希望帮我点个赞加关注,你的喜欢就是我持续更新的动力!