Hi,
Thank you all for your contribution to this thread.
Following this, here's what I have tried so far that HAS NOT worked.
1. The initial code of this post as a separate recipe.
2. The initial code of this post as a .bbappend.
3. The example shown here:
http://embeddedguruji.blogspot.com/2019/02/yocto-recipe-to-copy-single-file-on.html
4. The format of the recipe as shown here:
https://stackoverflow.com/questions/62635557/add-files-to-system-image-in-yocto
5. Other similar scripts around StackOverflow
Basically, none of them showed usage of adding the S=${WORKDIR} line.
Upon using it, the files transferred to the rootfs build successfully.
First thing I tried was the following recipe with an absolute path:
```
SUMMARY = "filesystem"
DESCRIPTION = "Copy gui and relevant scripts"
LICENSE = "CLOSED"
inherit allarch
MY_FILES =
/home/<user>/oe-core/layers/meta-custom-gui/recipes-gui/gui/files"
do_install() {
install -d {D}/etc
install -m 0755 ${MY_FILES}/fb.modes ${D}/etc
# Same thing for other files
}
FILES_${PN} += " \
/etc \
# Same thing for other files
"
Then in build/local.conf: CORE_IMAGE_EXTRA_INSTALL += " filesystem "
```
And this recipe worked.
So I figured it probably has to do with the pathing, so rewrote my initial
code by adding S=${WORKDIR} like you all suggested, here is my final
working recipe.
```
SUMMARY = "filesystem"
DESCRIPTION = "Copy gui and relevant scripts"
LICENSE = "CLOSED"
SRC_URI += " \
file://qt_app \
file://startup.sh \
file://fb.modes \
"
S = "${WORKDIR}"
do_install() {
install -d 0644 ${D}/home/root
install -m 0755 ${WORKDIR}/qt_app ${D}/home/root
install -d 0644 ${D}/etc/init.d
install -m 0755 ${WORKDIR}/startup.sh ${D}/etc/init.d
install -m 0755 ${WORKDIR}/fb.modes ${D}/etc
}
FILES_${PN} += " \
/home/root/qt_app \
/etc/init.d/startup.sh \
/etc/fb.modes \
"
Then in build/local.conf: CORE_IMAGE_EXTRA_APPEND += " filesystem "
```
So a few observations and follow-up questions on this:
1. Adding S=${WORKDIR} did the trick. Why is that? I don't use S anywhere
in my do_install().
2. In order to copy a bash script, I had to add RDEPENDS_${PN} += " bash "
to this secondary recipe.
3. In order to copy my Qt app, I also had to add its Qt dependencies as in
(2). Why do I need everything's dependencies even if I only wish to do a
copy in the rootfs?
4. Some of you have been suggesting adding the recipe to
CORE_IMAGE_EXTRA_INSTALL or CORE_IMAGE_EXTRA_APPEND. Both give me the same
result. Is there a fundamental difference?
4. To setup Yocto, I used Toradex's manifest for the Dunfell version, which
uses Yocto v3.1 LTS since I'm working on an Apalis iMX6 board:
https://developer.toradex.com/linux-bsp/os-development/build-yocto/build-a-reference-image-with-yocto-projectopenembedded
Thank you all again and I hope this helps others.
Anthony
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#59857): https://lists.yoctoproject.org/g/yocto/message/59857
Mute This Topic: https://lists.yoctoproject.org/mt/98649960/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-