如何通过yocto在内核映像中放入一个额外的文件

问题描述 投票:0回答:1

我很难通过yocto把我的initramfs.cpio放在我的内核映像中。

我有两个bb文件,一个用于构建initramfs,另一个用于构建fitimage。我成功构建了与initramfs图像捆绑在一起的fitimage。但它总是无法在fitImage的/ usr目录中构建一个包含initramfs.cpio.gz的fitImage。 (我的意思是,当我使用fitImage启动到控制台时,我想在/ usr中看到一个名为initramfs.cpio的文件)

================================================== ==================这是我的错误信息..

ERROR: linux-mine-1_4.9.27+gitAUTOINC+d87116e608-r0 do_package: QA Issue: linux-mine: Files/directories were installed but not shipped in any package:
  /usr
  /usr/initramfs-mine-qemu.cpio
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
linux-mine: 2 installed and not shipped files. [installed-vs-shipped]
ERROR: linux-mine-1_4.9.27+gitAUTOINC+d87116e608-r0 do_package: Fatal QA errors found, failing task.
ERROR: linux-mine-1_4.9.27+gitAUTOINC+d87116e608-r0 do_package: Function failed: do_package
ERROR: Logfile of failure stored in: /home/paul/projects/Test/yocto/build/tmp/work/mine-poky-linux-gnueabi/linux-mine/1_4.9.27+gitAUTOINC+d87116e608-r0/temp/log.do_package.26149
ERROR: Task (/home/paul/projects/Test/yocto/yocto-2.2/poky/../meta-mine/recipes-kernel/linux/linux-mine_4.9.bb:do_package) failed with exit code '1'

================================================== ==================这是我的内核映像bb文件

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:"

LINUX_VERSION ?= "4.9.27"

SRCREV = "d87116e608e94ad684b5e94d46c892e33b9e2d78"
SRC_URI = "git://local/kernel;protocol=ssh;branch=master"

#FILES_${PN} += "/usr /usr/initramfs-mine-${MACHINE_ARCH}.cpio"
#FILES_${PN}-${PV} += "/usr /usr/initramfs-mine-${MACHINE_ARCH}.cpio"
#IMAGE_INSTALL = "initramfs-mine"

do_install_append () {
echo "WangPaul : S=[${S}]"
echo "WangPaul : B=[${B}]"
echo "WangPaul : D=[${D}]"
install -d ${D}/usr/
install -m 0444 ${B}/usr/initramfs-mine-${MACHINE_ARCH}.cpio ${D}/usr/
}

================================================== ==================这是我的initramfs bb文件

LICENSE = "GPLv2"

PACKAGE_INSTALL = "initramfs-live-boot ${VIRTUAL-RUNTIME_base-utils} udev ${ROOTFS_BOOTSTRAP_INSTALL}"
IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"

inherit core-image

================================================== ==================我发现了类似的问题:Ship extra files in kernel module recipeAn example of using FILES_${PN}

以上讨论的方式不起作用......

任何信息都会很感激!!谢谢 !!

linux yocto
1个回答
0
投票

错误似乎是QA问题,这意味着源代码已编译但未添加到rootfs。将以下行添加到yourkernel-image.bb。它会解决这个问题。

FILES_${PN} += "${exec_prefix}/*"

注意:可能在您的kernel.bb文件中,您提供的格式错误

© www.soinside.com 2019 - 2024. All rights reserved.