Creating own recipe in yocto

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Creating own recipe in yocto

Jump to solution
1,380 Views
manjunathjoshi
Contributor V

Hello all,

Is there any way that we can create a recipe which can simply copy a file from host computer to the bitbake process so that after the complete bitbake process we may just have the file in the right place in yocto filesystem?

I know this is weird but is there a way? I tried as shown below it didn't work. do_install failure.

this is the .bb file in a new layer i have created.

SUMMARY = "Example to copy from my filesystem to yocto filesystem"

DESCRIPTION = "Not needed"

SECTION = "examples"

LICENSE = "MIT"

LIC_FILES_CHKSUM += "file://README;md5=0d20a0079cbd6add839dcca5f80c7d0b"

PR = "r0"

DEPENDS = "boost"

SRC_URI="file://README \

        "

S="${WORKDIR}"

do_install() {

     install -m 0755 ${WORKDIR}/README  ${D}$/usr/sbin/README

}

Regards,

Manju

Labels (3)
0 Kudos
1 Solution
729 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello Manju,

Your recipe looks good in general but it may need some tweaking. Would you please try with the following changes? (The first part of the recipe looks good).

do_install() {

   install -d  ${D}$/usr/sbin/

     install -m 0755 ${WORKDIR}/README  ${D}$/usr/sbin/

}

FILES_${PN} = "$/usr/sbin/README"

I hope this helps, let us know of your progress! One would think that copying a file into the filesystem should be pretty straightforward but it’s not so trivial in Yocto. I’m sure other community users may have the same question.

Regards,

Gus

View solution in original post

0 Kudos
2 Replies
730 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello Manju,

Your recipe looks good in general but it may need some tweaking. Would you please try with the following changes? (The first part of the recipe looks good).

do_install() {

   install -d  ${D}$/usr/sbin/

     install -m 0755 ${WORKDIR}/README  ${D}$/usr/sbin/

}

FILES_${PN} = "$/usr/sbin/README"

I hope this helps, let us know of your progress! One would think that copying a file into the filesystem should be pretty straightforward but it’s not so trivial in Yocto. I’m sure other community users may have the same question.

Regards,

Gus

0 Kudos
729 Views
manjunathjoshi
Contributor V

Hello gusarambula,

I am sorry i didn't update this on the community. Your answer is right i have already done this. But right now i am in to writing a recipe which does every bit of a standard one. I have posted the same in

Custom recipe for YOCTO

Please reply if you have needed information on the same.

Thanks a lot in advance.

Regards

Manju

0 Kudos