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

Paul Eggleton paul.eggleton at linux.intel.com
Tue Nov 1 13:00:21 PDT 2016


On Tue, 01 Nov 2016 18:45:02 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
> | WARNING:
> | /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, 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, 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.

Also:

* 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 
command.

* 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.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



More information about the yocto mailing list