列出构建 Yocto 镜像所需的所有包/文件的 SRC_URI [英] Listing SRC_URI of all packages/files needed to build Yocto image
问题描述
我想列出我烘焙图像时 bitbake 将获取的所有文件.
I would like to list all files that bitbake will fetch when I bake an image.
目前,我可以通过执行 bitbake core-image-minimal -c fetchall
获取烘焙 Yocto 图像所需的所有文件的 SRC_URI,然后解析日志文件.
Currently, I am able to get the SRC_URI of all files needed to bake a Yocto image by executing bitbake core-image-minimal -c fetchall
and then parse log files.
有没有更简单的方法来获得相同的结果而不需要下载文件?
Is there is a simpler way to get the same result without the need to download files ?
我不确定 bitbake 是否支持这样的功能.理想情况下,我正在寻找一个命令,该命令可以打印出包名称并列出具有相应 URL 的所有文件
I am not sure bitbake supports such feature. Ideally, I am looking for a command that prints out the package name and lists all files with corresponding URL
> bitbake core-image-minimal -c fetchall --print-only
推荐答案
通常 bitbake 不提供这样的功能.
Generally bitbake doesn't provides such functionality.
但是我能够创建一个简单的解决方案,创建简单的 .bbclass 文件,该文件在所有配方中都继承,将其添加到 local.conf 文件中,请参阅我的步骤是为了存档:
But I was able to create a simple solution witch creating simple .bbclass file which is inherited in all recipes, by adding it into local.conf file, please see my steps in order to archive that:
步骤:
让我们创建一个 print-src.bbclass 类文件,用于获取和打印 SRC_URI 变量(记住将此类文件存储在可用的层中)conf/bblayers.conf):
let's create a class print-src.bbclass file used to get and print SRC_URI variable (remember to store this class file in layer which is available in conf/bblayers.conf):
$ cat print-src.bbclass
python do_print_src () {
# should probably be indented
srcuri = d.getVar('SRC_URI', True).split()
bb.warn("SRC_URI look like: %s" % srcuri)
}
addtask do_print_src before do_fetch
将 INHERIT += "print-src" 添加到您的 conf/local.conf 文件
使用 bitbake --runonly 选项很重要,该选项允许为指定目标运行 taskgraph 的特定任务(使用 --runonly 选项 do_print_src 需要用作 print_src),
it is important to use bitbake --runonly option, that allows to run specific task of the taskgraph for the specified target (with --runonly option do_print_src needs to be used as print_src),
请注意,--runall=RUNALL 和 --runonly=RUNONLY 是通过 Yocto Sumo 2.5 版,>
Please note that --runall=RUNALL and --runonly=RUNONLY was introduced with Yocto Sumo release 2.5,
$ bitbake core-image-minimal --runonly print_src
Loaded 1236 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies
Build Configuration:
BB_VERSION = "1.37.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "universal-4.8"
TARGET_SYS = "i586-poky-linux"
MACHINE = "qemux86"
DISTRO = "poky"
DISTRO_VERSION = "2.5"
TUNE_FEATURES = "m32 i586"
TARGET_FPU = ""
meta
meta-poky
meta-yocto-bsp = "master:13cc30cd7de4841990b600e83e1249c81a5171dd"
Initialising tasks: 100% |##########################################################################################################################################################################| Time: 0:00:00
NOTE: Executing RunQueue Tasks
WARNING: ptest-runner-2.2+gitAUTOINC+49956f65bb-r0 do_print_src: SRC_URI look like: ['git://git.yoctoproject.org/ptest-runner2']
WARNING: grep-3.1-r0 do_print_src: SRC_URI look like: ['http://ftp.gnu.org/gnu/grep/grep-3.1.tar.xz', 'file://0001-Unset-need_charset_alias-when-building-for-musl.patch']
...
...
NOTE: Tasks Summary: Attempted 201 tasks of which 0 didn't need to be rerun and all succeeded.
Summary: There were 202 WARNING messages shown.
请查看示例警告输出日志行:
Please see sample warning output log line:
警告: ptest-runner-2.2+gitAUTOINC+49956f65bb-r0 do_print_src:SRC_URI 看起来像:['git://git.yoctoproject.org/ptest-runner2'].
WARNING: ptest-runner-2.2+gitAUTOINC+49956f65bb-r0 do_print_src: SRC_URI look like: ['git://git.yoctoproject.org/ptest-runner2'].
这篇关于列出构建 Yocto 镜像所需的所有包/文件的 SRC_URI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!