[yocto] how to copy a tar file to Root file system

Swapna.Gurumani at microchip.com Swapna.Gurumani at microchip.com
Wed Nov 2 13:50:43 PDT 2016

Thank you to Paul Eggleton, Daniel and Ross Burton.
I was able to solve by miseries by adding the following line to my miseries:

FILES_${PN}-staticdev = "/opt/crank/linux-sama5d-armle-fbdev-obj/lib/*.a"


From: Daniel. [mailto:danielhilst at gmail.com]
Sent: Tuesday, November 01, 2016 1:18 PM
To: Paul Eggleton <paul.eggleton at linux.intel.com>
Cc: Swapna Gurumani - C40450 <Swapna.Gurumani at microchip.com>; yocto at yoctoproject.org
Subject: Re: [yocto] how to copy a tar file to Root file system

I have an example of a recipe exploding a tar here: https://gist.github.com/gkos/02eccb8e1e02312327aa6db6cdc9d501
The tar is used as a source. So the bitbake explodes it to ${WORKDIR} and I simply copy it to /opt
I hope that this helps :)

2016-11-01 18:00 GMT-02:00 Paul Eggleton <paul.eggleton at linux.intel.com<mailto:paul.eggleton at linux.intel.com>>:
On Tue, 01 Nov 2016 18:45:02 Swapna.Gurumani at microchip.com<mailto:Swapna.Gurumani at microchip.com> wrote:
> Every step I take close, I take 2 back :(
> My bb now looks like the one attached. I had to add each folder for
> FILES_${PN} contrary to your advice otherwise I got the following error:
> ERROR: crank-1.0-r2 do_package: QA Issue: crank: Files/directories were
> installed but not shipped in any package: /opt
>   /opt/crank
> Please set FILES such that these items are packaged. Alternatively if they
> are unneeded, avoid installing them or delete them within do_install.
> crank: 2 installed and not shipped files. [installed-vs-shipped]
> I am now getting the following error:
> ERROR: crank-1.0-r2 do_install: Function failed: do_install (log file is
> located at
> /home/swapna/workspace/work/yocto/poky/build-atmel/tmp/work/cortexa5hf-neon
> -poky-linux-gnueabi/crank/1.0-r2/temp/log.do_install.26457) ERROR: Logfile
> of failure stored in:
> /home/swapna/workspace/work/yocto/poky/build-atmel/tmp/work/cortexa5hf-neon
> -poky-linux-gnueabi/crank/1.0-r2/temp/log.do_install.26457
> Log data follows:
> | DEBUG: Executing shell function do_install
> | cp: cannot stat
> | '/home/swapna/workspace/work/yocto/poky/build-atmel/tmp/work/cortexa5hf-n
> | eon-poky-linux-gnueabi/crank/1.0-r2/crank': No such file or directory
> | /home/swapna/workspace/work/yocto/poky/build-atmel/tmp/work/cortexa5hf-ne
> | on-poky-linux-gnueabi/crank/1.0-r2/temp/run.do_install.26457:1 exit 1 from
> | 'cp -a --no-preserve=ownership
> | /home/swapna/workspace/work/yocto/poky/build-atmel/tmp/work/cortexa5hf-ne
> | on-poky-linux-gnueabi/crank/1.0-r2/crank
> | /home/swapna/workspace/work/yocto/poky/build-atmel/tmp/work/cortexa5hf-ne
> | on-poky-linux-gnueabi/crank/1.0-r2/image/opt/' ERROR: Function failed:
> | do_install (log file is located at
> | /home/swapna/workspace/work/yocto/poky/build-atmel/tmp/work/cortexa5hf-ne
> | on-poky-linux-gnueabi/crank/1.0-r2/temp/log.do_install.26457)
> ERROR: Task 1082
> (/home/swapna/workspace/work/yocto/meta-atmel/qt5-layer/recipes-qt/apps/cra
> nk_1.0.bb<http://nk_1.0.bb>, do_install) failed with exit code '1' NOTE: Tasks Summary:
> Attempted 3806 tasks of which 3805 didn't need to be rerun and 1 failed. No
> currently running tasks (3034 of 4662)
> Summary: 1 task failed:
> /home/swapna/workspace/work/yocto/meta-atmel/qt5-layer/recipes-qt/apps/cran
> k_1.0.bb<http://k_1.0.bb>, do_install Summary: There was 1 WARNING message shown.
> Summary: There was 1 ERROR message shown, returning a non-zero exit code.
> Also if I look into the
> /home/swapna/workspace/work/yocto/poky/build-atmel/tmp/work/cortexa5hf-neon-
> poky-linux-gnueabi/crank/1.0-r2 It is empty.

There's something strange going on here, because the path you have just given
is ${WORKDIR} - and that shouldn't be able to be empty at this point. If
nothing else there should be a "temp" directory under it containing logs if
*any* tasks have run. Surely you have skipped out some steps between when it
was working and now? I notice the tarball name changed - did you regenerate it
or just rename it?

In any case, when debugging situations like this it helps to make a fresh
start - run "bitbake -c clean crank" (you don't need -c cleansstate because
being stuck at do_install you haven't got to any real sstate tasks yet). Then
methodically run through each task - when do_unpack ran what got unpacked into
${WORKDIR}? If that's as expected, what got put into ${D} (which is the
"image" subdirectory under ${WORKDIR})? Does what's in ${D} match up with the
layout you expect to be on the target? At any time you can use
"bitbake -e crank | less" to inspect the value of variables. You can also see
exactly what commands got run within the task by looking at the run.do_* files
under "temp" in the workdir.


* That third line "install -m ..." you now have in do_install won't work and
in any case isn't necessary since you are already copying that with the cp

* Based on what you've said earlier, your S value cannot be correct - it may
not matter, but it might as well be fixed anyway. If the tarball unpacks a
"crank" subdirectory then it should be set to "${WORKDIR}/crank".

* There's no need to set the PR value, in fact doing so only serves to keep
changing ${WORKDIR} which will potentially get in the way of debugging, so I'd
suggest not doing that.

* Setting DEPENDS isn't really doing you any good - DEPENDS is for build-time
dependencies. You're only unpacking a tarball, you don't need any build-time
dependencies to speak of. If you have runtime dependencies then set them in
RDEPENDS_${PN} since that's where runtime dependencies need to be set.

* As another responder pointed out, the inherit of pkgconfig isn't needed -
you don't need pkg-config for anything being done here.



Paul Eggleton
Intel Open Source Technology Centre
yocto mailing list
yocto at yoctoproject.org<mailto:yocto at yoctoproject.org>

"Do or do not. There is no try"
  Yoda Master
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20161102/d3b7ac27/attachment.html>

More information about the yocto mailing list