首页 > 解决方案 > Yocto 无法将文件复制到 rootfs 的根路径

问题描述

我只使用 yocto build 将文件复制到 rootfs 时遇到问题,我不需要编译这些文件,包括一些二进制文件和 .sh 文件。当我运行 bitbake 时,错误说它无法安装软件包,下一个警告是:在日志文件中:

错误:无法安装软件包。命令'/home/ubuntu20/openstlinux-5.4-dunfell-mp1-20-11-12/build-openstlinuxcv-stm32mp1-ground4-mx/tmp-glibc/work/stm32mp1_ground4_mx-ostl-linux-gnueabi/st-image-minimal /1.0-r0/recipe-sysroot-native/usr/bin/apt-get install --force-yes --allow-unauthenticated --no-remove apt csr csr-mergefiles dpkg packagegroup-base-extended packagegroup-core-boot packagegroup-core-eclipse-debug packagegroup-core-ssh-dropbear packagegroup-core-tools-profile packagegroup-framework-core packagegroup-framework-core-base packagegroup-framework-minimal-tools packagegroup-framework-minimal-tools-base powerbutton resize-helper run-postinsts' 返回 100:

以及很多这样的输出:

Selecting previously unselected package util-linux-whereis:armhf.
Preparing to unpack .../util-linux-whereis_2.35.1-r0.0_armhf.deb ...
Unpacking util-linux-whereis:armhf (2.35.1-r0.0) ... dpkg: warning:
overriding problem because --force enabled: dpkg: warning: package
architecture (armhf) does not match system (amd64)

如果我添加PACKAGE_ARCH = "armhf"

有错误

没有为此配方生成清单

也许以前有人遇到过这个问题?

SUMMARY = "csr copy the application files "
DESCRIPTION = "Recipe created by bitbake-layers"

LICENSE="CLOSED"
LIC_FILES_CHKSUM=""

inherit bin_package

FILESEXTRAPATHS_prepend := "${THISDIR}:"
RDEPENDS_${PN} += "bash"


# PACKAGE_ARCH = "armhf"

# change this URI if you plan to fork the repository or use an alternate repository
SRC_URI = "git://git@#############.git;protocol=ssh"
# this SRCREV determines the branch or tag to be used
SRCREV = "master"


PV = "1.0-git-${SRCREV}"
S="${WORKDIR}/git"


do_install_append() {

  install -d ${D}/usr/csr/dwnld/
  install -d ${D}/usr/csr/files/
  install -d ${D}/usr/bin/boot_proc/
  install -d ${D}/lib/firmware/
  install -d ${D}/etc/
  install -d ${D}/etc/default/
  install -d ${D}/etc/init.d/
  install -d ${D}/etc/logrotate.d/
  install -d ${D}/etc/systemd/system/

  install -m 0755 ${S}/fs/lib/firmware/* ${D}/lib/firmware
  install -m 0755 ${S}/fs/usr/bin/boot_proc/csr_init.py ${D}/usr/bin/boot_proc/
  install -m 0755 ${S}/fs/usr/csr/dwnld/* ${D}/usr/csr/dwnld
  install -m 0755 ${S}/fs/usr/csr/files/* ${D}/usr/csr/files

  install -m 0755 ${S}/fs/etc/crontab ${D}/etc
  install -m 0755 ${S}/fs/etc/profile ${D}/etc
  install -m 0755 ${S}/fs/etc/syslog.conf ${D}/etc
  install -m 0755 ${S}/fs/etc/wpa_supplicant.CSR.conf ${D}/etc

  install -m 0755 ${S}/fs/etc/default/* ${D}/etc/default
  install -m 0755 ${S}/fs/etc/init.d/* ${D}/etc/init.d
  install -m 0755 ${S}/fs/etc/logrotate.d/* ${D}/etc/logrotate.d
  install -m 0755 ${S}/fs/etc/systemd/system/* ${D}/etc/systemd/system

}

do_package_qa (){
}

FILES_${PN} += "/usr/csr/dwnld/*"
FILES_${PN} += "/usr/csr/files/*"
FILES_${PN} += "/usr/bin/boot_proc/*"
FILES_${PN} += "/etc/*"
FILES_${PN} += "/etc/default/*"
FILES_${PN} += "/lib/firmware/*"
FILES_${PN} += "/etc/init.d/*"
FILES_${PN} += "/etc/logrotate.d/*"
FILES_${PN} += "/etc/systemd/system/*"

标签: yoctoyocto-recipe

解决方案


推荐阅读