The “test” file is copied successfully into the rootfs (under the folder /work) on my target, but the file nico.tar.gz gives me a problem: bitbake says the following error message:
Log data follows:
| DEBUG: Executing shell function do_install
| install: cannot stat ‘/work/apalis/oe-core-misa/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/misa-files/1.0.1-r0/nico.tar.gz’: No such file or directory
If on the above recipe I specify not to unpack the file nico.tar.gz by setting:
Without “unpack=0” I was expecting bitbake to extract the tar.gz to the ${WORKDIR} and have the extracted file into my rootfs, but apparently it can’t find the nico.tar.gz file into the ${WORKDIR}.
Without “unpack=0” I was expecting bitbake to extract the tar.gz to the ${WORKDIR} and have the extracted file into my rootfs, but apparently it can’t find the nico.tar.gz file into the ${WORKDIR}.
That assumption is wrong. The fetcher by default unpacks into ${WORKDIR}.
I guess you have some options here:
Use unpack=0 in the SRC_URI and unpack the sources by hand in the do_install task. Possibly you have to chown ${D} recursively afterwards to get around some warnings:
| WARNING: QA Issue: qtbase: /qtbase-dev/usr/lib/libqtfreetype.prl is owned by
| uid 1000, which is the same as the user running bitbake. This may be due to
| host contamination [host-user-contaminated]
tar xf nico.tar.gz -C ${D}/work
Have the fetcher unpack the tar file and add an install line for each individual file.
Create the tar file with a toplevel directory and have the fetcher unpack the tar file. In do_unpack recursively copy it to ${D}.
cp -r ${WORKDIR}toplevel/* ${D}/work/
Untested, might give a conflict: Trick the fetcher to unpack the tar file in the way to want it by creating your tar file with a directory structure so that it unpacked matches what you want to have.
If I do “install -m 0755 ${WORKDIR}/nico.tar.gz ${D}/work” inside do_install(), without using unpack=0, then the fetcher (inside do_fetch()) will first unpack the file into ${WORKDIR}, and then my install instruction will not work because it will not find the nico.tar.gz file under ${WORKDIR} to copy to ${D}/work/. This is the error I am seeing in bitbake.
By removing my instruction “install -m 0755 ${WORKDIR}/nico.tar.gz ${D}/work” from inside do_install(), the error will be gone, and the do_fetch() will unpack my tar.gz inside ${WORKDIR}.
The next thing to do is to recursively copy the unpacked tar.gz file into my ${D}/work. (your option 3).
Where should this copy take place ? Inside do_unpack, or do_install or somewhere else ? Is the order important ? I guess do_unpack is executed before do_install and my /work dir is only created inside do_install.