By: fu linux
E-mail: fulinux@sina.com
Blog: https://blog.csdn.net/fulinus
喜欢的盆友欢迎点赞和订阅!
你的喜欢就是我写作的动力!
返回总目录 : Yocto开发讲解系列 - 总目录
问题简述
最新版本的yocto是v3.4, 对应的代号是honister。这个版本中bb文件的命名方法有了改变,比如
XXX_append
就都改成
XXX:append
形式了。很显然此类语法太多了逐一修改太费时间了。
同样,我在将自己的meta-mylayer添加到新版本的poky中去的时候发现类似如下问题:
build]$ bitbake core-image-sato
ERROR: Variable PACKAGECONFIG_append_pn-qemu-system-native contains an operation using the old override syntax. Please convert this layer/metadata before attempting to use with a newer bitbake.
- 1
- 2
解决方法
Yocto有提供一个现成的脚本可以批处理此类问题:
meta-mylayer]$ ../scripts/contrib/convert-overrides.py conf/machine/msm8909.conf
processing file 'conf/machine/msm8909.conf'
meta-mylayer]$ git diff conf/machine/msm8909.conf
diff --git a/conf/machine/msm8909.conf b/conf/machine/msm8909.conf
index ba5b9d8..2aa7f68 100644
--- a/conf/machine/msm8909.conf
+++ b/conf/machine/msm8909.conf
@@ -35,5 +35,15 @@ EXTRA_IMAGEDEPENDS += "lk"
TCLIBC := "glibc"
-#HOSTTOOLS_NONFATAL_append = " python"
-HOSTTOOLS_append = " python"
+#HOSTTOOLS_NONFATAL:append = " python"
...
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
先找到所有需要修改的配置和bb文件的方法,避免其他文件被修改
poky]$ find ./meta-mylayer/ -iname *.bb* -o -iname *.conf -o -iname *.conf.sample| grep -v 3.18.71
./meta-mylayer/recipes-example/example/example_0.1.bb
./meta-mylayer/conf/distro/mydistro.conf
./meta-mylayer/conf/machine/msm8909.conf
./meta-mylayer/conf/layer.conf
...
- 1
- 2
- 3
- 4
- 5
- 6
其中3.18.71是linux内核版本号,因为内核代码中也有很多的conf文件,就不要去修改了。
结合上面的命令,批处理方法:
meta-mylayer$ for c in `find ./ -iname *.bb* -o -iname *.conf -o -iname *.conf.sample| grep -v 3.18.71`;do ../scripts/contrib/convert-overrides.py $c;done
processing file './recipes-example/example/example_0.1.bb'
processing file './conf/distro/mydistro.conf'
processing file './conf/machine/msm8909.conf'
processing file './conf/layer.conf'
...
- 1
- 2
- 3
- 4
- 5
- 6