代码之家  ›  专栏  ›  技术社区  ›  PhilBot

yocto自定义图像配方未将文件安装到最终rootfs中

  •  0
  • PhilBot  · 技术社区  · 7 年前

    我已经写了一个自定义的yocto bitback食谱,我已经贴在下面。我做了一个特定的rootfs_后处理_命令,如下所示,作为包含这个配方的完整映像构建的一部分。目前,图像正在执行image do_rootfs步骤,因为 tiinit_11.8.32-115200_no_dsm-ti_p2.136.bts rootfs目录中缺少文件。

    cleanup_ble_baud_rate_function() {
        mv ${IMAGE_ROOTFS}/lib/firmware/ti-connectivity/TIInit_11.8.32-115200_no_dsm-TI_P2.136.bts ${IMAGE_ROOTFS}/lib/firmware/ti-connectivity/TIInit_11.8.32.bts
    }
    
    ROOTFS_POSTPROCESS_COMMAND_append_am57xx-phycore-rdk_arago = " cleanup_ble_baud_rate_function;"
    

    食谱如下:

    DESCRIPTION = "Bluetooth Daemon and DBus Service"
    LICENSE = "BU-License"
    LIC_FILES_CHKSUM = "file://${CUSTOM_LAYER_DIR}/licenses/${LICENSE};md5=d41d8cd98f00b204e9800998ecf8427e"
    
    # We depend on python and dbus
    RDEPENDS_${PN} += "libedit bluez5"
    DEPENDS += "libedit bluez5"
    
    PACKAGE_ARCH = "${MACHINE_ARCH}"
    
    PR = "r1"
    
    SRC_URI += "file://bluetooth.service \
           file://bluetooth.socket \
           file://ble-service.py \
           file://setup-bluetooth-radio.sh \
               file://TIInit_11.8.32-115200_no_dsm-TI_P2.136.bts \locate
    "
    
    S = "${WORKDIR}"
    
    PACKAGES = "${PN}"
    
    FILES_${PN} += "/lib/"
    FILES_${PN} += "/lib/firmware/"
    FILES_${PN} += "/lib/firmware/ti-connectivity/"
    FILES_${PN} += "/lib/firmware/ti-connectivity/TIInit_11.8.32-115200_no_dsm-TI_P2.136.bts"
    
    do_install() {
      install -d ${D}${bindir}
      install -m 755 ble-service.py ${D}${bindir}
      install -m 755 setup-bluetooth-radio.sh ${D}${bindir}
    
      install -d ${D}/lib/firmware/ti-connectivity
      install -m 755 TIInit_11.8.32-115200_no_dsm-TI_P2.136.bts ${D}/lib/firmware/ti-connectivity/
    
      install -d ${D}${sysconfdir}/systemd/system
      install -d ${D}${sysconfdir}/systemd/system/multi-user.target.wants
      install -m 0644 ${S}/bluetooth.service ${D}${sysconfdir}/systemd/system
      ln -s ../bluetooth.service ${D}${sysconfdir}/systemd/system/multi-user.target.wants/bluetooth.service
    
      # Actually use socket based activation for this service
      install -d ${D}${sysconfdir}/systemd/system/sysinit.target.wants
      ln -s ../bluetooth.service ${D}${sysconfdir}/systemd/system/sysinit.target.wants/bluetooth.service
    }
    

    当映像构建失败后,当我执行Linux时 更新文件数据库 定位 命令,将显示以下结果:

    name@machine:/am57xx/build(master)>sudo updatedb
    name@machine:~/am57xx/build(master)>locate TIInit_11.8.32-115200_no_dsm-TI_P2.136.bts /home/name/am57xx/build/tmp-external-linaro-toolchain/sysroots/am57xx-phycore-rdk/lib/firmware/ti-connectivity/TIInit_11.8.32-115200_no_dsm-TI_P2.136.bts
    /home/name/am57xx/build/tmp-external-linaro-toolchain/work/am57xx_phycore_rdk-linux-gnueabi/ble-service/1.0-r1/TIInit_11.8.32-115200_no_dsm-TI_P2.136.bts
    /home/name/am57xx/build/tmp-external-linaro-toolchain/work/am57xx_phycore_rdk-linux-gnueabi/ble-service/1.0-r1/image/lib/firmware/ti-connectivity/TIInit_11.8.32-115200_no_dsm-TI_P2.136.bts
    /home/name/am57xx/build/tmp-external-linaro-toolchain/work/am57xx_phycore_rdk-linux-gnueabi/ble-service/1.0-r1/package/lib/firmware/ti-connectivity/TIInit_11.8.32-115200_no_dsm-TI_P2.136.bts
    /home/name/am57xx/build/tmp-external-linaro-toolchain/work/am57xx_phycore_rdk-linux-gnueabi/ble-service/1.0-r1/packages-split/ble-service/lib/firmware/ti-connectivity/TIInit_11.8.32-115200_no_dsm-TI_P2.136.bts
    /home/name/am57xx/build/tmp-external-linaro-toolchain/work/am57xx_phycore_rdk-linux-gnueabi/ble-service/1.0-r1/sysroot-destdir/lib/firmware/ti-connectivity/TIInit_11.8.32-115200_no_dsm-TI_P2.136.bts
    /home/name/am57xx/layers/meta-custom/recipes-networking/ble-service/files/TIInit_11.8.32-115200_no_dsm-TI_P2.136.bts
    
    1 回复  |  直到 7 年前
        1
  •  1
  •   Peter Buelow    7 年前

    我同意Oleksandr的观点。不要使用后处理命令,它可能不会执行您的想法。相反,只要确保您使用了$s,您的文件pn就可以简单得多。

    install -m 755 ${S}/TIInit_11.8.32-115200_no_dsm-TI_P2.136.bts ${D}/lib/firmware/ti-connectivity/
    
    FILES_${PN} += "${libdir}/firmware/ti-connectivity/*"
    

    在tmp/work/target/recipename中调试您的配方安装将帮助您了解事情的发展方向。