[yocto] Adding test files to an image

Autif Khan autif.mlist at gmail.com
Thu Mar 8 08:57:26 PST 2012


> Suppose I want to build the meta-intel/meta-sugarbay image and also include
> some video and audio files into the /home/root directory to facilitate
> testing of the video and audio players.
>
> Can I include these files in a recipe somewhere?

I use the recipe at the end of this message to include whatever I
want. This recipe has to be added to the image - I have a custom
image, so it goes in there. I am sure a recipe can be added to
something in local.conf - I just do not know that variable. My guess
it is IMAGE_IMSTALL += "mypics".

Regardless ...

mypics-1.0.tar.gz contains a file called COPYING and its mds5um on the
2nd line. It can be replaced with a license from common licenses
directory - but at the time when I wrote this recipe, I did not know
how to do that. Anything that goes in there ends up in
/home/root/mypics.

It can probably be tweaked to look better - I am sure SRC_URI line is
not perfect. But it seems to work between Edison to master

For larger files - like video worth 200MB or so, I just store them on
a hard disk and mount manually on /media/hdd or where-ever. Not that
it wont work in this recipe, just that it would take longer to build
the image etc.

All the best. Hopefully, this will get you started in the right direction.

LICENSE = "MyLic"
LIC_FILES_CHKSUM = "file://COPYING;md5=697172b05e4bff0a2421579697ba5653"

MY_DESTINATION = "/home/root/mypics"

SRC_URI = "file://mypics-1.0/mypics-1.0.tar.gz"

do_install_append() {
        install -d ${D}${MY_DESTINATION}
        install -m 0644  ${S}/* ${D}${MY_DESTINATION}
}

PR = "r0"

FILES_${PN} += "${MY_DESTINATION}/*"



More information about the yocto mailing list