gpt4 book ai didi

linux - Yocto Custom Image Recipe 不会将文件安装到最终的 rootfs 中

转载 作者:太空宇宙 更新时间:2023-11-04 10:06:51 26 4
gpt4 key购买 nike

我已经编写了一个自定义的 Yocto Bitbake 食谱,并粘贴在下方。我执行了如下所示的某个 ROOTFS_POSTPROCESS_COMMAND 作为包含此配方的完整镜像构建的一部分。目前,镜像是在镜像 do_rootfs 步骤中,因为 rootfs 目录中缺少 TIInit_11.8.32-115200_no_dsm-TI_P2.136.bts 文件。

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 updatedblocate 命令时,显示以下结果:

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

最佳答案

我同意 Oleksandr 在这一点上的观点。不要使用 postprocess 命令,它可能不会按照您的想法进行。相反,只需确保您使用 ${S} 并且您的 FILES_${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 中调试你的 recipe install 将帮助你弄清楚事情的进展。

关于linux - Yocto Custom Image Recipe 不会将文件安装到最终的 rootfs 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51949775/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com