[yocto] Adding test files to an image

jfabernathy jfabernathy at gmail.com
Thu Mar 8 12:44:19 PST 2012


On 03/08/2012 11:57 AM, Autif Khan wrote:
>> 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}/*"
I have some issues that seem to be related to where everything gets 
unpacked and where it thinks it needs to install from.

Below is my recipe file name "myvideos_1.0.bb"

DESCRIPTION = "my video test files"
SECTION = "examples"
LICENSE = "CLOSED"

MY_DESTINATION = "/home/root/myvideos"

SRC_URI = "file://myvideos_1.0/myvideos-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}/*"


I have the myvideo-1.0.tar.gz file in the myvideos_1.0 directory, same 
level as the recipe in a directory call myvideos.

The error I'm getting is :
Log data follows:
| ERROR: Function failed: do_install (see 
/build/sugarbay-master/tmp/work/x86_64-poky-linux/myvideos-1.0-r0/temp/log.do_install.9051 
for further information)
| install: cannot stat 
`/build/sugarbay-master/tmp/work/x86_64-poky-linux/myvideos-1.0-r0/myvideos-1.0/*': 
No such file or directory
NOTE: package myvideos-1.0-r0: task do_install: Failed
ERROR: Task 2 
(/home/jim/poky/meta-jfa/recipes-jfa/myvideos/myvideos_1.0.bb, 
do_install) failed with exit code '1'
NOTE: Tasks Summary: Attempted 651 tasks of which 644 didn't need to be 
rerun and 1 failed.


The tar.gz is getting unpacked in the 
..tmp/work/x86_64-poky-linux/myvideos-1.0-r0 directory per the unpack 
log file below:

NOTE: Unpacking 
/home/jim/poky/meta-jfa/recipes-jfa/myvideos/myvideos_1.0/myvideos-1.0.tar.gz 
to /build/sugarbay-master/tmp/work/x86_64-poky-linux/myvideos-1.0-r0/

The critical parts of the run.do_install is below:

do_install() {
     base_do_install
         install -d 
/build/sugarbay-master/tmp/work/x86_64-poky-linux/myvideos-1.0-r0/image/home/root/myvideos
         install -m 0644  
/build/sugarbay-master/tmp/work/x86_64-poky-linux/myvideos-1.0-r0/myvideos-1.0/* 
/build/sugarbay-master/tmp/work/x86_64-poky-linux/myvideos-1.0-r0/image/home/root/myvideos

}

base_do_install() {
     :

}

cd 
/build/sugarbay-master/tmp/work/x86_64-poky-linux/myvideos-1.0-r0/myvideos-1.0
do_install

-------------------------
So it looks like it unpacks it one place, but is looking to install from 
somewhere else. I'm just not sure how all the S and D variables are set 
and what they do.

Jim A




More information about the yocto mailing list