Re: [yocto] Trouble Adding Files to rootfs
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//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: yocto+ow...@lists.yoctoproject.org Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [yocto] Trouble Adding Files to rootfs
Sorry about the weird formatting in the previous reply. New to this... -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#59856): https://lists.yoctoproject.org/g/yocto/message/59856 Mute This Topic: https://lists.yoctoproject.org/mt/98649960/21656 Group Owner: yocto+ow...@lists.yoctoproject.org Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [yocto] Trouble Adding Files to rootfs
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//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 On Wed, May 3, 2023 at 4:33 AM Josef Holzmayr wrote: > My guess is that you are on a recent release, which as changed syntax. To > add files to packages, you need: > > FILES:${PN} += ... > > But I agree with the other responders, please be as precise as possible. > Name your used versions please, for one thing. > The other part is that things will not be added to an image automatically > just because you wrote a recipe. You have to add them explicitly. Its a bit > dated by now, but I think most of this is explained in the various > livecoding sessions: > https://www.youtube.com/playlist?list=PLD4M5FoHz-TxMfBFrDKfIS_GLY25Qsfyj > > Greetz > > > On Wed, May 3, 2023 at 10:12 AM MOHAMMED HASSAN > wrote: > >> On Tue, May 2, 2023 at 03:17 PM, Anthony Abboud wrote: >> >> HI Yocto Community, >> >> I am currently working on build a custom Boot2Qt image to learn about >> How-To's since it's my first time playing with Yocto. I am successfully >> able to build an image for my system; manually inserting and launching my >> Qt application works great. >> >> Now I want to include this app and some files into the rootfs of the >> image. I modified the recipe by adding the following lines at the end to >> attempt this: >> >> ``` >> >> Ignore my previous posts Ive made some mistakes there. >> 1) Create a custom recipe file. >> >> >> SRC_URI += " \ >> file://qtApp_qml \ >> file://startup.sh \ >> file://fb.modes \ >> " >> >> >> Add line S="${WORKDIR}" >> >> >> do_install() { >> install -d ${D}/home/root >> install -m 755 ${WORKDIR}/qtApp_qml ${D}/home/root/ >> >> install -d ${D}/etc/init.d >> install -m 755 ${WORKDIR}/startup.sh ${D}/etc/init.d/ >> >> install -d ${D}/etc >> install -m 755 ${WORKDIR}/fb.modes ${D}/etc/ >> } >> >> FILES_${PN} += " \ >> /home/root/qtApp_qml \ >> /etc/init.d/startup.sh \ >> /etc/fb.modes \ >> " >> ``` >> >> >> Run bitbake recipename >> If it runs successfully, then add the below in your local.conf folder. >> CORE_IMAGE_EXTRA_INSTALL_append += " recipename " >> Next bitbake target >> >> >> But I'm simply unable to get those three files to show up at all in the >> final build
Re: [yocto] Trouble Adding Files to rootfs
My guess is that you are on a recent release, which as changed syntax. To add files to packages, you need: FILES:${PN} += ... But I agree with the other responders, please be as precise as possible. Name your used versions please, for one thing. The other part is that things will not be added to an image automatically just because you wrote a recipe. You have to add them explicitly. Its a bit dated by now, but I think most of this is explained in the various livecoding sessions: https://www.youtube.com/playlist?list=PLD4M5FoHz-TxMfBFrDKfIS_GLY25Qsfyj Greetz On Wed, May 3, 2023 at 10:12 AM MOHAMMED HASSAN wrote: > On Tue, May 2, 2023 at 03:17 PM, Anthony Abboud wrote: > > HI Yocto Community, > > I am currently working on build a custom Boot2Qt image to learn about > How-To's since it's my first time playing with Yocto. I am successfully > able to build an image for my system; manually inserting and launching my > Qt application works great. > > Now I want to include this app and some files into the rootfs of the > image. I modified the recipe by adding the following lines at the end to > attempt this: > > ``` > > Ignore my previous posts Ive made some mistakes there. > 1) Create a custom recipe file. > > > SRC_URI += " \ > file://qtApp_qml \ > file://startup.sh \ > file://fb.modes \ > " > > > Add line S="${WORKDIR}" > > > do_install() { > install -d ${D}/home/root > install -m 755 ${WORKDIR}/qtApp_qml ${D}/home/root/ > > install -d ${D}/etc/init.d > install -m 755 ${WORKDIR}/startup.sh ${D}/etc/init.d/ > > install -d ${D}/etc > install -m 755 ${WORKDIR}/fb.modes ${D}/etc/ > } > > FILES_${PN} += " \ > /home/root/qtApp_qml \ > /etc/init.d/startup.sh \ > /etc/fb.modes \ > " > ``` > > > Run bitbake recipename > If it runs successfully, then add the below in your local.conf folder. > CORE_IMAGE_EXTRA_INSTALL_append += " recipename " > Next bitbake target > > > But I'm simply unable to get those three files to show up at all in the > final build (both the folders and files!). > > I've tried a few variations I saw around but still nothing. Any idea > what's missing? > > Would it be possible for you to share what changes you have tried. To be > honest I am a beginner too and want too learn more, so I got curious. > Also the above will most probably work, but in case you solve it with any > other method, then please post here for other's reference. > > > > Thanks! > Anthony > > > Best Regards, > Hassan > > > > > > > -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#59851): https://lists.yoctoproject.org/g/yocto/message/59851 Mute This Topic: https://lists.yoctoproject.org/mt/98649960/21656 Group Owner: yocto+ow...@lists.yoctoproject.org Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [yocto] Trouble Adding Files to rootfs
On Tue, May 2, 2023 at 03:17 PM, Anthony Abboud wrote: > > HI Yocto Community, > > I am currently working on build a custom Boot2Qt image to learn about > How-To's since it's my first time playing with Yocto. I am successfully > able to build an image for my system; manually inserting and launching my > Qt application works great. > > Now I want to include this app and some files into the rootfs of the > image. I modified the recipe by adding the following lines at the end to > attempt this: > > ``` > > Ignore my previous posts Ive made some mistakes there. 1) Create a custom recipe file. > > > SRC_URI += " \ > file://qtApp_qml \ > file://startup.sh \ > file://fb.modes \ > " > > Add line S="${WORKDIR}" > > > do_install() { > install -d ${D}/home/root > install -m 755 ${WORKDIR}/qtApp_qml ${D}/home/root/ > > install -d ${D}/etc/init.d > install -m 755 ${WORKDIR}/startup.sh ${D}/etc/init.d/ > > install -d ${D}/etc > install -m 755 ${WORKDIR}/fb.modes ${D}/etc/ > } > > FILES_${PN} += " \ > /home/root/qtApp_qml \ > /etc/init.d/startup.sh \ > /etc/fb.modes \ > " > ``` > > Run bitbake recipename If it runs successfully, then add the below in your local.conf folder. CORE_IMAGE_EXTRA_INSTALL_append += " recipename " Next bitbake target > > > But I'm simply unable to get those three files to show up at all in the > final build (both the folders and files!). > > I've tried a few variations I saw around but still nothing. Any idea > what's missing? > Would it be possible for you to share what changes you have tried. To be honest I am a beginner too and want too learn more, so I got curious. Also the above will most probably work, but in case you solve it with any other method, then please post here for other's reference. > > > > Thanks! > Anthony > Best Regards, Hassan > > > -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#59850): https://lists.yoctoproject.org/g/yocto/message/59850 Mute This Topic: https://lists.yoctoproject.org/mt/98649960/21656 Group Owner: yocto+ow...@lists.yoctoproject.org Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [yocto] Trouble Adding Files to rootfs
On Wed, May 3, 2023 at 03:47 AM, Anthony Abboud wrote: > > HI Yocto Community, > > I am currently working on build a custom Boot2Qt image to learn about > How-To's since it's my first time playing with Yocto. I am successfully > able to build an image for my system; manually inserting and launching my > Qt application works great. > > Now I want to include this app and some files into the rootfs of the > image. I modified the recipe by adding the following lines at the end to > attempt this: > > ``` > SRC_URI += " \ > file://qtApp_qml \ > file://startup.sh \ > file://fb.modes \ > " > > I am also a beginner but try adding S=${WORKDIR} and then building. > > > do_install() { > install -d ${D}/home/root > install -m 755 ${WORKDIR}/qtApp_qml ${D}/home/root/ > > install -d ${D}/etc/init.d > install -m 755 ${WORKDIR}/startup.sh ${D}/etc/init.d/ > > install -d ${D}/etc > install -m 755 ${WORKDIR}/fb.modes ${D}/etc/ > } > > FILES_${PN} += " \ > /home/root/qtApp_qml \ > /etc/init.d/startup.sh \ > /etc/fb.modes \ > " > ``` > > After this run bitbake recipe. If there are no errors, then add the line CORE_IMAGE_EXTRA_APPEND += “ recipe “ in local.conf folder. Bitbake target > > > But I'm simply unable to get those three files to show up at all in the > final build (both the folders and files!). > > I've tried a few variations I saw around but still nothing. Any idea > what's missing? > > Thanks! > Anthony > > Regards, Hassan -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#59848): https://lists.yoctoproject.org/g/yocto/message/59848 Mute This Topic: https://lists.yoctoproject.org/mt/98649960/21656 Group Owner: yocto+ow...@lists.yoctoproject.org Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [yocto] Trouble Adding Files to rootfs
Hi, On Tue, May 02, 2023 at 06:17:27PM -0400, Anthony Abboud wrote: > HI Yocto Community, > > I am currently working on build a custom Boot2Qt image to learn about > How-To's since it's my first time playing with Yocto. I am successfully > able to build an image for my system; manually inserting and launching my > Qt application works great. > > Now I want to include this app and some files into the rootfs of the image. > I modified the recipe by adding the following lines at the end to attempt > this: > > ``` > SRC_URI += " \ > file://qtApp_qml \ > file://startup.sh \ > file://fb.modes \ > " Image recipes by default don't support SRC_URI or normal build related tasks/configs. Thus it's better to have a custom recipe to build the sources into binary packages, which then can be added to the image via IMAGE_INSTALL variable, see https://docs.yoctoproject.org/singleindex.html#customizing-images That said, this trick will enable SRC_URI handling in image recipes: python __anonymous() { d.delVarFlag("do_fetch", "noexec") d.delVarFlag("do_unpack", "noexec") } My use case for this was image specific config files for tests, which are really specific to images and which don't belong to any other SW component/recipe. Cheers, -Mikko -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#59847): https://lists.yoctoproject.org/g/yocto/message/59847 Mute This Topic: https://lists.yoctoproject.org/mt/98649960/21656 Group Owner: yocto+ow...@lists.yoctoproject.org Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [yocto] Trouble Adding Files to rootfs
On Tue, May 2, 2023 at 03:17 PM, Anthony Abboud wrote: > > HI Yocto Community, > > I am currently working on build a custom Boot2Qt image to learn about > How-To's since it's my first time playing with Yocto. I am successfully > able to build an image for my system; manually inserting and launching my > Qt application works great. > > Now I want to include this app and some files into the rootfs of the > image. I modified the recipe by adding the following lines at the end to > attempt this: > > ``` > SRC_URI += " \ > file://qtApp_qml \ > file://startup.sh \ > file://fb.modes \ > " > > Add S=${WORKDIR} > > > do_install() { > install -d ${D}/home/root > install -m 755 ${WORKDIR}/qtApp_qml ${D}/home/root/ > > install -d ${D}/etc/init.d > install -m 755 ${WORKDIR}/startup.sh ${D}/etc/init.d/ > > install -d ${D}/etc > install -m 755 ${WORKDIR}/fb.modes ${D}/etc/ > } > > FILES_${PN} += " \ > /home/root/qtApp_qml \ > /etc/init.d/startup.sh \ > /etc/fb.modes \ > " > `` > > Run bitbake recipename if it builds successfully then add the recipe to local.conf folder by appending the line CORE_IMAGE_EXTRA_INSTALL += “ recipename “ Save and run bitbake target I've tried a few variations I saw around but still nothing. Any idea what's missing? Can you please elaborate on all variations you have tried. I am also a beginner on yocto so my additions may not work, but give it a try and let me know once the files are loaded. Regards, Hassan -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#59846): https://lists.yoctoproject.org/g/yocto/message/59846 Mute This Topic: https://lists.yoctoproject.org/mt/98649960/21656 Group Owner: yocto+ow...@lists.yoctoproject.org Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[yocto] Trouble Adding Files to rootfs
HI Yocto Community, I am currently working on build a custom Boot2Qt image to learn about How-To's since it's my first time playing with Yocto. I am successfully able to build an image for my system; manually inserting and launching my Qt application works great. Now I want to include this app and some files into the rootfs of the image. I modified the recipe by adding the following lines at the end to attempt this: ``` SRC_URI += " \ file://qtApp_qml \ file://startup.sh \ file://fb.modes \ " do_install() { install -d ${D}/home/root install -m 755 ${WORKDIR}/qtApp_qml ${D}/home/root/ install -d ${D}/etc/init.d install -m 755 ${WORKDIR}/startup.sh ${D}/etc/init.d/ install -d ${D}/etc install -m 755 ${WORKDIR}/fb.modes ${D}/etc/ } FILES_${PN} += " \ /home/root/qtApp_qml \ /etc/init.d/startup.sh \ /etc/fb.modes \ " ``` But I'm simply unable to get those three files to show up at all in the final build (both the folders and files!). I've tried a few variations I saw around but still nothing. Any idea what's missing? Thanks! Anthony -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#59845): https://lists.yoctoproject.org/g/yocto/message/59845 Mute This Topic: https://lists.yoctoproject.org/mt/98649960/21656 Group Owner: yocto+ow...@lists.yoctoproject.org Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-