All of lore.kernel.org
 help / color / mirror / Atom feed
* Trouble Adding Files to rootfs
@ 2023-05-02 22:17 Anthony Abboud
  2023-05-03  0:51 ` Mohammed Hassan
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Anthony Abboud @ 2023-05-02 22:17 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 1090 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 2015 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Trouble Adding Files to rootfs
  2023-05-02 22:17 Trouble Adding Files to rootfs Anthony Abboud
@ 2023-05-03  0:51 ` Mohammed Hassan
  2023-05-03  1:06 ` MOHAMMED HASSAN
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Mohammed Hassan @ 2023-05-03  0:51 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 1533 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 2782 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Trouble Adding Files to rootfs
  2023-05-02 22:17 Trouble Adding Files to rootfs Anthony Abboud
  2023-05-03  0:51 ` Mohammed Hassan
@ 2023-05-03  1:06 ` MOHAMMED HASSAN
  2023-05-03  7:25 ` [yocto] " Mikko Rapeli
  2023-05-03  8:12 ` MOHAMMED HASSAN
  3 siblings, 0 replies; 9+ messages in thread
From: MOHAMMED HASSAN @ 2023-05-03  1:06 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 1529 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 2559 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [yocto] Trouble Adding Files to rootfs
  2023-05-02 22:17 Trouble Adding Files to rootfs Anthony Abboud
  2023-05-03  0:51 ` Mohammed Hassan
  2023-05-03  1:06 ` MOHAMMED HASSAN
@ 2023-05-03  7:25 ` Mikko Rapeli
  2023-05-03  8:12 ` MOHAMMED HASSAN
  3 siblings, 0 replies; 9+ messages in thread
From: Mikko Rapeli @ 2023-05-03  7:25 UTC (permalink / raw)
  To: Anthony Abboud; +Cc: yocto

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Trouble Adding Files to rootfs
  2023-05-02 22:17 Trouble Adding Files to rootfs Anthony Abboud
                   ` (2 preceding siblings ...)
  2023-05-03  7:25 ` [yocto] " Mikko Rapeli
@ 2023-05-03  8:12 ` MOHAMMED HASSAN
  2023-05-03  8:33   ` [yocto] " Josef Holzmayr
  3 siblings, 1 reply; 9+ messages in thread
From: MOHAMMED HASSAN @ 2023-05-03  8:12 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 1920 bytes --]

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

> 
> 
>

[-- Attachment #2: Type: text/html, Size: 3401 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [yocto] Trouble Adding Files to rootfs
  2023-05-03  8:12 ` MOHAMMED HASSAN
@ 2023-05-03  8:33   ` Josef Holzmayr
  2023-05-03 16:05     ` Anthony Abboud
       [not found]     ` <175BADC4F55E7349.14539@lists.yoctoproject.org>
  0 siblings, 2 replies; 9+ messages in thread
From: Josef Holzmayr @ 2023-05-03  8:33 UTC (permalink / raw)
  To: MOHAMMED HASSAN; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 3093 bytes --]

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 <hassanchattarki@gmail.com>
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.
> You automatically follow any topics you start or reply to.
> View/Reply Online (#59850):
> https://lists.yoctoproject.org/g/yocto/message/59850
> Mute This Topic: https://lists.yoctoproject.org/mt/98649960/4689568
> Group Owner: yocto+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
> jester@theyoctojester.info]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

[-- Attachment #2: Type: text/html, Size: 5463 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [yocto] Trouble Adding Files to rootfs
  2023-05-03  8:33   ` [yocto] " Josef Holzmayr
@ 2023-05-03 16:05     ` Anthony Abboud
       [not found]     ` <175BADC4F55E7349.14539@lists.yoctoproject.org>
  1 sibling, 0 replies; 9+ messages in thread
From: Anthony Abboud @ 2023-05-03 16:05 UTC (permalink / raw)
  To: Josef Holzmayr; +Cc: MOHAMMED HASSAN, yocto

[-- Attachment #1: Type: text/plain, Size: 6331 bytes --]

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

On Wed, May 3, 2023 at 4:33 AM Josef Holzmayr <jester@theyoctojester.info>
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 <hassanchattarki@gmail.com>
> 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/7620545
> Group Owner: yocto+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
> antabboud@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

-- 
*Anthony Abboud*
*B Eng., CEP, LSSGB*
Senior Software Engineering, R&D - Boston Scientific Corporation

*+1 (514) 224-4477*

[-- Attachment #2: Type: text/html, Size: 14174 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [yocto] Trouble Adding Files to rootfs
       [not found]     ` <175BADC4F55E7349.14539@lists.yoctoproject.org>
@ 2023-05-03 16:08       ` Anthony Abboud
       [not found]       ` <175BADF4585BE3A9.14539@lists.yoctoproject.org>
  1 sibling, 0 replies; 9+ messages in thread
From: Anthony Abboud @ 2023-05-03 16:08 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 71 bytes --]

Sorry about the weird formatting in the previous reply. New to this...

[-- Attachment #2: Type: text/html, Size: 103 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [yocto] Trouble Adding Files to rootfs
       [not found]       ` <175BADF4585BE3A9.14539@lists.yoctoproject.org>
@ 2023-05-03 16:13         ` Anthony Abboud
  0 siblings, 0 replies; 9+ messages in thread
From: Anthony Abboud @ 2023-05-03 16:13 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 2886 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 6017 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-05-03 16:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-02 22:17 Trouble Adding Files to rootfs Anthony Abboud
2023-05-03  0:51 ` Mohammed Hassan
2023-05-03  1:06 ` MOHAMMED HASSAN
2023-05-03  7:25 ` [yocto] " Mikko Rapeli
2023-05-03  8:12 ` MOHAMMED HASSAN
2023-05-03  8:33   ` [yocto] " Josef Holzmayr
2023-05-03 16:05     ` Anthony Abboud
     [not found]     ` <175BADC4F55E7349.14539@lists.yoctoproject.org>
2023-05-03 16:08       ` Anthony Abboud
     [not found]       ` <175BADF4585BE3A9.14539@lists.yoctoproject.org>
2023-05-03 16:13         ` Anthony Abboud

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.