Is there a way I can ship more files when building an out of tree kernel module?
I have tried something like this:
FILES_${PN} += "${bindir}/my_program"
do_install_append() {
install -d ${D}${bindir}
install -m 0755 ${D}/my_program ${D}${bindir}/my_program
}
And like this:
FILES_kernel-module-${PN} += "${bindir}/my_program"
do_install_append() {
install -d ${D}${bindir}
install -m 0755 ${D}/my_program ${D}${bindir}/my_program
}
But still complains:
ERROR: QA Issue: my-module: Files/directories were installed but not shipped in any package:
/usr
/usr/bin
/usr/bin/my_program
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
my-module: 3 installed and not shipped files. [installed-vs-shipped]
This is quite common situation - you have installed additional binary but it hasn't been added to output package (installed but not shipped).
Solution should be based on type of file that you need to add to output image.
Check this thread: 2 step solution to ERROR: QA Issue: Files/directories were installed but not shipped
Also if you need to quickly verify if the files were properly build etc., you can just add this line in your build/local.conf (as you have already installed them):
IMAGE_INSTALL += "{binary_name}"
Edit:
In addition to below comment from OP: Sorry for my misunderstanding, it looks that you need to inherit module.bbclass in your recipe, check out the doc: Yocto Mega Manual - module.bbclass and let me know if this suits you. You can also check this simple tutorial: Howto build a kernel module out of the kernel tree
FILES_${PN} can't be used for kernel recipes, since for the kernel at least by default ${PN} does not appear in PACKAGES. "kernel-module-${PN}" isn't valid either. I'm guessing you'd want to add the file to the kernel-base package like so:
FILES_kernel-base += "${bindir}/my_program"
I don't believe that module.bbclass removes ${PN} from PACKAGES but it does clear FILES_${PN}. So if you want to add any files to your package, you must set FILES_${PN} after inheriting module.
来源:https://stackoverflow.com/questions/37118062/ship-extra-files-in-kernel-module-recipe