无效选择:yocto 构建中的“kernel_add_dts" [英] invalid choice: 'kernel_add_dts' in yocto build

查看:37
本文介绍了无效选择:yocto 构建中的“kernel_add_dts"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

争论有什么问题,是不是没有 kernel_add_dts 子命令.

每当我尝试运行时,我都会收到以下错误$ recipetool kernel_add_dts 元本地/path/to/my.dts

recipetool:错误:参数<subcommand>:无效选择:'kernel_add_dts'(从'edit'、'create'、'newappend'、'appendfile'、'appendsrcfiles'、'appendsrcfile'、'中选择设置变量')用法:recipetool [-d] [-q] [--color COLOR] [-h] <子命令>...

解决方案

使用 recipetool 按照以下语法将新设备树添加到您的自定义层:

recipetool appendsrcfile -wm (MACHINE) (PATH/TO/LAYER) virtual/kernel (PATH/TO/DTS) 'arch/${ARCH}/boot/dts/(YOUR_DTS_NAME).dts'

详情:

  • (MACHINE):您的构建机器名称
  • (PATH/TO/LAYER):将创建带有新 DTS 的 linux-xx_%.bbappend 文件所在层的路径
  • (PATH/TO/DTS):新 DTS 文件的路径
  • (YOUR_DTS_NAME):DTS 文件名

重要提示:

如果默认设备树名称与您添加的相同,则没有问题,如果不是,请确保将其添加到 KERNEL_DEVICETREE 变量中,以便它将与所有 DTS 文件一起提供启动分区.

KERNEL_DEVICETREE += "(NEW_DTS_NAME).dtb";

之后,您可以停止 Uboot(如果您使用的是 Uboot)并使用以下命令指定新的 DTS 文件:

setenv fdt_file (NEW_DTS_NAME).dtbsaveenv(如果你想每次启动都保存它)

请运行printenv";确保fdt_file"变量名.

实际运行测试:

recipetool appendsrcfile -wm imx8mmddr3lval/home/talel/Desktop/final_git/meta-node virtual/kernel/home/talel/Desktop/example.dts 'arch/${ARCH}/boot/dts/example.dts'...注意:写入附加文件/home/talel/Desktop/final_git/meta-node/recipes-kernel/linux/linux-imx_%.bbappend注意:将/home/talel/Desktop/example.dts 复制到/home/talel/Desktop/final_git/meta-node/recipes-kernel/linux/linux-imx/imx8mmddr3lval/example.dts

新的 bbappend 文件是:

$ cat/home/talel/Desktop/final_git/meta-node/recipes-kernel/linux/linux-imx_%.bbappend

<块引用>

SRC_URI += "file://example.dts;subdir=git/arch/${ARCH}/boot/dts";FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"PACKAGE_ARCH = "${MACHINE_ARCH}";

使用虚拟/内核"它将检测提供它的内容(linux-imx、linux-yocto、...)并创建 linux-imx_%.append 文件.

-w 标志将创建_%"至于任何版本号.

避免对 DTS 文件进行任何修补的解决方案:

如果您的 Linux 内核有补丁,如果您使用新的修改来更新 DTS,这些补丁会覆盖补丁所需的某些行,那么它们将失败,因此您可以通过两种方式干净利落地做到:

bitbake virtual/kernel -c cleansstatebitbake 虚拟/内核 -c 补丁

现在所有补丁都已应用,转到 tmp/work/../linux-(PROVIDER)/../git 和:

git add .git commit -m "提交旧补丁";

现在编辑 DTS 文件并:

git add arch/../boot/dts/../myplatform.dtsgit commit -m "更改";git format-patch -1 -o/path/to/meta-custom/recipes-kernel/linux/files

现在将其添加到/path/to/meta-custom/recipes-kernel/linux/linux-(PROVIDER)_%.bbappend:

SRC_URI_append = "file://patch_file.patch"

或者,另一种方法是在补丁完成后添加最终的 DTS:

SRC_URI_append = "文件://myplatform.dts"do_configure_append(){cp ${WORKDIR}/myplatform.dts ${S}/arch/(ARCH)/boot/dts/....}

并将您的 myplatform.dts 复制到/path/to/meta-custom/recipes-kernel/linux/files.

现在,这是您的最终 DTS 文件.

删除配方工具添加的内容:

其实recipetool中没有undo子命令,你只需要删除recipetool部署的文件,recipetool复制你指定的文件,创建一个bbappend文件,删除这两个文件.

示例:您使用 recipetool 添加 example.dts 文件,recipetool 将 example.dts 复制到:

meta-custom/recipes-kernel/linux/(MACHINE)/example.dts

并创建了 bbappend 文件,其中将 example.dts 添加到 SRC_URI 变量.

如果您需要保留 bbappend 文件,因为您正在以其他方式使用它,只需修改它并删除 recipetool 添加的行,其中包含:

SRC_URI ...file://example.dts ...";

Whats wrong with the argument, is there is no kernel_add_dts subcommand.

I get this below error whenever i try to run $ recipetool kernel_add_dts meta-local /path/to/my.dts

recipetool: error: argument <subcommand>: invalid choice: 'kernel_add_dts' (choose from 'edit', 'create', 'newappend', 'appendfile', 'appendsrcfiles', 'appendsrcfile', 'setvar')
usage: recipetool [-d] [-q] [--color COLOR] [-h] <subcommand> ...

解决方案

Use recipetool to add a new device tree to your custom layer following this syntax:

recipetool appendsrcfile -wm (MACHINE) (PATH/TO/LAYER) virtual/kernel (PATH/TO/DTS) 'arch/${ARCH}/boot/dts/(YOUR_DTS_NAME).dts'

Details:

  • (MACHINE): Your build machine name
  • (PATH/TO/LAYER): The path to the layer that you want the linux-xx_%.bbappend file with the new DTS will be created
  • (PATH/TO/DTS): The path to the new DTS file
  • (YOUR_DTS_NAME): The DTS file name

Important note:

If the default device tree name is the same as the one you are adding it is not a problem, if not, please make sure that you add it to KERNEL_DEVICETREE variable so that it will be shipped with all the DTS files in the boot partition.

KERNEL_DEVICETREE += "(NEW_DTS_NAME).dtb"

After that you can stop Uboot (if you are using Uboot) and specify the new DTS file with:

setenv fdt_file (NEW_DTS_NAME).dtb
saveenv (If you want to save it for every boot)

Please run "printenv" to make sure of the "fdt_file" variable's name.

Real run test:

recipetool appendsrcfile -wm imx8mmddr3lval /home/talel/Desktop/final_git/meta-node virtual/kernel /home/talel/Desktop/example.dts 'arch/${ARCH}/boot/dts/example.dts'
...
NOTE: Writing append file /home/talel/Desktop/final_git/meta-node/recipes-kernel/linux/linux-imx_%.bbappend
NOTE: Copying /home/talel/Desktop/example.dts to /home/talel/Desktop/final_git/meta-node/recipes-kernel/linux/linux-imx/imx8mmddr3lval/example.dts

The new bbappend file is:

$ cat /home/talel/Desktop/final_git/meta-node/recipes-kernel/linux/linux-imx_%.bbappend

SRC_URI += "file://example.dts;subdir=git/arch/${ARCH}/boot/dts"

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

PACKAGE_ARCH = "${MACHINE_ARCH}"

With "virtual/kernel" it will detect what provides it (linux-imx, linux-yocto, ...) and it will create linux-imx_%.append file.

The -w flag will create "_%" as for any version number.

Solution to avoid any patch for the DTS file:

If there is patches for your Linux kernel they will fail if you are updating the DTS with new modifications that override some lines that the patch expects, so you can do it cleanly in 2 ways:

bitbake virtual/kernel -c cleansstate
bitbake virtual/kernel -c patch

Now all patches are applied, go to tmp/work/../linux-(PROVIDER)/../git and:

git add .
git commit -m "commiting old patches"

Now edit the DTS file and:

git add arch/../boot/dts/../myplatform.dts
git commit -m "changes"
git format-patch -1 -o /path/to/meta-custom/recipes-kernel/linux/files

Now add it to /path/to/meta-custom/recipes-kernel/linux/linux-(PROVIDER)_%.bbappend:

SRC_URI_append = " file://patch_file.patch"

Or, the other way is to add your final DTS after the patch is done:

SRC_URI_append = " file://myplatform.dts"
do_configure_append(){
  cp ${WORKDIR}/myplatform.dts ${S}/arch/(ARCH)/boot/dts/....
}

and copy your myplatform.dts to /path/to/meta-custom/recipes-kernel/linux/files.

Now, that's your final DTS file.

Remove what recipetool added:

Actually, no undo subcommand in recipetool, you just need to delete the files that recipetool deployed, recipetool copy the file you specified and create a bbappend file, so remove those two files.

Example: you used recipetool to add example.dts file, recipetool copied example.dts to:

meta-custom/recipes-kernel/linux/(MACHINE)/example.dts

and created bbappend file in which it added example.dts to SRC_URI variable.

If you need to keep the bbappend file because you are using it in other way, just modify it and remove the line added by recipetool which contains:

SRC_URI ... "file://example.dts ..."

这篇关于无效选择:yocto 构建中的“kernel_add_dts"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆