简体   繁体   English

使用yocto构建Raspberry pi 3的图像时解析错误

[英]Parsing error while building images for Raspberry pi 3 using yocto

I am trying to build images for Raspberry pi 3 using yocto by referring this , while running bitbake command I am getting following error. 我试图通过引用this来使用yocto为Raspberry pi 3构建图像,同时运行bitbake命令时出现以下错误。

In the error log, it says error while executing a python function, but no details about the error, I could see the exception "Exception: TypeError: getVar() takes at least 3 arguments (2 given)" . 在错误日志中,它表示执行python函数时出错,但是没有有关错误的详细信息,我可以看到异常“ Exception:TypeError:getVar()至少接受3个参数(给定2个)” But in the yocto many places I could see getVar is taking only two arguments. 但是在yocto的许多地方,我可以看到getVar仅接受两个论点。

Can you guide in fixing this issue. 您能指导解决此问题吗? I could see d.getVar() many places, can you tell me what is d here, I searched in yocto documentation but didn't find any info explaining what is d. 我可以在很多地方看到d.getVar(),您能告诉我d是什么吗,我在yocto文档中进行了搜索,但没有找到解释d是什么的信息。

ERROR: /home/ubuntu/raspberryYocto/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bb: Error executing a python function in <code>:

The stack trace of python calls that resulted in this exception/failure was: File: '<code>', lineno: 17, function: <module>
     0013:__anon_146__home_ubuntu_raspberryYocto_poky_meta_classes_siteinfo_bbclass(d)
     0014:__anon_381__home_ubuntu_raspberryYocto_poky_meta_classes_kernel_yocto_bbclass(d)
     0015:__anon_6__home_ubuntu_raspberryYocto_poky_meta_recipes_kernel_linux_linux_dtb_inc(d)
     0016:__anon_148__home_ubuntu_raspberryYocto_meta_raspberrypi_recipes_kernel_linux_linux_rpi_inc(d)  *** 0017:__anon_39__home_ubuntu_raspberryYocto_meta_raspberrypi_recipes_kernel_linux_linux_raspberrypi_inc(d) File: '/home/ubuntu/raspberryYocto/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi.inc', lineno: 38, function:
__anon_39__home_ubuntu_raspberryYocto_meta_raspberrypi_recipes_kernel_linux_linux_raspberrypi_inc
     0034:# See http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#anonymous-python-functions
     0035:python __anonymous () {
     0036:    kerneltype = d.getVar('KERNEL_IMAGETYPE', True)
     0037:    kerneldt = get_dts(d, d.getVar('LINUX_VERSION', True))  *** 0038:    d.setVar("KERNEL_DEVICETREE", kerneldt)
     0039:}
     0040:
     0041:do_kernel_configme_prepend() {
     0042:    install -m 0644 ${S}/arch/${ARCH}/configs/${KERNEL_DEFCONFIG} ${WORKDIR}/defconfig || die "No default configuration for ${MACHINE} / ${KERNEL_DEFCONFIG} available." File: '/home/ubuntu/raspberryYocto/meta-raspberrypi/classes/linux-raspberrypi-base.bbclass', lineno: 6, function: get_dts
     0002:
     0003:def get_dts(d, ver=None):
     0004:    import re
     0005:  *** 0006:    staging_dir = d.getVar("STAGING_KERNEL_BUILDDIR")
     0007:    dts = d.getVar("KERNEL_DEVICETREE")
     0008:
     0009:    # d.getVar() might return 'None' as a normal string
     0010:    # leading to 'is None' check isn't enough. Exception: TypeError: getVar() takes at least 3 arguments (2 given)

ERROR: Failed to parse recipe: /home/ubuntu/raspberryYocto/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bb ERROR: /home/ubuntu/raspberryYocto/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.4.bb: Error executing a python function in <code>:

The stack trace of python calls that resulted in this exception/failure was: File: '<code>', lineno: 17, function: <module>
     0013:__anon_146__home_ubuntu_raspberryYocto_poky_meta_classes_siteinfo_bbclass(d)
     0014:__anon_381__home_ubuntu_raspberryYocto_poky_meta_classes_kernel_yocto_bbclass(d)
     0015:__anon_6__home_ubuntu_raspberryYocto_poky_meta_recipes_kernel_linux_linux_dtb_inc(d)
     0016:__anon_148__home_ubuntu_raspberryYocto_meta_raspberrypi_recipes_kernel_linux_linux_rpi_inc(d)  *** 0017:__anon_39__home_ubuntu_raspberryYocto_meta_raspberrypi_recipes_kernel_linux_linux_raspberrypi_inc(d) File: '/home/ubuntu/raspberryYocto/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi.inc', lineno: 38, function:
__anon_39__home_ubuntu_raspberryYocto_meta_raspberrypi_recipes_kernel_linux_linux_raspberrypi_inc
     0034:# See http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#anonymous-python-functions
     0035:python __anonymous () {
     0036:    kerneltype = d.getVar('KERNEL_IMAGETYPE', True)
     0037:    kerneldt = get_dts(d, d.getVar('LINUX_VERSION', True))  *** 0038:    d.setVar("KERNEL_DEVICETREE", kerneldt)
     0039:}
     0040:
     0041:do_kernel_configme_prepend() {
     0042:    install -m 0644 ${S}/arch/${ARCH}/configs/${KERNEL_DEFCONFIG} ${WORKDIR}/defconfig || die "No default configuration for ${MACHINE} / ${KERNEL_DEFCONFIG} available." File: '/home/ubuntu/raspberryYocto/meta-raspberrypi/classes/linux-raspberrypi-base.bbclass', lineno: 6, function: get_dts
     0002:
     0003:def get_dts(d, ver=None):
     0004:    import re
     0005:  *** 0006:    staging_dir = d.getVar("STAGING_KERNEL_BUILDDIR")
     0007:    dts = d.getVar("KERNEL_DEVICETREE")
     0008:
     0009:    # d.getVar() might return 'None' as a normal string
     0010:    # leading to 'is None' check isn't enough. Exception: TypeError: getVar() takes at least 3 arguments (2 given)

ERROR: /home/ubuntu/raspberryYocto/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_dev.bb: Error executing a python function in <code>:

The stack trace of python calls that resulted in this exception/failure was: File: '<code>', lineno: 17, function: <module>
     0013:__anon_146__home_ubuntu_raspberryYocto_poky_meta_classes_siteinfo_bbclass(d)
     0014:__anon_381__home_ubuntu_raspberryYocto_poky_meta_classes_kernel_yocto_bbclass(d)
     0015:__anon_6__home_ubuntu_raspberryYocto_poky_meta_recipes_kernel_linux_linux_dtb_inc(d)
     0016:__anon_148__home_ubuntu_raspberryYocto_meta_raspberrypi_recipes_kernel_linux_linux_rpi_inc(d)  *** 0017:__anon_39__home_ubuntu_raspberryYocto_meta_raspberrypi_recipes_kernel_linux_linux_raspberrypi_inc(d) File: '/home/ubuntu/raspberryYocto/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi.inc', lineno: 38, function:
__anon_39__home_ubuntu_raspberryYocto_meta_raspberrypi_recipes_kernel_linux_linux_raspberrypi_inc
     0034:# See http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#anonymous-python-functions
     0035:python __anonymous () {
     0036:    kerneltype = d.getVar('KERNEL_IMAGETYPE', True)
     0037:    kerneldt = get_dts(d, d.getVar('LINUX_VERSION', True))  *** 0038:    d.setVar("KERNEL_DEVICETREE", kerneldt)
     0039:}
     0040:
     0041:do_kernel_configme_prepend() {
     0042:    install -m 0644 ${S}/arch/${ARCH}/configs/${KERNEL_DEFCONFIG} ${WORKDIR}/defconfig || die "No default configuration for ${MACHINE} / ${KERNEL_DEFCONFIG} available." File: '/home/ubuntu/raspberryYocto/meta-raspberrypi/classes/linux-raspberrypi-base.bbclass', lineno: 6, function: get_dts
     0002:
     0003:def get_dts(d, ver=None):
     0004:    import re
     0005:  *** 0006:    staging_dir = d.getVar("STAGING_KERNEL_BUILDDIR")
     0007:    dts = d.getVar("KERNEL_DEVICETREE")
     0008:
     0009:    # d.getVar() might return 'None' as a normal string
     0010:    # leading to 'is None' check isn't enough. Exception: TypeError: getVar() takes at least 3 arguments (2 given)

我遇到了同样的问题,并通过切换到meta- raspberrypi层上的morty分支(与我的poky环境的分支相同)来解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM