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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

Jump to solution
12,203 Views
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

Labels (1)
Tags (3)
1 Solution
2,273 Views
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.

View solution in original post

0 Kudos
3 Replies
2,274 Views
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 Kudos
2,273 Views
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,273 Views
fresxc
Contributor I

:smileyhappy:

0 Kudos