What is the proper way to add miscellaneous files to Yocto rootfs ?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

What is the proper way to add miscellaneous files to Yocto rootfs ?

跳至解决方案
12,420 次查看
ottob
Contributor IV

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

标签 (1)
标记 (3)
1 解答
2,490 次查看
gusarambula
NXP TechSupport
NXP TechSupport

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.

在原帖中查看解决方案

0 项奖励
回复
3 回复数
2,491 次查看
gusarambula
NXP TechSupport
NXP TechSupport

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.

0 项奖励
回复
2,490 次查看
ottob
Contributor IV

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

2,490 次查看
fresxc
Contributor I

:smileyhappy:

0 项奖励
回复