2017-02-21 40 views
0

我試圖通過引用this使用yocto構建樹莓派3的圖像,同時運行bitbake命令我收到以下錯誤。 「:類型錯誤:getVar()至少需要3個參數(2給出)異常」解析錯誤,同時構建樹莓派3的圖像使用yocto

在錯誤日誌中,它在執行一個Python函數,但是沒有錯誤的細節,我可以看到異常說錯誤。但在很多地方我可以看到,getVar只有兩個參數。

你能指導解決這個問題。我可以看到d.getVar()很多地方,你能告訴我這裏是什麼,我在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) 
+0

getVar函數{getVar(var,d,exp = False)}在data.py(available @ bitbake/lib/bb)中定義,它在內部調用{d.getVar(var,exp)}。我在bb文件中添加了「導入數據」,但它在導入語句時給出瞭解析錯誤。同樣的問題,當我嘗試添加inc文件也。你能幫助如何在「meta-raspberrypi」圖層中導入這個data.py。 – Ravi

回答

2

我面臨着同樣的問題,並通過固定切換到莫蒂分支上元樹莓派層同我的狹小環境的分支。

+0

感謝您的信息。它有助於解決這個問題。我已經切換到krogoth分支,因爲這個poky分支是krogoth,它工作。 – Ravi