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,808件の閲覧回数
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,878件の閲覧回数
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,879件の閲覧回数
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,878件の閲覧回数
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,878件の閲覧回数
fresxc
Contributor I

:smileyhappy:

0 件の賞賛
返信