Hi There,
We have miscellaneous files in various directories that we would like to have added to the Yocto image. The directory structure is as follows
/files/etc/
/files/home/root
/files/bin/
and so forth. What I would like to have done every time the image is built is to simply run a "cp -a files/* [yocto rootfs dir]" after all the other packages are installed / populated. I tried creating a recipe as shown below
PROVIDES = "jtq-rootfs"
RPROVIDES_${PN} += "${PN}"
do_install() {
rsync -a --exclude=.svn ${JTQ_SRC}/files/* ${D}
}
LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://${THISDIR}/license;md5=8cf8463b34caa8ac871a52d5dd7ad1ef"
That added in the files initially, but after modifying the files it did not get updated properly on the file system image (even after running bitbake jtq-rootfs -c compile -fv). Clearly this is not the right way to do it.
Any hints on what would be the correct way ?
Thanks in advance
/Otto
已解决! 转到解答。
The method mentioned should work correctly. However, since Yocto is not designed for development but rather for distribution it won’t strictly follow up on files being changed. You would need to clean and then bake again so make sure that the changes are reflected.
$ bitbake –c clean <IMAGE>
$ bitbake <IMAGE>
Please try it and let us know if it works.
The method mentioned should work correctly. However, since Yocto is not designed for development but rather for distribution it won’t strictly follow up on files being changed. You would need to clean and then bake again so make sure that the changes are reflected.
$ bitbake –c clean <IMAGE>
$ bitbake <IMAGE>
Please try it and let us know if it works.
Hi There, We found that adding - IMAGE_PREPROCESS_COMMAND += " rsync -a --exclude=.svn ${FILE_SRC}/rootfs/* ${WORKDIR}/rootfs ; " to the image recipe is the most straight-forward and least headache prone method so far. Thanks for your help /Otto