我有一個麻煩的做法是將我的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討論都無法正常工作......
的任何信息將被讚賞! 謝謝!
我不知道你嘗試acheive什麼。你在這裏看過[手冊](http://www.yoctoproject.org/docs/2.2/mega-manual/mega-manual.html#var-INITRAMFS_IMAGE)嗎?如果需要,您可以在freenode上加入#yocto獲取更多幫助。 – Nayfe
嗨@Nayfe,感謝您的信息~~,我已經閱讀了手冊,並且我可以創建一個fitimage捆綁ramdisk。但這不是我想要的。我想要一個fitimage而不捆綁ramdisk。然後將其閃存到我的設備,啓動,最後,我希望我的/ usr目錄有一個cpio文件。 – user3610309
你有沒有嘗試過addint T優內核映像BB FILES _ $ {PN} + =「/usr/initramfs-mine-${MACHINE_ARCH}.cpio」 讓我知道如果這能幫助,如果是這樣,我將發佈答案。 –