How to include any files in rootfs with YOCTO

Document created by Rodrigue Simonneau Employee on Jun 1, 2015Last modified by Rodrigue Simonneau Employee on Sep 8, 2015
Version 3Show Document
  • View in full screen mode

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

4 people found this helpful

Attachments

    Outcomes