How to include any files in rootfs with YOCTO

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

How to include any files in rootfs with YOCTO

How to include any files in rootfs with YOCTO

Dear all,

Below a small howto to get rid of the usual file copy to your rootfs.

This is my way of automatically include files to my generated image under yocto.

1. Create a recipe

Under source/meta

Below in plain text:

SUMMARY = "My test videos"
DESCRIPTION = "Test Videos"
HOMEPAGE = ""
LICENSE = "CLOSED"
MY_FILES = "/home/freerod/Videos/demo_video_VGA_25fps.MP4"

inherit allarch

do_install() {
install -d ${D}${datadir}/movies
install -m 0644 ${MY_FILES} ${D}${datadir}/movies/
}

FILES_${PN} += "${datadir}/movies"

This aims at creating a movies directory in:

/usr/share/movies within the rootfs, with the named demo_video_VGA_25fps.MP4 in it

2. CORE_IMAGE_EXTRA_INSTALL += "myvideos"

3. Check that the video will be put into the generated rootfs:

freerod@ubuntu:~/mx6/fsl-yocto-3.14.28_1.0.0/build_mx6dl$ ll tmp/work/all-poky-linux/myvideos/1.0-r0/packages-split/myvideos/usr/share/movies/demo_video_VGA_25fps.MP4

-rw-r--r-- 2 freerod freerod 14076709 Jun  2 01:40 tmp/work/all-poky-linux/myvideos/1.0-r0/packages-split/myvideos/usr/share/movies/demo_video_VGA_25fps.MP4

Tags (1)
Comments

Hi Rodrigue

any idea how do i place/include the file in different partition of SD card like Fat Partition.

Thanks

Niranjan 

%3CLINGO-SUB%20id%3D%22lingo-sub-1123386%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHow%20to%20include%20any%20files%20in%20rootfs%20with%20YOCTO%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1123386%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EDear%20all%2C%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EBelow%20a%20small%20howto%20to%20get%20rid%20of%20the%20usual%20file%20copy%20to%20your%20rootfs.%3C%2FP%3E%3CP%3EThis%20is%20my%20way%20of%20automatically%20include%20files%20to%20my%20generated%20image%20under%20yocto.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E1.%20Create%20a%20recipe%3C%2FP%3E%3CP%3EUnder%20source%2Fmeta%3C%2FP%3E%3CP%3EBelow%20in%20plain%20text%3A%3C%2FP%3E%3CP%20style%3D%22padding-left%3A%2030px%3B%22%3ESUMMARY%20%3D%20%22My%20test%20videos%22%3CBR%20%2F%3EDESCRIPTION%20%3D%20%22Test%20Videos%22%3CBR%20%2F%3EHOMEPAGE%20%3D%20%22%22%3CBR%20%2F%3ELICENSE%20%3D%20%22CLOSED%22%3CBR%20%2F%3EMY_FILES%20%3D%20%22%2Fhome%2Ffreerod%2FVideos%2Fdemo_video_VGA_25fps.MP4%22%3C%2FP%3E%3CP%20style%3D%22padding-left%3A%2030px%3B%22%3Einherit%20allarch%3C%2FP%3E%3CP%20style%3D%22padding-left%3A%2030px%3B%22%3Edo_install()%20%7B%3CBR%20%2F%3E%20install%20-d%20%24%7BD%7D%24%7Bdatadir%7D%2Fmovies%3CBR%20%2F%3E%20install%20-m%200644%20%24%7BMY_FILES%7D%20%24%7BD%7D%24%7Bdatadir%7D%2Fmovies%2F%3CBR%20%2F%3E%7D%3C%2FP%3E%3CP%20style%3D%22padding-left%3A%2030px%3B%22%3EFILES_%24%7BPN%7D%20%2B%3D%20%22%24%7Bdatadir%7D%2Fmovies%22%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EThis%20aims%20at%20creating%20a%20movies%20directory%20in%3A%3C%2FP%3E%3CP%3E%2Fusr%2Fshare%2Fmovies%20within%20the%20rootfs%2C%20with%20the%20named%20demo_video_VGA_25fps.MP4%20in%20it%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E2.%20CORE_IMAGE_EXTRA_INSTALL%20%2B%3D%20%22myvideos%22%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E3.%20Check%20that%20the%20video%20will%20be%20put%20into%20the%20generated%20rootfs%3A%3C%2FP%3E%3CP%3E%3CA%20href%3D%22mailto%3Afreerod%40ubuntu%3A~%2Fmx6%2Ffsl-yocto-3.14.28_1.0.0%2Fbuild_mx6dl%24%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3Efreerod%40ubuntu%3A~%2Fmx6%2Ffsl-yocto-3.14.28_1.0.0%2Fbuild_mx6dl%24%3C%2FA%3E%20ll%20tmp%2Fwork%2Fall-poky-linux%2Fmyvideos%2F1.0-r0%2Fpackages-split%2Fmyvideos%2Fusr%2Fshare%2Fmovies%2Fdemo_video_VGA_25fps.MP4%3C%2FP%3E%3CP%3E-rw-r--r--%202%20freerod%20freerod%2014076709%20Jun%26nbsp%3B%202%2001%3A40%20tmp%2Fwork%2Fall-poky-linux%2Fmyvideos%2F1.0-r0%2Fpackages-split%2Fmyvideos%2Fusr%2Fshare%2Fmovies%2Fdemo_video_VGA_25fps.MP4%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1123387%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20How%20to%20include%20any%20files%20in%20rootfs%20with%20YOCTO%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1123387%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20_jive_internal%3D%22true%22%20class%3D%22%22%20data-content-finding%3D%22Community%22%20data-userid%3D%22204706%22%20data-username%3D%22Rodrigue%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fpeople%2FRodrigue%22%20style%3D%22color%3A%20%235e89c1%3B%20background-color%3A%20%23ffffff%3B%20border%3A%200px%3B%20font-weight%3A%20600%3B%20text-decoration%3A%20none%3B%20font-size%3A%2011.9994px%3B%22%20target%3D%22_blank%22%3ERodrigue%3C%2FA%3E%3C%2FP%3E%3CP%3Eany%20idea%20how%20do%20i%20place%2Finclude%20the%20file%20in%20different%20partition%20of%20SD%20card%20like%20Fat%20Partition.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3CP%3ENiranjan%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
No ratings
Version history
Last update:
‎06-01-2015 06:51 AM
Updated by: