All of lore.kernel.org
 help / color / mirror / Atom feed
* adding own shell script
@ 2018-10-29  9:50 Zolee K
  2018-10-29 12:26 ` Uwe Geuder
  0 siblings, 1 reply; 2+ messages in thread
From: Zolee K @ 2018-10-29  9:50 UTC (permalink / raw)
  To: yocto

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

Hi all,

I'd like to install my own test.sh script into the image, I created this
recipe file, however I dont know how to have bitbake put the my test.sh
into /etc folder

SUMMARY = "test.sh"
LICENSE = "Z"

SRC_URI = "\
        file://test.sh \
"

do_configure(){
  :
}

do_compile() {
  :
}


do_install() {
    install -d ${D}${sysconfdir}
    install -m 0770 ${WORKDIR}/test.sh ${D}${sysconfdir}/test.sh
}

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

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

* Re: adding own shell script
  2018-10-29  9:50 adding own shell script Zolee K
@ 2018-10-29 12:26 ` Uwe Geuder
  0 siblings, 0 replies; 2+ messages in thread
From: Uwe Geuder @ 2018-10-29 12:26 UTC (permalink / raw)
  To: yocto

On Mon, Oct 29, 2018 at 11:51 AM Zolee K zoleelikesdebian-at-gmail.com wrote:
> 
> I'd like to install my own test.sh script into the image, I created this
> recipe file, however I dont know how to have bitbake put the my test.sh
> into /etc folder
> 
> SUMMARY = "test.sh"
> LICENSE = "Z"
> 
> SRC_URI = "\
>         file://test.sh \
> "
>
> do_configure(){
>  :
> }
>
> do_compile() {
>  :
> }
> 
> 
> do_install() {
>    install -d ${D}${sysconfdir}
>    install -m 0770 ${WORKDIR}/test.sh ${D}${sysconfdir}/test.sh
> }

At least at the first glimpse this recipe looks to me like it might
work. (Executable code does not belong under /etc, but that is a
different issue)

However, bitbake will execute the tasks in the recipe only if they
are pulled in, i. e. some part of your image depends on the package
created. There are always many recipes in the layers of a Yocto based
project, but only those tasks which are really needed will be executed.

There are 2 ways to create the dependency

a.) directly into the image

https://www.yoctoproject.org/docs/2.5.1/mega-manual/mega-manual.html#var-IMAGE_INSTALL
https://www.yoctoproject.org/docs/2.5.1/mega-manual/mega-manual.html#var-PACKAGE_INSTALL

b.) indirectly by making some package already in your image runtime-depend on
your new package

https://www.yoctoproject.org/docs/2.5.1/mega-manual/mega-manual.html#var-RDEPENDS


Regards,

Uwe Geuder
Neuro Event Labs Oy
Tampere, Finland
uwe.gexder at neuroeventlabs.com (Bot check: fix one obvious typo)


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

end of thread, other threads:[~2018-10-29 12:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-29  9:50 adding own shell script Zolee K
2018-10-29 12:26 ` Uwe Geuder

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.