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

我有一个麻烦的做法是将我的initramfs.cpio放入我的内核映像中。如何通过yocto将额外的文件放入内核映像中

我有两个bb文件,一个用于构建initramfs,另一个用于构建fitimage。 我成功地构建了捆绑在我的initramfs映像中的fitimage。 但是,它总是无法构建fitImage中的/ usr目录中具有initramfs.cpio.gz的fitImage。 (我的意思是,我希望看到的/ usr命名initramfs.cpio当我用我fitImage引导到控制台文件)

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

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 recipe和 An example of using FILES_${PN}

的方式aboves讨论都无法正常工作......

的任何信息将被赞赏! 谢谢!

回答:

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

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

注:可能是你kernel.bb文件你给错了格式

以上是 如何通过yocto将额外的文件放入内核映像中 的全部内容, 来源链接: utcz.com/qa/261459.html

回到顶部