【问题标题】:How to install files in Yocto如何在 Yocto 中安装文件
【发布时间】:2020-02-08 16:27:07
【问题描述】:

我为库编写了 Yocto 配方并尝试安装到映像。

当我运行命令“bitbake myproject”时,出现以下错误:

ERROR: sxe-0.1-r0 do_package: QA Issue: sxe: Files/directories were installed but not shipped in any package:
  /sxe
  /usr/share
  /usr/share/sxm
  /usr/share/sxm/baselines
  /usr/share/sxm/baselines/resources.psv
  /usr/share/sxm/baselines/resources_bcatl.psv
  /usr/share/sxm/baselines/version.txt
  /usr/share/sxm/baselines/resources_bcatp.psv
  /usr/share/sxm/baselines/cgs
  /usr/share/sxm/baselines/alerts
  /usr/share/sxm/baselines/IntegratedSportsLogos
  /usr/share/sxm/baselines/states
  /usr/share/sxm/baselines/IntegratedLogos
  /usr/share/sxm/baselines/tabweather
  /usr/share/sxm/baselines/trafficplus
  /usr/share/sxm/baselines/stocks
  /usr/share/sxm/baselines/ev
  /usr/share/sxm/baselines/contentAssociatedImage/Album020.zip
  /usr/share/sxm/baselines/gmd/GEMBase_1.15.zip
  /usr/share/sxm/baselines/parking/ParkingLocation2.zip
  /usr/share/sxm/baselines/safeview/sxm_safeviewcameralocations_v120.zip
  /usr/share/sxm/baselines/safeview/sxm_safeviewcameratypes_v120.zip
  /usr/share/sxm/baselines/IntegratedBackgroundLogos/IntPortBack160816.zip
  /usr/share/sxm/baselines/IntegratedBackgroundLogos/IntLandBack160816.zip
  /usr/share/sxm/baselines/fuel/sxm_fuelbaseline23.pvn1.zip
  /usr/share/sxm/baselines/fuel/sxm_canfuelbaseline3.pvn1.zip
  /usr/share/sxm/baselines/phonetics/T005V054.psv.zip
  /usr/share/sxm/baselines/phonetics/T000V054.psv.zip
  /usr/share/sxm/baselines/phonetics/T001V011.psv.zip
  /usr/share/sxm/baselines/phonetics/T006V011.psv.zip
  /usr/share/sxm/baselines/phonetics/T003V003.psv.zip
  /usr/share/sxm/baselines/phonetics/T004V000.psv.zip
  /usr/share/sxm/baselines/phonetics/T002V000.psv.zip
  /usr/share/sxm/baselines/movies/sxm_theatersbaseline23.pvn1.zip
  /usr/share/sxm/baselines/movies/sxm_movieratingsv0.pvn1.zip
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
sxe: 55 installed and not shipped files. [installed-vs-shipped]
ERROR: sxe-0.1-r0 do_package: Fatal QA errors found, failing task.
ERROR: sxe-0.1-r0 do_package: Function failed: do_package
ERROR: Logfile of failure stored in: /home/local/SWTECNN/rkhairulin/imx-yocto-bspIII/build-wayland-imx8qmmekII/tmp/work/aarch64-poky-linux/sxe/0.1-r0/temp/log.do_package.32253
ERROR: Task (/home/local/SWTECNN/rkhairulin/imx-yocto-bspIII/sources/meta-sxe/recipes-example/example/sxe_0.1.bb:do_package) failed with exit code '1'

我该如何解决这个问题?我应该在 ricpe 中添加什么?

【问题讨论】:

    标签: yocto bitbake recipe


    【解决方案1】:

    默认情况下,带有配方名称的包包含以下文件(请参阅here):

         FILES_${PN} = "${bindir}/* ${sbindir}/* ${libexecdir}/* ${libdir}/lib*${SOLIBS} \
                     ${sysconfdir} ${sharedstatedir} ${localstatedir} \
                     ${base_bindir}/* ${base_sbindir}/* \
                     ${base_libdir}/*${SOLIBS} \
                     ${base_prefix}/lib/udev/rules.d ${prefix}/lib/udev/rules.d \
                     ${datadir}/${BPN} ${libdir}/${BPN}/* \
                     ${datadir}/pixmaps ${datadir}/applications \
                     ${datadir}/idl ${datadir}/omf ${datadir}/sounds \
                     ${libdir}/bonobo/servers"
    

    所以 /usr/share/sxm 和 /sxe 中的文件是在 ${D} deploy 文件夹中创建的,但它们不会添加到任何包中。

    您必须将此行添加到您的食谱中(请参阅here):

    FILES_${PN} += "/sxe ${datadir}/sxm" 
    

    注意 /usr/share 定义为${datadir}


    如果您不需要这些文件,您可以将它们从 ${D} 中删除:

    do_install_append(){
         rm -r ${D}/sxe
         rm -r ${D}/${datadir}/sxm
    }
    

    【讨论】:

      【解决方案2】:

      你必须告诉 bitbake 文件应该放在哪个包中。大概是这样的

      FILES_sxe += " \
        {root_prefix}/sxe \
        {datadir}/sxe \
      "
      

      话虽如此,FHS 强烈反对将某些内容直接放在/ 下。有关预定义前缀和目录的更多信息,请查看poky/meta/conf/bitbake.conf

      【讨论】:

        猜你喜欢
        • 2015-09-26
        • 2021-10-31
        • 2021-10-29
        • 1970-01-01
        • 2020-09-30
        • 2020-07-01
        • 1970-01-01
        • 2020-01-26
        • 1970-01-01
        相关资源
        最近更新 更多